!function(t){var e={};function n(r){if(e[r])return e[r].exports;var i=e[r]={i:r,l:!1,exports:{}};return t[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var i in t)n.d(r,i,function(e){return t[e]}.bind(null,i));return r},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=2)}([function(t,e){},function(t,e,n){},function(t,e,n){"use strict";function r(t){return function(t){if(Array.isArray(t))return t}(t)||function(t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(t))return Array.from(t)}(t)||function(t,e){if(!t)return;if("string"==typeof t)return i(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return i(t,e)}(t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function i(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function a(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}n.r(e),n.d(e,"spreadsheet",(function(){return Is}));var l=function(){function t(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";o(this,t),"string"==typeof e?(this.el=document.createElement(e),this.el.className=n):this.el=e,this.data={}}var e,n,i;return e=t,(n=[{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 n=r(t.split(".")),i=n[0],o=n.slice(1),a=i;return"mousewheel"===a&&/Firefox/i.test(window.navigator.userAgent)&&(a="DOMMouseScroll"),this.el.addEventListener(a,(function(t){e(t);for(var n=0;n<o.length;n+=1){var r=o[n];if("left"===r&&0!==t.button)return;if("right"===r&&2!==t.button)return;"stop"===r&&t.stopPropagation()}})),this}},{key:"offset",value:function(t){var e=this;if(void 0!==t)return Object.keys(t).forEach((function(n){e.css(n,"".concat(t[n],"px"))})),this;var n=this.el;return{top:n.offsetTop,left:n.offsetLeft,height:n.offsetHeight,width:n.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,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return 0===arguments.length?this.el.childNodes:(n.forEach((function(e){return t.child(e)})),this)}},{key:"removeChild",value:function(t){this.el.removeChild(t)}},{key:"child",value:function(e){var n=e;return"string"==typeof e?n=document.createTextNode(e):e instanceof t&&(n=e.el),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.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 n=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){n.el.setAttribute(e,t[e])}))}return this}},{key:"removeAttr",value:function(t){return this.el.removeAttribute(t),this}},{key:"html",value:function(t){return void 0!==t?(this.el.innerHTML=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,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return n.forEach((function(e){return t.el.style.removeProperty(e)})),this}},{key:"css",value:function(t,e){var n=this;return void 0===e&&"string"!=typeof t?(Object.keys(t).forEach((function(e){n.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}}])&&a(e.prototype,n),i&&a(e,i),t}(),c=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return new l(t,e)};n(0);function u(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(t)))return;var n=[],r=!0,i=!1,o=void 0;try{for(var a,l=t[Symbol.iterator]();!(r=(a=l.next()).done)&&(n.push(a.value),!e||n.length!==e);r=!0);}catch(t){i=!0,o=t}finally{try{r||null==l.return||l.return()}finally{if(i)throw o}}return n}(t,e)||function(t,e){if(!t)return;if("string"==typeof t)return s(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return s(t,e)}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function s(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}var f=["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 h(t){for(var e="",n=t;n>=f.length;)n/=f.length,n-=1,e+=f[parseInt(n,10)%f.length];return e+=f[t%f.length]}function d(t){for(var e=0,n=0;n<t.length-1;n+=1){var r=t.charCodeAt(n)-65,i=t.length-1-n;e+=Math.pow(f.length,i)+f.length*r}return e+=t.charCodeAt(t.length-1)-65}function p(t){for(var e="",n="",r=0;r<t.length;r+=1)t.charAt(r)>="0"&&t.charAt(r)<="9"?n+=t.charAt(r):e+=t.charAt(r);return[d(e),parseInt(n,10)-1]}function y(t,e){return"".concat(h(t)).concat(e+1)}function v(t,e,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:function(){return!0};if(0===e&&0===n)return t;var i=p(t),o=u(i,2),a=o[0],l=o[1];return r(a,l)?y(a+e,l+n):t}function b(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(t)))return;var n=[],r=!0,i=!1,o=void 0;try{for(var a,l=t[Symbol.iterator]();!(r=(a=l.next()).done)&&(n.push(a.value),!e||n.length!==e);r=!0);}catch(t){i=!0,o=t}finally{try{r||null==l.return||l.return()}finally{if(i)throw o}}return n}(t,e)||function(t,e){if(!t)return;if("string"==typeof t)return m(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return m(t,e)}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function m(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function g(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function w(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}var k=function(){function t(e,n,r,i){var o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0,a=arguments.length>5&&void 0!==arguments[5]?arguments[5]:0;g(this,t),this.sri=e,this.sci=n,this.eri=r,this.eci=i,this.w=o,this.h=a}var e,n,r;return e=t,r=[{key:"valueOf",value:function(e){var n=e.split(":"),r=b(p(n[0]),2),i=r[0],o=r[1],a=o,l=i;if(n.length>1){var c=b(p(n[1]),2);l=c[0],a=c[1]}return new t(o,i,a,l)}}],(n=[{key:"set",value:function(t,e,n,r){this.sri=t,this.sci=e,this.eri=n,this.eci=r}},{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,n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];if(1===r.length){var o=p(r[0]),a=b(o,2);e=a[0],t=a[1]}else 2===r.length&&(t=r[0],e=r[1]);var l=this.sri,c=this.sci,u=this.eri,s=this.eci;return l<=t&&t<=u&&c<=e&&e<=s}},{key:"each",value:function(t){for(var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(){return!0},n=this.sri,r=this.sci,i=this.eri,o=this.eci,a=n;a<=i;a+=1)if(e(a))for(var l=r;l<=o;l+=1)t(a,l)}},{key:"eachReversCol",value:function(t){for(var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(){return!0},n=this.sri,r=this.sci,i=this.eri,o=this.eci,a=n;a<=i;a+=1)if(e(a))for(var l=o;l>=r;l-=1)t(a,l)}},{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 n=this.sri,r=this.sci,i=this.eri,o=this.eci;return new t(e.sri<n?e.sri:n,e.sci<r?e.sci:r,e.eri>i?e.eri:i,e.eci>o?e.eci:o)}},{key:"extendRange",value:function(e){var n=this.sri,r=this.sci,i=this.eri,o=this.eci,a=e.eri-e.sri+1,l=e.eci-e.sci+1,c=i-n+1,u=o-r+1;return new t(n,r,n+(c<a?a:c-c%a)-1,r+(u<l?l:u-u%l)-1)}},{key:"difference",value:function(e){var n=[],r=function(e,r,i,o){n.push(new t(e,r,i,o))},i=this.sri,o=this.sci,a=this.eri,l=this.eci,c=e.sri-i,u=e.sci-o,s=a-e.eri,f=l-e.eci;return c>0?(r(i,o,e.sri-1,l),s>0?(r(e.eri+1,o,a,l),u>0&&r(e.sri,o,e.eri,e.sci-1),f>0&&r(e.sri,e.eci+1,e.eri,l)):(u>0&&r(e.sri,o,a,e.sci-1),f>0&&r(e.sri,e.eci+1,a,l))):s>0&&(r(e.eri+1,o,a,l),u>0&&r(i,o,e.eri,e.sci-1),f>0&&r(i,e.eci+1,e.eri,l)),u>0?(r(i,o,a,e.sci-1),f>0?(r(i,e.eri+1,a,l),c>0&&r(i,e.sci,e.sri-1,e.eci),s>0&&r(e.sri+1,e.sci,a,e.eci)):(c>0&&r(i,e.sci,e.sri-1,l),s>0&&r(e.sri+1,e.sci,a,l))):f>0&&(r(a,e.eci+1,a,l),c>0&&r(i,o,e.sri-1,e.eci),s>0&&r(e.eri+1,o,a,e.eci)),n}},{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,n=this.eri,r=this.eci,i=y(e,t);return this.multiple()&&(i="".concat(i,":").concat(y(r,n))),i}},{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}}])&&w(e.prototype,n),r&&w(e,r),t}();function S(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}var O=function(){function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.range=new k(0,0,0,0),this.ri=0,this.ci=0}var e,n,r;return e=t,(n=[{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()}}])&&S(e.prototype,n),r&&S(e,r),t}();var x=function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.x=0,this.y=0,this.ri=0,this.ci=0,this.riact=0};function C(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}var E=function(){function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.undoItems=[],this.redoItems=[]}var e,n,r;return e=t,(n=[{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 n=this.undoItems,r=this.redoItems;this.canUndo()&&(r.push(JSON.stringify(t)),e(JSON.parse(n.pop())))}},{key:"redo",value:function(t,e){var n=this.undoItems,r=this.redoItems;this.canRedo()&&(n.push(JSON.stringify(t)),e(JSON.parse(r.pop())))}}])&&C(e.prototype,n),r&&C(e,r),t}();function j(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}var R=function(){function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.range=null,this.state="clear",this.textdata=null}var e,n,r;return e=t,(n=[{key:"copy",value:function(t,e){this.range=t,this.state="copy";for(var n=t.sri,r=t.sci,i=t.eri,o=t.eci,a="",l=n;l<=i;l+=1){if(e._[l])for(var c=r;c<=o;c+=1){if(e._[l].cells&&e._[l].cells[c]){var u=e._[l].cells[c].text;u&&(u.indexOf("\n")>=0&&(u='"'+u+'"'),a+=u)}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)}}])&&j(e.prototype,n),r&&j(e,r),t}();function _(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function A(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function T(t,e,n){return e&&A(t.prototype,e),n&&A(t,n),t}var P=function(){function t(e,n,r){_(this,t),this.ci=e,this.operator=n,this.value=r}return T(t,[{key:"set",value:function(t,e){this.operator=t,this.value=e}},{key:"includes",value:function(t){var e=this.operator,n=this.value;return"all"===e||"in"===e&&n.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}(),D=function(){function t(e,n){_(this,t),this.ci=e,this.order=n}return T(t,[{key:"asc",value:function(){return"asc"===this.order}},{key:"desc",value:function(){return"desc"===this.order}}]),t}(),I=function(){function t(){_(this,t),this.ref=null,this.filters=[],this.sort=null}return T(t,[{key:"setData",value:function(t){var e=t.ref,n=t.filters,r=t.sort;null!=e&&(this.ref=e,this.filters=n.map((function(t){return new P(t.ci,t.operator,t.value)})),r&&(this.sort=new D(r.ci,r.order)))}},{key:"getData",value:function(){if(this.active()){var t=this.ref,e=this.filters,n=this.sort;return{ref:t,filters:e.map((function(t){return t.getData()})),sort:n}}return{}}},{key:"addFilter",value:function(t,e,n){var r=this.getFilter(t);null==r?this.filters.push(new P(t,e,n)):r.set(e,n)}},{key:"setSort",value:function(t,e){this.sort=e?new D(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,n=0;n<e.length;n+=1)if(e[n].ci===t)return e[n];return null}},{key:"filteredRows",value:function(t){var e=new Set,n=new Set;if(this.active())for(var r=this.range(),i=r.sri,o=r.eri,a=this.filters,l=i+1;l<=o;l+=1)for(var c=0;c<a.length;c+=1){var u=a[c],s=t(l,u.ci),f=s&&0!=s.text.trim().length?s.text:"";if(!u.includes(f)){e.add(l);break}n.add(l)}return{rset:e,fset:n}}},{key:"items",value:function(t,e){var n={};if(this.active())for(var r=this.range(),i=r.sri,o=r.eri,a=i+1;a<=o;a+=1){var l=e(a,t);if(null===l||/^\s*$/.test(l.text))n[""]=(n[""]||0)+1;else{var c=l.text,u=(n[c]||0)+1;n[c]=u}}return n}},{key:"range",value:function(){return k.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}();function z(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function M(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}var N=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];z(this,t),this._=e}var e,n,r;return e=t,(n=[{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 n=0;n<this._.length;n+=1){var r=this._[n];if(r.includes(t,e))return r}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:"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,n,r){this._.forEach((function(i){var o=i.sri,a=i.sci,l=i.eri,c=i.eci,u=i;"row"===t?o>=e?(u.sri+=n,u.eri+=n):o<e&&e<=l&&(u.eri+=n,r(o,a,n,0)):"column"===t&&(a>=e?(u.sci+=n,u.eci+=n):a<e&&e<=c&&(u.eci+=n,r(o,a,0,n)))}))}},{key:"move",value:function(t,e,n){this._.forEach((function(r){var i=r;i.within(t)&&(i.eri+=e,i.sri+=e,i.sci+=n,i.eci+=n)}))}},{key:"setData",value:function(t){return this._=t.map((function(t){return k.valueOf(t)})),this}},{key:"getData",value:function(){return this._.map((function(t){return t.toString()}))}}])&&M(e.prototype,n),r&&M(e,r),t}();var H=function t(){for(var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];return r.forEach((function(n){Object.keys(n).forEach((function(r){var i=n[r];"string"==typeof i||"number"==typeof i||"boolean"==typeof i?e[r]=i:"function"!=typeof i&&!Array.isArray(i)&&i instanceof Object?(e[r]=e[r]||{},t(e[r],i)):e[r]=i}))})),e};function F(t){for(var e="".concat(t),n=0,r=!1,i=0;i<e.length;i+=1)!0===r&&(n+=1),"."===e.charAt(i)&&(r=!0);return n}function W(t,e,n){if(Number.isNaN(e)||Number.isNaN(n))return e+t+n;var r=F(e),i=F(n),o=Number(e),a=Number(n),l=0;return"-"===t?l=o-a:"+"===t?l=o+a:"*"===t?l=o*a:"/"===t&&(l=o/a),l.toFixed(Math.max(r,i))}var L={cloneDeep:function(t){return JSON.parse(JSON.stringify(t))},merge:function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return H.apply(void 0,[{}].concat(e))},equals:function t(e,n){var r=Object.keys(e);if(r.length!==Object.keys(n).length)return!1;for(var i=0;i<r.length;i+=1){var o=r[i],a=e[o],l=n[o];if(void 0===l)return!1;if("string"==typeof a||"number"==typeof a||"boolean"==typeof a){if(a!==l)return!1}else if(Array.isArray(a)){if(a.length!==l.length)return!1;for(var c=0;c<a.length;c+=1)if(!t(a[c],l[c]))return!1}else if("function"!=typeof a&&!Array.isArray(a)&&a instanceof Object&&!t(a,l))return!1}return!0},arrayEquals:function(t,e){if(t.length!==e.length)return!1;for(var n=0;n<t.length;n+=1)if(t[n]!==e[n])return!1;return!0},sum:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(t){return t},n=0,r=0;return Object.keys(t).forEach((function(i){n+=e(t[i],i),r+=1})),[n,r]},rangeEach:function(t,e,n){for(var r=t;r<e;r+=1)n(r)},rangeSum:function(t,e,n){for(var r=0,i=t;i<e;i+=1)r+=n(i);return r},rangeReduceIf:function(t,e,n,r,i,o){for(var a=n,l=r,c=t;c<e&&!(a>i);c+=1)a+=l=o(c);return[c,a-l,l]},deleteProperty:function(t,e){var n=t["".concat(e)];return delete t["".concat(e)],n},numberCalc:W};function V(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(t)))return;var n=[],r=!0,i=!1,o=void 0;try{for(var a,l=t[Symbol.iterator]();!(r=(a=l.next()).done)&&(n.push(a.value),!e||n.length!==e);r=!0);}catch(t){i=!0,o=t}finally{try{r||null==l.return||l.return()}finally{if(i)throw o}}return n}(t,e)||function(t,e){if(!t)return;if("string"==typeof t)return U(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return U(t,e)}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function U(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function q(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}var B=function(){function t(e){var n=e.len,r=e.height;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this._={},this.len=n,this.height=r}var e,n,r;return e=t,(n=[{key:"getHeight",value:function(t,e){if(this.isHide(t))return 0;if(e&&e.has(t))return 0;var n=this.get(t);return n&&n.height?n.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 n=this.getOrNew(t);!0===e?n.hide=!0:delete n.hide}},{key:"setStyle",value:function(t,e){this.getOrNew(t).style=e}},{key:"sumHeight",value:function(t,e){var n=this,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:new Set;return L.rangeSum(t,e,(function(t){return r&&r.has(t)?0:n.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 n=this.get(t);return void 0!==n&&void 0!==n.cells&&void 0!==n.cells[e]?n.cells[e]:null}},{key:"getCellMerge",value:function(t,e){var n=this.getCell(t,e);return n&&n.merge?n.merge:[0,0]}},{key:"getCellOrNew",value:function(t,e){var n=this.getOrNew(t);return n.cells[e]=n.cells[e]||{},n.cells[e]}},{key:"setCell",value:function(t,e,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"all",i=this.getOrNew(t);"all"===r?i.cells[e]=n:"text"===r?(i.cells[e]=i.cells[e]||{},i.cells[e].text=n.text):"format"===r&&(i.cells[e]=i.cells[e]||{},i.cells[e].style=n.style,n.merge&&(i.cells[e].merge=n.merge))}},{key:"setCellText",value:function(t,e,n,r,i){var o=this.getCellOrNew(t,e);o.text=n,i?o.f=i:delete o.f,r?o.ufv=r:delete o.ufv}},{key:"updateOneCell",value:function(t){this.setCellText(t.ri,t.ci,t.text,t.ufv,t.f)}},{key:"copyPaste",value:function(t,e,n){var r=arguments.length>3&&void 0!==arguments[3]&&arguments[3],i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:function(){},o=t.sri,a=t.sci,l=t.eri,c=t.eci,u=new Array,s=new Array,f=e.sri>=0?e.sri:0,h=e.sci>=0?e.sci:0,d=e.eri,p=e.eci,y=t.size(),b=V(y,2),m=b[0],g=b[1],w=e.size(),k=V(w,2),S=k[0],O=k[1],x=!0,C=0;(d<o||p<a)&&(x=!1,C=d<o?S:O);for(var E=o;E<=l;E+=1)for(var j=a;j<=c;j+=1)for(var R=f;R<=d;R+=m)for(var _=h;_<=p;_+=g){var A=R+(E-o),T=_+(j-a);if(A!==E||T!==j){var P=this._[E]&&this._[E].cells&&this._[E].cells[j],D=P?L.cloneDeep(this._[E].cells[j]):{};if(A!==E||T!==j){r&&D&&D.text&&D.text.length>0&&function(){var t=D.text,e=_-h+(R-f)+2;if(x||(e-=C+1),"="===t[0])D.text=t.replace(/\w{1,3}\d/g,(function(t){var n=0,r=0;return o===f?n=e-1:r=e-1,/^\d+$/.test(t)?t:v(t,n,r)}));else if(m<=1&&g>1&&(f>l||d<o)||g<=1&&m>1&&(h>c||p<a)||m<=1&&g<=1){var n=/[\\.\d]+$/.exec(t);if(null!==n){var r=Number(n[0])+e-1;D.text=t.substring(0,n.index)+r}}}();var I={ri:A,ci:T,text:D.f?D.f:D.text},z={ri:A,ci:T,ncell:D};u.push(I),s.push(z)}}}for(var M=0;M<s.length;M++)this.setCell(s[M].ri,s[M].ci,s[M].ncell,n),i(s[M].ri,s[M].ci,s[M].ncell);return u}},{key:"cutPaste",value:function(t,e){var n=this,r={};this.each((function(i){n.eachCells(i,(function(o){var a=parseInt(i,10),l=parseInt(o,10);t.includes(i,o)&&(a=e.sri+(a-t.sri),l=e.sci+(l-t.sci)),r[a]=r[a]||{cells:{}},r[a].cells[l]=n._[i].cells[o],r[a].height=n._[i].height}))})),this._=r}},{key:"paste",value:function(t,e){var n=this,r=new Array;if(!(t.length<=0)){var i=e.sri,o=e.sci;return t.forEach((function(t,e){var a=i+e;t.forEach((function(t,e){var i=o+e;if(i<=1e3){n.setCellText(a,i,t);var l={ri:a,ci:i,text:t};r.push(l)}}))})),r}}},{key:"insert",value:function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,r={};this.each((function(i,o){var a=parseInt(i,10);a>=t&&(a+=n,e.eachCells(i,(function(e,r){r.text&&"="===r.text[0]&&(r.text=r.text.replace(/\w{1,3}\d/g,(function(e){return v(e,0,n,(function(e,n){return n>=t}))})))}))),r[a]=o})),this._=r,this.len+=n}},{key:"delete",value:function(t,e){var n=this,r=e-t+1,i={};this.each((function(o,a){var l=parseInt(o,10);l<t?i[l]=a:o>e&&(i[l-r]=a,n.eachCells(o,(function(t,n){n.text&&"="===n.text[0]&&(n.text=n.text.replace(/\w{1,3}\d/g,(function(t){return v(t,0,-r,(function(t,n){return n>e}))})))})))})),this._=i,this.len-=r}},{key:"insertColumn",value:function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;this.each((function(r,i){var o={};e.eachCells(r,(function(e,r){var i=parseInt(e,10);i>=t&&(i+=n,r.text&&"="===r.text[0]&&(r.text=r.text.replace(/\w{1,3}\d/g,(function(e){return v(e,n,0,(function(e){return e>=t}))})))),o[i]=r})),i.cells=o}))}},{key:"deleteColumn",value:function(t,e){var n=this,r=e-t+1;this.each((function(i,o){var a={};n.eachCells(i,(function(n,i){var o=parseInt(n,10);o<t?a[o]=i:o>e&&(a[o-r]=i,i.text&&"="===i.text[0]&&(i.text=i.text.replace(/\w{1,3}\d/g,(function(t){return v(t,-r,0,(function(t){return t>e}))}))))})),o.cells=a}))}},{key:"deleteCells",value:function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"all";t.each((function(t,r){e.deleteCell(t,r,n)}))}},{key:"deleteCell",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"all",r=this.get(t);if(null!==r){var i=this.getCell(t,e);null!==i&&("all"===n?delete r.cells[e]:"text"===n?(i.text&&delete i.text,i.value&&delete i.value):"format"===n?(void 0!==i.style&&delete i.style,i.merge&&delete i.merge):"merge"===n&&i.merge&&delete i.merge)}}},{key:"maxCell",value:function(){var t=Object.keys(this._),e=t[t.length-1],n=this._[e];if(n){var r=n.cells,i=Object.keys(r),o=i[i.length-1];return[parseInt(e,10),parseInt(o,10)]}return[0,0]}},{key:"each",value:function(t){Object.entries(this._).forEach((function(e){var n=V(e,2),r=n[0],i=n[1];t(r,i)}))}},{key:"eachCells",value:function(t,e){this._[t]&&this._[t].cells&&Object.entries(this._[t].cells).forEach((function(t){var n=V(t,2),r=n[0],i=n[1];e(r,i)}))}},{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:"getData",value:function(){var t=this.len,e=this.height;return Object.assign({len:t,height:e},this._)}}])&&q(e.prototype,n),r&&q(e,r),t}();function X(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}var Y=function(){function t(e){var n=e.len,r=e.width,i=e.indexWidth,o=e.minWidth;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this._={},this.len=n,this.width=r,this.indexWidth=i,this.minWidth=o}var e,n,r;return e=t,(n=[{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:"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 n=this.getOrNew(t);!0===e?n.hide=!0:delete n.hide}},{key:"setStyle",value:function(t,e){this.getOrNew(t).style=e}},{key:"sumWidth",value:function(t,e){var n=this;return L.rangeSum(t,e,(function(t){return n.getWidth(t)}))}},{key:"totalWidth",value:function(){return this.sumWidth(0,this.len)}}])&&X(e.prototype,n),r&&X(e,r),t}();function Z(t,e){var n;if("undefined"==typeof Symbol||null==t[Symbol.iterator]){if(Array.isArray(t)||(n=function(t,e){if(!t)return;if("string"==typeof t)return G(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return G(t,e)}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,i=function(){};return{s:i,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,l=!1;return{s:function(){n=t[Symbol.iterator]()},n:function(){var t=n.next();return a=t.done,t},e:function(t){l=!0,o=t},f:function(){try{a||null==n.return||n.return()}finally{if(l)throw o}}}}function G(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}var J=["en"],K={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",pagination:"Pagination",search:"Search"},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",cellprintable:"Enable export",cellnonprintable:"Disable export",celleditable:"Enable editing",cellnoneditable:"Disable editing"},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:"Sum",average:"Average",max:"Max",min:"Min",_if:"IF",and:"AND",or:"OR",concat:"Concat"},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 {}"},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:{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:"Criteria",order:{asc:"ASC",desc:"DESC"}},dataSearch:{label:"Keywords"}}};function Q(t,e){if(e){var n,r=Z(J);try{for(r.s();!(n=r.n()).done;){var i=n.value;if(!e[i])break;for(var o=e[i],a=t.match(/(?:\\.|[^.])+/g),l=0;l<a.length;l+=1){var c=o[a[l]];if(!c)break;if(l===a.length-1)return c;o=c}}}catch(t){r.e(t)}finally{r.f()}}}function tt(t){var e=Q(t,K);return!e&&window&&window.x_spreadsheet&&window.x_spreadsheet.$messages&&(e=Q(t,window.x_spreadsheet.$messages)),e||""}function et(t){return function(){return tt(t)}}function nt(t,e){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];n?J=[t]:J.unshift(t),e&&(K[t]=e)}function rt(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(t)))return;var n=[],r=!0,i=!1,o=void 0;try{for(var a,l=t[Symbol.iterator]();!(r=(a=l.next()).done)&&(n.push(a.value),!e||n.length!==e);r=!0);}catch(t){i=!0,o=t}finally{try{r||null==l.return||l.return()}finally{if(i)throw o}}return n}(t,e)||function(t,e){if(!t)return;if("string"==typeof t)return it(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return it(t,e)}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function it(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function ot(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}var at={phone:/^[1-9]\d{10}$/,email:/^(\w)+(\.\w+)*@(\w)+((\.\w+)+)$/};function lt(t,e){var n="";if(!t){for(var r=arguments.length,i=new Array(r>2?r-2:0),o=2;o<r;o++)i[o-2]=arguments[o];n=tt.apply(void 0,["validation.".concat(e)].concat(i))}return[t,n]}var ct=function(){function t(e,n,r,i){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.required=n,this.value=r,this.type=e,this.operator=i,this.message=""}var e,n,r;return e=t,(n=[{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)?L.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,n=this.operator,r=this.value,i=this.type;if(e&&/^\s*$/.test(t))return lt(!1,"required");if(/^\s*$/.test(t))return[!0];if(at[i]&&!at[i].test(t))return lt(!1,"notMatch");if("list"===i)return lt(this.values().includes(t),"notIn");if(n){var o=this.parseValue(t);if("be"===n){var a=rt(r,2),l=a[0],c=a[1];return lt(o>=this.parseValue(l)&&o<=this.parseValue(c),"between",l,c)}if("nbe"===n){var u=rt(r,2),s=u[0],f=u[1];return lt(o<this.parseValue(s)||o>this.parseValue(f),"notBetween",s,f)}if("eq"===n)return lt(o===this.parseValue(r),"equal",r);if("neq"===n)return lt(o!==this.parseValue(r),"notEqual",r);if("lt"===n)return lt(o<this.parseValue(r),"lessThan",r);if("lte"===n)return lt(o<=this.parseValue(r),"lessThanEqual",r);if("gt"===n)return lt(o>this.parseValue(r),"greaterThan",r);if("gte"===n)return lt(o>=this.parseValue(r),"greaterThanEqual",r)}return[!0]}}])&&ot(e.prototype,n),r&&ot(e,r),t}();function ut(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(t)))return;var n=[],r=!0,i=!1,o=void 0;try{for(var a,l=t[Symbol.iterator]();!(r=(a=l.next()).done)&&(n.push(a.value),!e||n.length!==e);r=!0);}catch(t){i=!0,o=t}finally{try{r||null==l.return||l.return()}finally{if(i)throw o}}return n}(t,e)||function(t,e){if(!t)return;if("string"==typeof t)return st(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return st(t,e)}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function st(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function ft(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function ht(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function dt(t,e,n){return e&&ht(t.prototype,e),n&&ht(t,n),t}var pt=function(){function t(e,n,r){ft(this,t),this.refs=n,this.mode=e,this.validator=r}return dt(t,[{key:"includes",value:function(t,e){for(var n=this.refs,r=0;r<n.length;r+=1){if(k.valueOf(n[r]).includes(t,e))return!0}return!1}},{key:"addRef",value:function(t){this.remove(k.valueOf(t)),this.refs.push(t)}},{key:"remove",value:function(t){var e=[];this.refs.forEach((function(n){var r=k.valueOf(n);r.intersects(t)?r.difference(t).forEach((function(t){return e.push(t.toString())})):e.push(n)})),this.refs=e}},{key:"getData",value:function(){var t=this.refs,e=this.mode,n=this.validator;return{refs:t,mode:e,type:n.type,required:n.required,operator:n.operator,value:n.value}}}],[{key:"valueOf",value:function(e){var n=e.refs,r=e.mode,i=e.type,o=e.required,a=e.operator,l=e.value;return new t(r,n,new ct(i,o,l,a))}}]),t}(),yt=function(){function t(){ft(this,t),this._=[],this.errors=new Map}return dt(t,[{key:"getError",value:function(t,e){return this.errors.get("".concat(t,"_").concat(e))}},{key:"validate",value:function(t,e,n){var r=this.get(t,e),i="".concat(t,"_").concat(e),o=this.errors;if(null!==r){var a=ut(r.validator.validate(n),2),l=a[0],c=a[1];l?o.delete(i):o.set(i,c)}else o.delete(i);return!0}},{key:"add",value:function(t,e,n){var r=n.type,i=n.required,o=n.value,a=n.operator,l=new ct(r,i,o,a),c=this.getByValidator(l);null!==c?c.addRef(e):this._.push(new pt(t,[e],l))}},{key:"getByValidator",value:function(t){for(var e=0;e<this._.length;e+=1){var n=this._[e];if(n.validator.equals(t))return n}return null}},{key:"get",value:function(t,e){for(var n=0;n<this._.length;n+=1){var r=this._[n];if(r.includes(t,e))return r}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 pt.valueOf(t)}))}}]),t}();var vt=function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.keywords="",this.current=1,this.result=[]},bt="x-spreadsheet";window.devicePixelRatio;function mt(t){return(mt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function gt(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function wt(t,e){return(wt=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function kt(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 Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=Ot(t);if(e){var i=Ot(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return St(this,n)}}function St(t,e){return!e||"object"!==mt(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function Ot(t){return(Ot=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var xt=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&wt(t,e)}(o,t);var e,n,r,i=kt(o);function o(t){var e;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,o),(e=i.call(this,"div","".concat(bt,"-icon"))).iconNameEl=c("div","".concat(bt,"-icon-img ").concat(t)),e.child(e.iconNameEl),e}return e=o,(n=[{key:"setName",value:function(t){this.iconNameEl.className("".concat(bt,"-icon-img ").concat(t))}}])&&gt(e.prototype,n),r&&gt(e,r),o}(l);function Ct(t,e,n){var r=c("div","".concat(bt,"-toast")),i=c("div","".concat(bt,"-dimmer active"));r.children(c("div","".concat(bt,"-toast-header")).children(new xt("close").on("click.stop",(function(){return document.body.removeChild(r.el),document.body.removeChild(i.el),void(n&&n())})),t),c("div","".concat(bt,"-toast-content")).html(e)),document.body.appendChild(r.el),document.body.appendChild(i.el);var o=r.box(),a=o.width,l=o.height,u=document.documentElement,s=u.clientHeight,f=u.clientWidth;r.offset({left:(f-a)/2,top:(s-l)/3})}function Et(t){return function(t){if(Array.isArray(t))return At(t)}(t)||function(t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(t))return Array.from(t)}(t)||_t(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function jt(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function Rt(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(t)))return;var n=[],r=!0,i=!1,o=void 0;try{for(var a,l=t[Symbol.iterator]();!(r=(a=l.next()).done)&&(n.push(a.value),!e||n.length!==e);r=!0);}catch(t){i=!0,o=t}finally{try{r||null==l.return||l.return()}finally{if(i)throw o}}return n}(t,e)||_t(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function _t(t,e){if(t){if("string"==typeof t)return At(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?At(t,e):void 0}}function At(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}var Tt={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,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 Pt(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:function(){},r=this.merges,i=e.clone(),o=t.size(),a=Rt(o,2),l=a[0],c=a[1],u=e.size(),s=Rt(u,2),f=s[0],h=s[1];return l>f&&(i.eri=e.sri+l-1),c>h&&(i.eci=e.sci+c-1),this.getRangeLocked(i)?(n("Protected worksheet,the target area contains locked cells"),!1):r.intersects(i)?(n(tt("error.pasteForMergedCell")),!1):t.equals(i)?(n("The selection area is same "),!1):!t.intersects(i)||!(f>l&&Math.abs(e.sri-t.sri)%l!=0||h>c&&Math.abs(e.sci-t.sci)%c!=0)||(n("Invalid selection area"),!1)}function Dt(t,e,n){var r=arguments.length>3&&void 0!==arguments[3]&&arguments[3],i=this.rows,o=this.merges,a=this.name,l=i.copyPaste(t,e,n,r,(function(t,e,n){if(n&&n.merge){var r=Rt(n.merge,2),i=r[0],a=r[1];if(i<=0&&a<=0)return;o.add(new k(t,e,t+i,e+a))}}));r?this.updateBatchCellsOpr(a,l):this.copyPasteRangeOpr(a,t,e,n)}function It(t,e){var n=this.clipboard,r=this.rows,i=this.merges,o=this.name;r.cutPaste(t,e),i.move(t,e.sri-t.sri,e.sci-t.sci),n.clear(),this.cutPasteRangeOpr(o,t,e)}function zt(t,e,n){var r=this.styles,i=this.rows.getCellOrNew(t,e),o={};void 0!==i.style&&(o=L.cloneDeep(r[i.style])),o=L.merge(o,{border:n}),i.style=this.addStyle(o)}function Mt(t){var e=this,n=t.mode,r=t.style,i=t.color,o=this.styles,a=this.selector,l=this.rows,c=a.range,u=c.sri,s=c.sci,f=c.eri,h=c.eci,d=!this.isSignleSelected();if(d||"inside"!==n&&"horizontal"!==n&&"vertical"!==n)if("outside"!==n||d){if("none"===n)a.range.each((function(t,n){var r=l.getCell(t,n);if(r&&void 0!==r.style){var i=L.cloneDeep(o[r.style]);delete i.border,r.style=e.addStyle(i)}}));else if("all"===n||"inside"===n||"outside"===n||"horizontal"===n||"vertical"===n)!function(){for(var t=[],o=u;o<=f;o+=1)for(var a=s;a<=h;a+=1){for(var c=[],p=0;p<t.length;p+=1){var y=Rt(t[p],4),v=y[0],b=y[1],m=y[2],g=y[3];if(o===v+m+1&&c.push(p),v<=o&&o<=v+m&&a===b){a+=g+1;break}}if(c.forEach((function(e){return t.splice(e,1)})),a>h)break;var w=l.getCell(o,a),k=0,S=0;if(w&&w.merge){var O=Rt(w.merge,2);k=O[0],S=O[1],t.push([o,a,k,S])}var x=k>0&&o+k===f,C=S>0&&a+S===h,E={};"all"===n?E={bottom:[r,i],top:[r,i],left:[r,i],right:[r,i]}:"inside"===n?(!C&&a<h&&(E.right=[r,i]),!x&&o<f&&(E.bottom=[r,i])):"horizontal"===n?!x&&o<f&&(E.bottom=[r,i]):"vertical"===n?!C&&a<h&&(E.right=[r,i]):"outside"===n&&d&&(u===o&&(E.top=[r,i]),(x||f===o)&&(E.bottom=[r,i]),s===a&&(E.left=[r,i]),(C||h===a)&&(E.right=[r,i])),Object.keys(E).length>0&&zt.call(e,o,a,E),a+=S}}();else if("top"===n||"bottom"===n)for(var p=s;p<=h;p+=1)"top"===n&&(zt.call(this,u,p,{top:[r,i]}),p+=l.getCellMerge(u,p)[1]),"bottom"===n&&(zt.call(this,f,p,{bottom:[r,i]}),p+=l.getCellMerge(f,p)[1]);else if("left"===n||"right"===n)for(var y=u;y<=f;y+=1)"left"===n&&(zt.call(this,y,s,{left:[r,i]}),y+=l.getCellMerge(y,s)[0]),"right"===n&&(zt.call(this,y,h,{right:[r,i]}),y+=l.getCellMerge(y,h)[0])}else zt.call(this,u,s,{top:[r,i],bottom:[r,i],left:[r,i],right:[r,i]})}function Nt(t,e){var n=this.rows,r=this.scroll,i=this.freezeTotalHeight(),o=this.settings.row.height,a=this.exceptRowSet;0===r.riact&&this.freeze[0]>0&&(r.riact=this.freeze[0]);var l=o+i,c=t>l?r.riact:0;0===c&&(l=o);for(var u=0;c<n.len&&!(l>t);c+=1)a.has(c)||(l+=u=n.getHeight(c));return{ri:c-1,top:l-=u,height:u}}function Ht(t,e){var n=this.cols,r=this.freezeTotalWidth(),i=n.indexWidth;r+n.indexWidth<t&&(i-=e);var o=Rt(L.rangeReduceIf(0,n.len,i,n.indexWidth,t,(function(t){return n.getWidth(t)})),3),a=o[0],l=o[1],c=o[2];return l<=0?{ci:-1,left:0,width:n.indexWidth}:{ci:a-1,left:l,width:c}}var Ft=function(){function t(e,n){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.settings=L.merge(Tt,n||{}),this.name=e||"sheet",this.freeze=[0,0],this.styles=[],this.merges=new N,this.rows=new B(this.settings.row),this.cols=new Y(this.settings.col),this.validations=new yt,this.hyperlinks={},this.comments=[],this.viewRangeCache={},this.selector=new O,this.scroll=new x,this.history=new E,this.clipboard=new R,this.autoFilter=new I,this.TableAutoFilters=[],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.exceptRowSet=new Set,this.sortedRowMap=new Map,this.unsortedRowMap=new Map,this.isupdating=!1,this.search=new vt,this.showGrid=!0}var e,n,r;return e=t,(n=[{key:"addValidation",value:function(t,e,n){var r=this;this.changeData((function(){r.validations.add(t,e,n)}))}},{key:"removeValidation",value:function(){var t=this,e=this.selector.range;this.changeData((function(){t.validations.remove(e)}))}},{key:"getSelectedValidator",value:function(){var t=this.selector,e=t.ri,n=t.ci,r=this.validations.get(e,n);return r?r.validator:null}},{key:"getSelectedValidation",value:function(){var t=this.selector,e=t.ri,n=t.ci,r=t.range,i=this.validations.get(e,n),o={ref:r.toString()};return null!==i&&(o.mode=i.mode,o.validator=i.validator),o}},{key:"getSelectedSort",value:function(){var t=this.selector,e=t.ci,n=t.range,r={ref:n.toString(),ci:e};r.sort=this.autoFilter.getSort(e);for(var i=[],o=n.sri,a=n.eri,l=o+1;l<=a;l+=1){var c=this.getCell(l,e);null===c||/^\s*$/.test(c.text)||i.push(c.text)}return r.m=i,r}},{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(this.getData(),(function(e){t.setData(e)}))}},{key:"redo",value:function(){var t=this;this.history.redo(this.getData(),(function(e){t.setData(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",n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(){},r=this.clipboard,i=this.selector;return!r.isClear()&&!!Pt.call(this,r.range,i.range,n)&&(this.changeData((function(){var n=i.range.extendRange(r.range);i.range.setToOther(n),r.isCopy()?Dt.call(t,r.range,n,e):r.isCut()&&It.call(t,r.range,n)})),!0)}},{key:"pasteFromText",value:function(t){var e=this,n=this.name,r=t.split("\r\n").map((function(t){return t.replace(/"/g,"").split("\t")}));if(r.length>0&&""==r[r.length-1]&&(r.length-=1),r.length>=1){var i=this.rows,o=this.selector;this.changeData((function(){var t=i.paste(r,o.range);e.updateBatchCellsOpr(n,t)}))}}},{key:"autofill",value:function(t,e){var n=this,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:function(){},i=this.selector.range;return!!Pt.call(this,i,t,r)&&(this.changeData((function(){Dt.call(n,i,t,e,!0)})),!0)}},{key:"clearClipboard",value:function(){this.clipboard.clear()}},{key:"calSelectedRangeByEnd",value:function(t,e){var n=this.selector,r=this.rows,i=this.cols,o=this.merges,a=n.range,l=a.sri,c=a.sci,u=a.eri,s=a.eci,f=n.ri,h=n.ci,d=t,p=e;return t<0&&(d=r.len-1),e<0&&(p=i.len-1),d>f?(l=f,u=d):(l=d,u=f),p>h?(c=h,s=p):(c=p,s=h),n.range=o.union(new k(l,c,u,s)),n.range=o.union(n.range),n.range}},{key:"calSelectedRangeByStart",value:function(t,e){var n=this.selector,r=this.rows,i=this.cols,o=this.merges.getFirstIncludes(t,e);return null===o&&(o=new k(t,e,t,e),-1===t&&(o.sri=0,o.eri=r.len-1),-1===e&&(o.sci=0,o.eci=i.len-1)),n.range=o,o}},{key:"setSelectedCellAttr",value:function(t,e){var n=this;this.changeData((function(){var r=n.selector,i=n.styles,o=n.rows,a=n.name;if("merge"===t)e?n.merge():n.unmerge();else if("border"===t)Mt.call(n,e);else if("formula"===t){var l=r.ri,c=r.ci,u=r.range;if(r.multiple()){var s=Rt(r.size(),2),f=s[0],h=s[1],d=u.sri,p=u.sci,v=u.eri,b=u.eci;if(f>1)for(var m=p;m<=b;m+=1)o.getCellOrNew(v+1,m).text="=".concat(e,"(").concat(y(m,d),":").concat(y(m,v),")");else h>1&&(o.getCellOrNew(l,b+1).text="=".concat(e,"(").concat(y(p,l),":").concat(y(b,l),")"))}else o.getCellOrNew(l,c).text="=".concat(e,"()")}else r.range.each((function(r,l){var c=o.getCellOrNew(r,l),u={};if(void 0!==c.style&&(u=L.cloneDeep(i[c.style])),"format"===t)u.format=e,"normal"===e?(delete u.number,delete u.custom):"text"===e?(u.number=49,delete u.custom):"number"===e?(u.custom="#,##0.00_",delete u.number):"percent"===e?(u.number=10,delete u.custom):"rmb"===e?(u.custom="[$¥-804]#,##0.00",delete u.number):"usd"===e?(u.custom="$#,##0.00",delete u.number):"eur"===e?(u.custom="[$€-408]#,##0.00",delete u.number):"date"===e?(u.custom="mm/dd/yyyy",delete u.number):"time"===e?(u.number=21,delete u.custom):"datetime"===e?(u.custom="mm/dd/yyyy hh:mm:ss",delete u.number):"duration"===e&&(u.custom="[h]:mm:ss",delete u.number),c.style=n.addStyle(u),n.updateCellStyleOpr(a,r,l,u);else if("font-bold"===t||"font-italic"===t||"font-name"===t||"font-size"===t){var s={};s[t.split("-")[1]]=e,u.font=Object.assign(u.font||{},s),c.style=n.addStyle(u)}else"strike"===t||"textwrap"===t||"underline"===t||"align"===t||"valign"===t||"color"===t||"bgcolor"===t||"pbgcolor"===t||"pattern"===t?(u[t]=e,c.style=n.addStyle(u),"align"===t&&delete c.isautoalign):c[t]=e}))}))}},{key:"setSelectedCellText",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"input",n=this.autoFilter,r=this.selector,i=this.rows,o=r.ri,a=r.ci,l=o;this.unsortedRowMap.has(o)&&(l=this.unsortedRowMap.get(o));var c=i.getCell(l,a),u=c?c.text:"";if(this.setCellText(l,a,t,e),n.active()){var s=n.getFilter(a);if(s){var f=s.value.findIndex((function(t){return t===u}));f>=0&&s.value.splice(f,1,t)}}}},{key:"getSelectedCell",value:function(){var t=this.selector,e=t.ri,n=t.ci,r=e;return this.unsortedRowMap.has(e)&&(r=this.unsortedRowMap.get(e)),this.rows.getCell(r,n)}},{key:"canSelected",value:function(t,e){if(!this.protected)return!0;var n=t;this.unsortedRowMap.has(t)&&(n=this.unsortedRowMap.get(t));var r=this.getCellStyle(n,e);return null==r?this.canselectlocked:!(!r.unlocked||!this.canselectunlocked)||!(r.unlocked||!this.canselectlocked)}},{key:"getLocked",value:function(){var t=this.selector,e=t.ri,n=t.ci;return this.getCellLocked(e,n)}},{key:"getCellLocked",value:function(t,e){if(!this.protected)return!1;var n=t;this.unsortedRowMap.has(t)&&(n=this.unsortedRowMap.get(t));var r=this.getCellStyle(n,e);return!(null!=r&&r.unlocked)}},{key:"getRangeLocked",value:function(t){for(var e=t.sri;e<=t.eri;e+=1)for(var n=t.sci;n<=t.eci;n+=1)if(this.getCellLocked(e,n))return!0;return!1}},{key:"xyInSelectedRect",value:function(t,e){var n=this.getSelectedRect(),r=n.left,i=n.top,o=n.width,a=n.height,l=this.settings.row.height,c=t-this.cols.indexWidth,u=e-l;return c>r&&c<r+o&&u>i&&u<i+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:-100,top:-100};t.sri>=this.freeze[0]&&t.sri<this.scroll.riact&&(t.sri=this.scroll.riact)}else{if(t.eri<this.scroll.riact)return{left:-100,top:-100};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,n=this.rows,r=this.cols,i=this.exceptRowSet,o=t.sri,a=t.sci,l=t.eri,c=t.eci;if(o<0&&a<0)return{left:0,l:0,top:0,t:0,scroll:e};var u=r.sumWidth(0,a),s=n.sumHeight(0,o,i),f=n.sumHeight(o,l+1,i),h=r.sumWidth(a,c+1),d=u-e.x,p=this.freezeTotalHeight(),y=this.freezeTotalWidth(),v=n.sumHeight(e.riact,o,i)+p;return y>0&&y>u&&(d=u),p>0&&p>s&&(v=s),{l:u,t:s,left:d,top:v,height:f,width:h,scroll:e}}},{key:"getCellRectByXY",value:function(t,e){var n=this.scroll,r=this.merges,i=this.rows,o=this.cols,a=Nt.call(this,e,n.y),l=a.ri,c=a.top,u=a.height,s=Ht.call(this,t,n.x),f=s.ci,h=s.left,d=s.width;if(-1===f&&(d=o.totalWidth()),-1===l&&(u=i.totalHeight()),l>=0||f>=0){var p=r.getFirstIncludes(l,f);if(p){l=p.sri,f=p.sci;var y=this.cellRect(l,f);h=y.left,c=y.top,d=y.width,u=y.height}}return{ri:l,ci:f,left:h,top:c,width:d,height:u}}},{key:"isSignleSelected",value:function(){var t=this.selector.range,e=t.sri,n=t.sci,r=t.eri,i=t.eci,o=this.getCell(e,n);if(o&&o.merge){var a=Rt(o.merge,2),l=a[0],c=a[1];if(e+l===r&&n+c===i)return!0}return!this.selector.multiple()}},{key:"canUnmerge",value:function(){var t=this.selector.range,e=t.sri,n=t.sci,r=t.eri,i=t.eci,o=this.getCell(e,n);if(o&&o.merge){var a=Rt(o.merge,2),l=a[0],c=a[1];if(e+l===r&&n+c===i)return!0}return!1}},{key:"merge",value:function(){var t=this,e=this.selector,n=this.rows;if(!this.isSignleSelected()){var r=Rt(e.size(),2),i=r[0],o=r[1];if(i>1||o>1){var a=e.range,l=a.sri,c=a.sci;this.changeData((function(){var r=n.getCellOrNew(l,c);r.merge=[i-1,o-1],t.merges.add(e.range),t.rows.deleteCells(e.range),t.rows.setCell(l,c,r)}))}}}},{key:"unmerge",value:function(){var t=this,e=this.selector;if(this.isSignleSelected()){var n=e.range,r=n.sri,i=n.sci;this.changeData((function(){t.rows.deleteCell(r,i,"merge"),t.merges.deleteWithin(e.range)}))}}},{key:"canAutofilter",value:function(){return!this.autoFilter.active()}},{key:"autofilter",value:function(){var t=this,e=this.autoFilter,n=this.selector,r=this.TableAutoFilters;if(!e.active())for(var i=0,o=r.length;i<o;i++){var a=r[i],l=k.valueOf(a.ref);if(!(l.eci<n.range.sci||n.range.eci<l.sci))return void Ct("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=n.range.toString()}))}},{key:"autoSort",value:function(){var t=this.autoFilter,e=this.selector;this.changeData((function(){t.filters=[],t.ref=e.range.toString()}))}},{key:"setAutoFilter",value:function(t,e,n,r){var i=this.currentAutoFilter;i.addFilter(t,n,r),i.setSort(t,e),this.resetAutoFilter()}},{key:"resetAutoFilter",value:function(){var t=this,e=this.currentAutoFilter,n=this.rows,r=e;if(r.active()){var i=r.sort,o=r.filteredRows((function(t,e){return n.getCell(t,e)})),a=o.rset,l=o.fset,c=Array.from(l),u=Array.from(l);i&&c.sort((function(t,e){if("desc"===i.order){var r=t;t=e,e=r}var o=n.getCell(t,i.ci),a=n.getCell(e,i.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"===i.order?1:-1;if(null==a)return"asc"===i.order?-1:1;o=o.text,a=a.text;var l=isNaN(Number(o)),c=isNaN(Number(a));return l&&c?o.localeCompare(a):l&&!c?1:!l&&c?-1:Number(o)-Number(a)})),this.exceptRowSet=a,this.sortedRowMap=new Map,this.unsortedRowMap=new Map,c.forEach((function(e,n){t.sortedRowMap.set(u[n],e),t.unsortedRowMap.set(e,u[n])}))}}},{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:"createConditionImage",value:function(t,e){var n=new Image;n.src="data:image/png;base64,"+t.data;var r=this.cols.sumWidth(0,t.col),i=this.rows.sumHeight(0,t.row);if(0===t.type){n.style.zIndex=e+1;var o=this.getCellStyle(t.row,t.col);null!=o&&"bottom"===o.valign&&(i+=this.rows.getHeight(t.row)-16)}else n.style.zIndex=e;return(this.rows.isHide(t.row)||this.cols.isHide(t.col)||this.exceptRowSet.has(t.row))&&(n.style.display="none"),n.style.left=r+"px",n.style.top=i+"px",n.style.position="absolute",n}},{key:"updateConditionImageVisible",value:function(){var t=this.exceptRowSet,e=this.rows,n=this.cols;this.conditionimg&&this.conditionimg.forEach((function(r){e.isHide(r.row)||n.isHide(r.col)||t.has(r.row)?r.image.style.display="none":r.image.style.display="block"}))}},{key:"deleteCell",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"all",n=this.selector,r=this.name;this.changeData((function(){t.rows.deleteCells(n.range,e),"all"!==e&&"format"!==e||t.merges.deleteWithin(n.range),t.delCellOpr(r,n.range,e)}))}},{key:"insert",value:function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;this.changeData((function(){var r=e.selector.range,i=r.sri,o=r.sci,a=e.rows,l=e.merges,c=e.cols,u=e.name,s=i;"row"===t?(a.insert(i,n),e.insertRowOpr(u,i,n)):"column"===t&&(a.insertColumn(o,n),s=o,c.len+=1,e.insertColumnOpr(u,o,n)),l.shift(t,s,n,(function(t,e,n,r){var i=a.getCell(t,e);i.merge[0]+=n,i.merge[1]+=r}))}))}},{key:"delete",value:function(t){var e=this;this.changeData((function(){var n=e.rows,r=e.merges,i=e.selector,o=e.cols,a=e.name,l=i.range,c=i.range,u=c.sri,s=c.sci,f=c.eri,h=c.eci,d=Rt(i.range.size(),2),p=d[0],y=d[1],v=u,b=p;"row"===t?confirm("sure to delete rows from   "+(u+1)+" to "+(f+1))&&(n.delete(u,f),e.deleteRowOpr(a,u,f)):"column"===t&&confirm("sure to delete columns from   "+(s+1)+" to "+(h+1))&&(n.deleteColumn(s,h),v=l.sci,b=y,o.len-=1,e.deleteColumnOpr(a,s,h)),r.shift(t,v,-b,(function(t,e,r,i){var o=n.getCell(t,e);o.merge[0]+=r,o.merge[1]+=i,0===o.merge[0]&&0===o.merge[1]&&delete o.merge}))}))}},{key:"scrollx",value:function(t,e){var n=this.scroll,r=this.freeze,i=this.cols,o=Rt(r,2)[1],a=Rt(L.rangeReduceIf(o,i.len,0,0,t,(function(t){return i.getWidth(t)})),3),l=a[0],c=a[1],u=a[2],s=c;t>0&&(s+=u),n.x!==s&&(n.ci=t>0?l:0,n.x=s,e())}},{key:"scrolly",value:function(t,e){var n=this.scroll,r=this.freeze,i=this.rows,o=this.exceptRowSet,a=Rt(r,1)[0],l=Rt(L.rangeReduceIf(a,i.len,0,0,t,(function(t){return i.getHeight(t,o)})),3),c=l[0],u=l[1],s=l[2],f=u;if(t>0&&(f+=s),n.y!==f){for(n.ri=t>0?c:0,n.y=f,0===n.ri&&this.freeze[0]>0&&(n.ri=this.freeze[0],n.y=0),n.yact=n.y,n.riact=n.ri;this.isInvisibleRow(n.riact);)n.yact+=i.getHeight(n.riact,o),n.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 n=this.rows,r=this.cols,i=this.exceptRowSet,o=r.sumWidth(0,e),a=n.sumHeight(0,t,i),l=n.getCell(t,e),c=r.getWidth(e),u=n.getHeight(t);if(null!==l&&l.merge){var s=Rt(l.merge,2),f=s[0],h=s[1];if(f>0)for(var d=1;d<=f;d+=1)u+=n.getHeight(t+d);if(h>0)for(var p=1;p<=h;p+=1)c+=r.getWidth(e+p)}return{left:o,top:a,width:c,height:u,cell:l}}},{key:"getCell",value:function(t,e){return this.rows.getCell(t,e)}},{key:"getCellTextOrDefault",value:function(t,e){var n=this.getCell(t,e);return n&&n.text?n.text:""}},{key:"getCellStyle",value:function(t,e){var n=this.getCell(t,e);return n&&void 0!==n.style?this.styles[n.style]:null}},{key:"getCellStyleOrDefault",value:function(t,e){var n=this.styles,r=this.rows,i=r.getCell(t,e),o=i&&void 0!==i.style?n[i.style]:{},a=L.merge(this.defaultStyle(),o);if(void 0!==o.bgcolor&&(a.hasbgcolor=!0),i&&void 0!==i.merge){if(0!=i.merge[1]){var l=r.getCell(t,e+i.merge[1]),c=l&&void 0!==l.style?n[l.style]:{};c.border&&void 0!==c.border.right&&(void 0===o.border&&(o.border={}),o.border.right=c.border.right)}if(0!=i.merge[0]){var u=r.getCell(t+i.merge[0],e),s=u&&void 0!==u.style?n[u.style]:{};s.border&&void 0!==s.border.bottom&&(void 0===o.border&&(o.border={}),o.border.bottom=s.border.bottom)}}return a}},{key:"getSelectedCellStyle",value:function(){var t=this.selector,e=t.ri,n=t.ci;return this.getCellStyleOrDefault(e,n)}},{key:"setCellText",value:function(t,e,n,r){var i=this.rows,o=this.history,a=this.validations,l=this.settings,c=this.name;"finished"===r?("server"!==l.updateMode&&(i.setCellText(t,e,""),o.add(this.getData()),i.setCellText(t,e,n)),"server"===l.updateMode&&this.updateCellTextOpr(c,t,e,n)):(i.setCellText(t,e,n),this.change(this.getData())),a.validate(t,e,n)}},{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,n){var r=this.styles,i=this.rows.getCellOrNew(t,e),o={};void 0!==i.style&&(o=L.cloneDeep(r[i.style])),(i.isautoalign||void 0===o.align)&&(o.align=n,i.style=this.addStyle(o),i.isautoalign=!0)}},{key:"cutPasteRangeOpr",value:function(t,e,n){var r={name:t,src:e,dest:n,op:"cutpaste"};this.updateCellServer(r)}},{key:"copyPasteRangeOpr",value:function(t,e,n,r){var i={name:t,src:e,dest:n,op:"copypaste",what:r};this.updateCellServer(i)}},{key:"updateBatchCellsOpr",value:function(t,e){var n={name:t,cells:e,op:"batchupdate"};this.updateCellServer(n)}},{key:"updateCellStyleOpr",value:function(t,e,n,r){var i={name:t,ri:e,ci:n,number:r.number,custom:r.custom,op:"updatestyle"};this.updateCellServer(i)}},{key:"updateCellTextOpr",value:function(t,e,n,r){var i={name:t,ri:e,ci:n,text:r,op:"update"};this.updateCellServer(i)}},{key:"delCellOpr",value:function(t,e,n){var r={name:t,range:e,what:n,op:"delcells"};this.updateCellServer(r)}},{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 n={oldname:t,name:e,op:"rename"};this.updateCellServer(n)}},{key:"insertRowOpr",value:function(t,e,n){var r={name:t,ri:e,n:n,op:"insertrow"};this.updateCellServer(r)}},{key:"insertColumnOpr",value:function(t,e,n){var r={name:t,ci:e,n:n,op:"insertcol"};this.updateCellServer(r)}},{key:"deleteRowOpr",value:function(t,e,n){var r={name:t,sri:e,eri:n,op:"delrow"};this.updateCellServer(r)}},{key:"deleteColumnOpr",value:function(t,e,n){var r={name:t,sci:e,eci:n,op:"delcol"};this.updateCellServer(r)}},{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,n=this.rows;t.forEach((function(t,r,i){n.updateOneCell(t),e.setAutoAlignForCell(t)}))}},{key:"updateShapes",value:function(t,e){var n=this.shapes;null!=n&&null!=t&&t.forEach((function(t,r,i){for(var o=0,a=n.length;o<a;o++)if(n[o].id===t.id){var l={};l.id="s_"+t.id+"_"+n[o].tick,l.name=t.id+"."+t.tick,l.it=n[o],e.push(l),$("#"+l.id).addClass("resize-image").removeAttr("src");break}}))}},{key:"updateShapeSrcToRefresh",value:function(t,e,n,r){if(r.length>0){var i=this;$.get(e+"?uid="+t+"&id="+n,(function(t){i.fillImageOnebyOne(t,r)}))}}},{key:"validateFormula",value:function(t){for(var e=0,n=0;n<t.length;n++)"("===t[n]?e++:")"===t[n]&&e--;return 0===e}},{key:"freezeIsActive",value:function(){var t=Rt(this.freeze,2),e=t[0],n=t[1];return e>0||n>0}},{key:"setFreeze",value:function(t,e){var n=this;this.changeData((function(){n.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 n=this;this.changeData((function(){n.rows.setHeight(t,e)}))}},{key:"setColWidth",value:function(t,e){var n=this;this.changeData((function(){n.cols.setWidth(t,e)}))}},{key:"viewHeight",value:function(){var t=this.settings,e=t.view,n=t.showToolbar,r=e.height();return r-=26,r-=41,n&&(r-=41),r}},{key:"viewWidth",value:function(){return this.settings.view.width()}},{key:"freezeViewRange",value:function(){var t=Rt(this.freeze,2),e=t[0],n=t[1];return new k(0,0,e-1,n-1,this.freezeTotalWidth(),this.freezeTotalHeight())}},{key:"contentRange",value:function(){var t=this.rows,e=this.cols,n=Rt(t.maxCell(),2),r=n[0],i=n[1],o=t.sumHeight(0,r+1),a=e.sumWidth(0,i+1);return new k(0,0,r,i,a,o)}},{key:"exceptRowTotalHeight",value:function(t,e){var n=this.exceptRowSet,r=this.rows,i=Array.from(n),o=0;return i.forEach((function(n){if(n<t||n>e){var i=r.getHeight(n);o+=i}})),o}},{key:"viewRange",value:function(){var t=this.scroll,e=this.rows,n=this.cols,r=this.freeze,i=this.exceptRowSet,o=t.ri,a=t.ci;o<=0&&(o=Rt(r,1)[0]),a<=0&&(a=Rt(r,2)[1]);for(var l=0,c=0,u=[e.len,n.len],s=u[0],f=u[1],h=o;h<e.len&&(i.has(h)||(c+=e.getHeight(h),s=h),!(c>this.viewHeight()));h+=1);for(var d=a;d<n.len&&(f=d,!((l+=n.getWidth(d))>this.viewWidth()));d+=1);var p=new k(o,a,s,f,l,c);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,n=this.selector,r=Rt(n.size(),2),i=r[0],o=r[1],a=n.range,l=a.sri,c=a.sci,u=a.eri,s=a.eci;if(i===t.len)for(var f=c;f<=s;f+=1)e.setHide(f,!0);else if(o===e.len)for(var h=l;h<=u;h+=1)t.setHide(h,!0)}},{key:"unhideRowsOrCols",value:function(t,e){this["".concat(t,"s")].unhide(e)}},{key:"rowEach",value:function(t,e,n){for(var r=0,i=this.rows,o=this.exceptRowSet,a=(Et(o),0),l=t+a;l<=e;l+=1)if(o.has(l))a+=1;else{var c=i.getHeight(l);if(c>0&&(n(l,r,c),(r+=c)>this.viewHeight()))break}}},{key:"colEach",value:function(t,e,n){for(var r=0,i=this.cols,o=t;o<=e;o+=1){var a=i.getWidth(o);if(a>0&&(n(o,r,a),(r+=a)>this.viewWidth()))break}}},{key:"defaultStyle",value:function(){return this.settings.style}},{key:"addStyle",value:function(t){for(var e=this.styles,n=0;n<e.length;n+=1){var r=e[n];if(L.equals(r,t))return n}return e.push(t),e.length-1}},{key:"changeData",value:function(t){this.history.add(this.getData()),t(),this.change(this.getData())}},{key:"setData",value:function(t){var e=this;return Object.keys(t).forEach((function(n){if("merges"===n||"rows"===n||"cols"===n||"validations"===n)e[n].setData(t[n]);else if("freeze"===n){var r=Rt(p(t[n]),2),i=r[0],o=r[1];e.freeze=[o,i]}else if("autofilter"===n)e.autoFilter.setData(t[n]);else if("lautofilters"===n){var a=t[n],l=e;a.forEach((function(t){var e=new I;e.setData(t),l.TableAutoFilters.push(e)}))}else void 0!==t[n]&&(e[n]=t[n])})),this}},{key:"getData",value:function(){var t=this.name,e=this.freeze,n=this.styles,r=this.merges,i=this.rows,o=this.cols,a=this.validations,l=this.autoFilter,c=this.TableAutoFilters,u={name:t,freeze:y(e[1],e[0]),styles:n,merges:r.getData(),rows:i.getData(),cols:o.getData(),validations:a.getData(),autofilter:l.getData(),TableAutoFilters:[]};return c.forEach((function(t){u.TableAutoFilters.push(t.getData())})),u}}])&&jt(e.prototype,n),r&&jt(e,r),t}();function Wt(t,e,n){t.addEventListener(e,n)}function Lt(t,e,n){t.removeEventListener(e,n)}function Vt(t){t.xclickoutside&&(Lt(window.document.body,"click",t.xclickoutside),delete t.xclickoutside)}function Ut(t,e){t.xclickoutside=function(n){2===n.detail||t.contains(n.target)||(e?e(t):(t.hide(),Vt(t)))},Wt(window.document.body,"click",t.xclickoutside)}function qt(t,e,n){Wt(t,"mousemove",e),t.xEvtUp=function(r){Lt(t,"mousemove",e),Lt(t,"mouseup",t.xEvtUp),n(r)},Wt(t,"mouseup",t.xEvtUp)}function $t(t,e,n,r){Math.abs(t)>Math.abs(e)?r(t>0?"right":"left",t,n):r(e>0?"down":"up",e,n)}function Bt(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Xt(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}var Yt=function(){function t(){var e=this,n=arguments.length>0&&void 0!==arguments[0]&&arguments[0],r=arguments.length>1?arguments[1]:void 0;Bt(this,t),this.moving=!1,this.vertical=n,this.el=c("div","".concat(bt,"-resizer ").concat(n?"vertical":"horizontal")).children(this.unhideHoverEl=c("div","".concat(bt,"-resizer-hover")).on("dblclick.stop",(function(t){return e.mousedblclickHandler(t)})).css("position","absolute").hide(),this.hoverEl=c("div","".concat(bt,"-resizer-hover")).on("mousedown.stop",(function(t){return e.mousedownHandler(t)})),this.lineEl=c("div","".concat(bt,"-resizer-line")).hide()).hide(),this.cRect=null,this.finishedFn=null,this.minDistance=r,this.unhideFn=function(){}}var e,n,r;return e=t,(n=[{key:"showUnhide",value:function(t){this.unhideIndex=t,this.unhideHoverEl.show()}},{key:"hideUnhide",value:function(){this.unhideHoverEl.hide()}},{key:"show",value:function(t,e){var n=this.moving,r=this.vertical,i=this.hoverEl,o=this.lineEl,a=this.el,l=this.unhideHoverEl;if(!n){this.cRect=t;var c=t.left,u=t.top,s=t.width,f=t.height;a.offset({left:r?c+s-5:c,top:r?u:u+f-5}).show(),i.offset({width:r?5:s,height:r?f:5}),o.offset({width:r?0:e.width,height:r?e.height:0}),l.offset({left:r?5-s:c,top:r?u:5-f,width:r?5:s,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,n=t,r=this.el,i=this.lineEl,o=this.cRect,a=this.vertical,l=this.minDistance,c=a?o.width:o.height;i.show(),qt(window,(function(t){e.moving=!0,null!==n&&1===t.buttons&&(a?(c+=t.movementX)>l&&r.css("left","".concat(o.left+c,"px")):(c+=t.movementY)>l&&r.css("top","".concat(o.top+c,"px")),n=t)}),(function(){n=null,i.hide(),e.moving=!1,e.hide(),e.finishedFn&&(c<l&&(c=l),e.finishedFn(o,c))}))}}])&&Xt(e.prototype,n),r&&Xt(e,r),t}();function Zt(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}var Gt=function(){function t(e){var n=this;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.vertical=e,this.moveFn=null,this.el=c("div","".concat(bt,"-scrollbar ").concat(e?"vertical":"horizontal")).child(this.contentEl=c("div","")).on("mousemove.stop",(function(){})).on("scroll.stop",(function(t){var e=t.target,r=e.scrollTop,i=e.scrollLeft;n.moveFn&&n.moveFn(n.vertical?r:i,t)}))}var e,n,r;return e=t,(n=[{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 n=t-1;if(e>n){var r=this.vertical?"height":"width";this.el.css(r,"".concat(n-15,"px")).show(),this.contentEl.css(this.vertical?"width":"height","1px").css(r,"".concat(e,"px"))}else this.el.hide();return this}}])&&Zt(e.prototype,n),r&&Zt(e,r),t}();function Jt(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Kt(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function Qt(t,e,n){return e&&Kt(t.prototype,e),n&&Kt(t,n),t}var te=10,ee=function(){function t(){var e=this,n=arguments.length>0&&void 0!==arguments[0]&&arguments[0];Jt(this,t),this.useHideInput=n,this.inputChange=function(){},this.cornerEl=c("div","".concat(bt,"-selector-corner")),this.areaEl=c("div","".concat(bt,"-selector-area")).child(this.cornerEl).hide(),this.clipboardEl=c("div","".concat(bt,"-selector-clipboard")).hide(),this.autofillEl=c("div","".concat(bt,"-selector-autofill")).hide(),this.el=c("div","".concat(bt,"-selector")).css("z-index","".concat(te)).children(this.areaEl,this.clipboardEl,this.autofillEl).hide(),n&&(this.hideInput=c("input","").on("compositionend",(function(t){e.inputChange(t.target.value)})),this.el.child(this.hideInputDiv=c("div","hide-input").child(this.hideInput)),this.el.child(this.hideInputDiv=c("div","hide-input").child(this.hideInput))),te+=1}return Qt(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,n=t.top,r={width:t.width+.8,height:t.height+.8,left:e-.8,top:n-.8};this.areaEl.offset(r).show(),this.useHideInput&&(this.hideInputDiv.offset(r),this.hideInput.val("").focus())}},{key:"setClipboardOffset",value:function(t){var e=t.left,n=t.top,r=t.width,i=t.height;this.clipboardEl.offset({left:e,top:n,width:r-2.4,height:i-2.4})}},{key:"showAutofill",value:function(t){var e=t.left,n=t.top,r=t.width,i=t.height;this.autofillEl.offset({width:r-3,height:i-3,left:e,top:n}).show()}},{key:"hideAutofill",value:function(){this.autofillEl.hide()}},{key:"showClipboard",value:function(){this.clipboardEl.show()}},{key:"hideClipboard",value:function(){this.clipboardEl.hide()}}]),t}();function ne(t){var e=this.data,n=t.left,r=t.top,i=t.width,o=t.height,a=t.scroll,l=t.l,c=t.t,u=e.freezeTotalWidth(),s=e.freezeTotalHeight(),f=n-u;u>l&&(f-=a.x);var h=r-s;return s>c&&(h-=a.y),{left:f,top:h,width:i,height:o}}function re(t){var e=this.data,n=t.left,r=t.width,i=t.height,o=t.l,a=t.t,l=t.scroll,c=e.freezeTotalWidth(),u=n-c;return c>o&&(u-=l.x),{left:u,top:a,width:r,height:i}}function ie(t){var e=this.data,n=t.top,r=t.width,i=t.height,o=t.l,a=t.t,l=t.scroll,c=e.freezeTotalHeight(),u=n-c;return c>a&&(u-=l.y),{left:o,top:u,width:r,height:i}}function oe(t){this.br.setAreaOffset(ne.call(this,t))}function ae(t){this.tl.setAreaOffset(t)}function le(t){this.t.setAreaOffset(re.call(this,t))}function ce(t){this.l.setAreaOffset(ie.call(this,t))}function ue(t){this.l.setClipboardOffset(ie.call(this,t))}function se(t){this.br.setClipboardOffset(ne.call(this,t))}function fe(t){this.tl.setClipboardOffset(t)}function he(t){this.t.setClipboardOffset(re.call(this,t))}function de(t){oe.call(this,t),ae.call(this,t),le.call(this,t),ce.call(this,t)}function pe(t){se.call(this,t),fe.call(this,t),he.call(this,t),ue.call(this,t)}var ye=function(){function t(e){var n=this;Jt(this,t),this.inputChange=function(){},this.data=e,this.br=new ee(!0),this.t=new ee,this.l=new ee,this.tl=new ee,this.br.inputChange=function(t){n.inputChange(t)},this.br.el.show(),this.offset=null,this.areaOffset=null,this.indexes=null,this.range=null,this.arange=null,this.el=c("div","".concat(bt,"-selectors")).children(this.tl.el,this.t.el,this.l.el,this.br.el).hide(),this.lastri=-1,this.lastci=-1,te+=1}return Qt(t,[{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,n=this.t,r=this.l,i=this.br,o=t.freezeTotalHeight(),a=t.freezeTotalWidth();o>0||a>0?(e.setOffset({width:a,height:o}),n.setOffset({left:a,height:o}),r.setOffset({top:o,width:a}),i.setOffset({left:a,top:o})):(e.hide(),n.hide(),r.hide(),i.setOffset({left:0,top:0}))}},{key:"resetAreaOffset",value:function(){var t=this.data.getSelectedRect(),e=this.data.getClipboardRect();de.call(this,t),pe.call(this,e),this.resetOffset()}},{key:"resetBRTAreaOffset",value:function(){var t=this.data.getSelectedRect(),e=this.data.getClipboardRect();oe.call(this,t),le.call(this,t),se.call(this,e),he.call(this,e),this.resetOffset()}},{key:"resetBRLAreaOffset",value:function(){var t=this.data.getSelectedRect(),e=this.data.getClipboardRect();oe.call(this,t),ce.call(this,t),se.call(this,e),ue.call(this,e),this.resetOffset()}},{key:"set",value:function(t,e){var n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],r=this.data,i=r.calSelectedRangeByStart(t,e),o=i.sri,a=i.sci;if(n){var l=t,c=e;t<0&&(l=0),e<0&&(c=0),r.selector.setIndexes(l,c),this.indexes=[l,c]}this.moveIndexes=[o,a],this.range=i,this.resetAreaOffset(),this.el.show()}},{key:"setEnd",value:function(t,e){var n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],r=this.data,i=this.lastri,o=this.lastci;if(n){if(t===i&&e===o)return;this.lastri=t,this.lastci=e}this.range=r.calSelectedRangeByEnd(t,e),de.call(this,this.data.getSelectedRect())}},{key:"reset",value:function(){var t=this.data.selector.range,e=t.eri,n=t.eci;this.setEnd(e,n)}},{key:"showAutofill",value:function(t,e){if(-1!==t||-1!==e){var n=this.range,r=n.sri,i=n.sci,o=n.eri,a=n.eci,l=t,c=e,u=r-t,s=o-t,f=a-e;if(i-e>0)this.arange=new k(r,c,o,i-1);else if(u>0)this.arange=new k(l,i,r-1,a);else if(f<0)this.arange=new k(r,a+1,o,c);else{if(!(s<0))return void(this.arange=null);this.arange=new k(o+1,i,l,a)}if(null!==this.arange){var h=this.data.getRect(this.arange);h.width+=2,h.height+=2;var d=this.br,p=this.l,y=this.t,v=this.tl;d.showAutofill(ne.call(this,h)),p.showAutofill(ie.call(this,h)),y.showAutofill(re.call(this,h)),v.showAutofill(h)}}}},{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();pe.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 ve(t){return function(t){if(Array.isArray(t))return be(t)}(t)||function(t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(t))return Array.from(t)}(t)||function(t,e){if(!t)return;if("string"==typeof t)return be(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return be(t,e)}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function be(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function me(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function ge(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function we(t){t.preventDefault(),t.stopPropagation();var e=this.filterItems;e.length<=0||(this.itemIndex>=0&&e[this.itemIndex].toggle(),this.itemIndex-=1,this.itemIndex<0&&(this.itemIndex=e.length-1),e[this.itemIndex].toggle())}function ke(t){t.stopPropagation();var e=this.filterItems;e.length<=0||(this.itemIndex>=0&&e[this.itemIndex].toggle(),this.itemIndex+=1,this.itemIndex>e.length-1&&(this.itemIndex=0),e[this.itemIndex].toggle())}function Se(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 Oe(t,e){e.focusing=!0;var n=t.keyCode;switch(t.ctrlKey&&t.stopPropagation(),n){case 37:t.stopPropagation();break;case 38:we.call(this,t);break;case 39:t.stopPropagation();break;case 40:ke.call(this,t);break;case 13:case 9:Se.call(this,t);break;default:t.stopPropagation()}}var xe=function(){function t(e,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"200px";me(this,t),this.filterItems=[],this.items=e,this.el=c("div","".concat(bt,"-suggest")).css("width",r).hide(),this.itemClick=n,this.itemIndex=-1}var e,n,r;return e=t,(n=[{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(),Vt(this.el.parent())}},{key:"setItems",value:function(t){this.items=t}},{key:"search",value:function(t){var e,n=this,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=c("div","".concat(bt,"-item")).child(e).on("click.stop",(function(){n.itemClick(t),n.hide()}));return t.label&&r.child(c("div","label").html(t.label)),r})),this.filterItems=r,!(r.length<=0)){var i=this.el;(e=i.html("")).children.apply(e,ve(r)).show(),Ut(i.parent(),(function(){n.hide()}))}}},{key:"bindInputEvents",value:function(t,e){var n=this;t.on("keydown",(function(t){return Oe.call(n,t,e)}))}}])&&ge(e.prototype,n),r&&ge(e,r),t}();function Ce(t){return function(t){if(Array.isArray(t))return Ee(t)}(t)||function(t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(t))return Array.from(t)}(t)||function(t,e){if(!t)return;if("string"==typeof t)return Ee(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Ee(t,e)}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Ee(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function je(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function Re(t,e){t.setMonth(t.getMonth()+e)}function _e(t,e){var n=new Date(t);return n.setDate(e-t.getDay()+1),n}var Ae=function(){function t(e){var n,r=this;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.value=e,this.cvalue=new Date(e),this.headerLeftEl=c("div","calendar-header-left"),this.bodyEl=c("tbody",""),this.buildAll(),this.el=c("div","x-spreadsheet-calendar").children(c("div","calendar-header").children(this.headerLeftEl,c("div","calendar-header-right").children(c("a","calendar-prev").on("click.stop",(function(){return r.prev()})).child(new xt("chevron-left")),c("a","calendar-next").on("click.stop",(function(){return r.next()})).child(new xt("chevron-right")))),c("table","calendar-body").children(c("thead","").child((n=c("tr","")).children.apply(n,Ce(tt("calendar.weeks").map((function(t){return c("th","cell").child(t)}))))),this.bodyEl)),this.selectChange=function(){}}var e,n,r;return e=t,(n=[{key:"setValue",value:function(t){this.value=t,this.cvalue=new Date(t),this.buildAll()}},{key:"prev",value:function(){Re(this.value,-1),this.buildAll()}},{key:"next",value:function(){Re(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(tt("calendar.months")[t.getMonth()]," ").concat(t.getFullYear()))}},{key:"buildBody",value:function(){var t,e=this,n=this.value,r=this.cvalue,i=this.bodyEl,o=function(t,e,n){for(var r=new Date(t,e,1,23,59,59),i=[[],[],[],[],[],[]],o=0;o<6;o+=1)for(var a=0;a<7;a+=1){var l=_e(r,7*o+a),c=l.getMonth()!==e,u=l.getMonth()===n.getMonth()&&l.getDate()===n.getDate();i[o][a]={d:l,disabled:c,active:u}}return i}(n.getFullYear(),n.getMonth(),r).map((function(t){var n,r=t.map((function(t){var n="cell";return t.disabled&&(n+=" disabled"),t.active&&(n+=" active"),c("td","").child(c("div",n).on("click.stop",(function(){e.selectChange(t.d)})).child(t.d.getDate().toString()))}));return(n=c("tr","")).children.apply(n,Ce(r))}));(t=i.html("")).children.apply(t,Ce(o))}}])&&je(e.prototype,n),r&&je(e,r),t}();function Te(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}var Pe=function(){function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.calendar=new Ae(new Date),this.el=c("div","".concat(bt,"-datepicker")).child(this.calendar.el).hide()}var e,n,r;return e=t,(n=[{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(n){t(n),e.hide()}}},{key:"show",value:function(){this.el.show()}},{key:"hide",value:function(){this.el.hide()}}])&&Te(e.prototype,n),r&&Te(e,r),t}();function De(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function Ie(t){return function(t){if(Array.isArray(t))return ze(t)}(t)||function(t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(t))return Array.from(t)}(t)||function(t,e){if(!t)return;if("string"==typeof t)return ze(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return ze(t,e)}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function ze(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function Me(){var t=this.inputText;if(!/^\s*$/.test(t)){var e=this.textlineEl,n=this.textEl,r=this.areaOffset,i=t.split("\n"),o=Math.max.apply(Math,Ie(i.map((function(t){return t.length})))),a=e.offset().width/t.length,l=(o+1)*a+5,c=this.viewFn().width-r.left-a,u=i.length;if(l>r.width){var s=l;l>c&&(s=c,u+=parseInt(l/c,10),u+=l%c>0?1:0),n.css("width","".concat(s,"px"))}(u*=this.rowHeight)>r.height&&n.css("height","".concat(u,"px"))}}function Ne(t,e){var n=t.target,r=n.value,i=n.selectionEnd,o="".concat(r.slice(0,i)).concat(e).concat(r.slice(i));n.value=o,n.setSelectionRange(i+1,i+1),this.inputText=o,this.textlineEl.html(o),Me.call(this)}function He(t){var e=t.keyCode,n=t.altKey;13!==e&&9!==e&&t.stopPropagation(),13===e&&n&&(Ne.call(this,t,"\n"),t.stopPropagation()),13!==e||n||t.preventDefault()}function Fe(t){var e=t.target.value,n=this.suggest,r=this.textlineEl,i=this.validator,o=this.cell;if(null!==o)if("editable"in o&&!0===o.editable||void 0===o.editable){if(this.inputText=e,i)"list"===i.type?n.search(e):n.hide();else{var a=e.lastIndexOf("=");-1!==a?n.search(e.substring(a+1)):n.hide()}r.html(e),Me.call(this),this.change("input",e)}else t.target.value="";else{if(this.inputText=e,i)"list"===i.type?n.search(e):n.hide();else{var l=e.lastIndexOf("=");-1!==l?n.search(e.substring(l+1)):n.hide()}r.html(e),Me.call(this),this.change("input",e)}}function We(t,e){var n=this.textEl.el;setTimeout((function(){e&&n.focus(),n.setSelectionRange(t,t)}),0)}function Le(t,e,n){var r=this.textEl,i=this.textlineEl;r.el.blur(),r.val(t),i.html(t),We.call(this,e,n)}function Ve(t,e){var n=this.inputText,r=this.validator,i=0;if(r&&"list"===r.type)this.inputText=t,i=this.inputText.length;else{var o=n.lastIndexOf("="),a=n.substring(0,o+1),l=n.substring(o+1);l=-1!==l.indexOf(")")?l.substring(l.indexOf(")")):"",this.inputText="".concat(a+t.key,"("),i=this.inputText.length,this.inputText+=")".concat(l)}Le.call(this,this.inputText,i,e)}function Ue(){this.suggest.setItems(this.formulas)}var qe=function(){function t(e,n,r,i){var o=this;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.viewFn=n,this.rowHeight=r,this.formulas=e,this.suggest=new xe(e,(function(t){Ve.call(o,t,!0)})),this.datepicker=new Pe,this.datepicker.change((function(t){o.setText(function(t){var e=t.getMonth()+1,n=t.getDate();return e<10&&(e="0".concat(e)),n<10&&(n="0".concat(n)),"".concat(t.getFullYear(),"-").concat(e,"-").concat(n)}(t)),o.clear()})),this.areaEl=c("div","".concat(bt,"-editor-area")).children(this.textEl=c("textarea","").on("input",(function(t){return Fe.call(o,t)})).on("paste.stop",(function(){})).on("keydown",(function(t){return He.call(o,t)})),this.textlineEl=c("div","textline"),this.suggest.el,this.datepicker.el).on("mousemove.stop",(function(){})).on("mousedown.stop",(function(){})),this.el=c("div","".concat(bt,"-editor")).child(this.areaEl).hide(),this.suggest.bindInputEvents(this.textEl,i),this.areaOffset=null,this.freeze={w:0,h:0},this.cell=null,this.inputText="",this.change=function(){}}var e,n,r;return e=t,(n=[{key:"setFreezeLengths",value:function(t,e){this.freeze.w=t,this.freeze.h=e}},{key:"clear",value:function(){""!==this.inputText&&this.change("finished",this.inputText),this.cell=null,this.areaOffset=null,this.inputText="",this.el.hide(),this.textEl.val(""),this.textlineEl.html(""),Ue.call(this),this.datepicker.hide()}},{key:"setOffset",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"top",n=this.textEl,r=this.areaEl,i=this.suggest,o=this.freeze,a=this.el;if(t){this.areaOffset=t;var l=t.left,c=t.top,u=t.width,s=t.height,f=t.l,h=t.t,d={left:0,top:0};o.w>f&&o.h>h||(o.w<f&&o.h<h?(d.left=o.w,d.top=o.h):o.w>f?d.top=o.h:o.h>h&&(d.left=o.w)),a.offset(d),r.offset({left:l-d.left-.8,top:c-d.top-.8}),n.offset({width:u-9+.8,height:s-3+.8});var p={left:0};p[e]=s,i.setOffset(p),i.hide()}}},{key:"setCell",value:function(t,e){var n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],r=this.el,i=this.datepicker,o=this.suggest;r.show(),this.cell=t;var a=t&&t.text||"";if(t&&(t.f?a=t.f:t.ufv&&(a=t.ufv)),this.setText(a,n),this.validator=e,e){var l=e.type;"date"===l&&(i.show(),/^\s*$/.test(a)||i.setValue(a)),"list"===l&&(o.setItems(e.values()),o.search(""))}}},{key:"setText",value:function(t){var e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];this.inputText=t,Le.call(this,t,t.length,e),Me.call(this)}}])&&De(e.prototype,n),r&&De(e,r),t}();function $e(t){return($e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Be(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Xe(t,e){return(Xe=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function Ye(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 Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=Ge(t);if(e){var i=Ge(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return Ze(this,n)}}function Ze(t,e){return!e||"object"!==$e(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function Ge(t){return(Ge=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var Je=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&Xe(t,e)}(n,t);var e=Ye(n);function n(t){var r,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return Be(this,n),(r=e.call(this,"div","".concat(bt,"-button ").concat(i))).child(tt("button.".concat(t))),r}return n}(l);function Ke(t){return function(t){if(Array.isArray(t))return en(t)}(t)||function(t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(t))return Array.from(t)}(t)||tn(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Qe(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(t)))return;var n=[],r=!0,i=!1,o=void 0;try{for(var a,l=t[Symbol.iterator]();!(r=(a=l.next()).done)&&(n.push(a.value),!e||n.length!==e);r=!0);}catch(t){i=!0,o=t}finally{try{r||null==l.return||l.return()}finally{if(i)throw o}}return n}(t,e)||tn(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function tn(t,e){if(t){if("string"==typeof t)return en(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?en(t,e):void 0}}function en(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function nn(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function rn(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function on(t,e,n){return e&&rn(t.prototype,e),n&&rn(t,n),t}function an(){return window.devicePixelRatio||1}function ln(){return an()-.5}function cn(t){return parseInt(t*an(),10)}function un(t){var e=cn(t);return e>0?e-.5:.5}var sn=function(){function t(e,n,r,i){var o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0;nn(this,t),this.x=e,this.y=n,this.width=r,this.height=i,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 on(t,[{key:"setBorders",value:function(t){var e=t.top,n=t.bottom,r=t.left,i=t.right;e&&(this.borderTop=e),i&&(this.borderRight=i),n&&(this.borderBottom=n),r&&(this.borderLeft=r)}},{key:"setPattern",value:function(t){t&&(this.pattern=t)}},{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,n=this.padding,r=this.x;return"left"===t?r+=n:"center"===t?r+=e/2:"right"===t&&(r+=e-n),r}},{key:"texty",value:function(t,e){var n=this.height,r=this.padding,i=this.y;return"top"===t?i+=r:"middle"===t?i+=n/2-e/2:"bottom"===t&&(i+=n-r-e),i}},{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,n=this.width;return[[t+n,e],[t+n,e+this.height]]}},{key:"bottomxys",value:function(){var t=this.x,e=this.y,n=this.width,r=this.height;return[[t,e+r],[t+n,e+r]]}},{key:"leftxys",value:function(){var t=this.x,e=this.y;return[[t,e],[t,e+this.height]]}}]),t}();function fn(t,e,n,r,i,o,a){var l={x:0,y:0};"underline"===t?l.y="bottom"===i?0:"top"===i?-(o+2):-o/2:"strike"===t&&("bottom"===i?l.y=o/2:"top"===i&&(l.y=-(o/2+2))),"center"===r?l.x=a/2:"right"===r&&(l.x=a),this.line([e-l.x,n-l.y],[e-l.x+a,n-l.y])}function hn(t,e,n,r,i,o){for(var a=n;a<i;a+=o)t.moveTo(e,a),t.lineTo(r,a)}function dn(t,e,n,r,i,o){for(var a=e;a<r;a+=o)t.moveTo(a,n),t.lineTo(a,i)}function pn(t,e,n,r,i,o){for(var a=e,l=a+o;l<=r;l+=o)t.moveTo(l,i),t.lineTo(a,n),a+=o}function yn(t,e,n,r,i,o){for(var a=e,l=a+o;l<=r;l+=o)t.moveTo(a,i),t.lineTo(l,n),a+=o}function vn(t,e,n,r,i,o){for(var a=n;a<i;a+=o)t.moveTo(e,a),t.lineTo(r,a)}var bn=function(){function t(e,n,r){nn(this,t),this.el=e,this.ctx=e.getContext("2d"),this.resize(n,r),this.ctx.scale(an(),an())}return on(t,[{key:"resize",value:function(t,e){this.el.style.width="".concat(t,"px"),this.el.style.height="".concat(e,"px"),this.el.width=cn(t),this.el.height=cn(e)}},{key:"clear",value:function(){var t=this.el,e=t.width,n=t.height;return this.ctx.clearRect(0,0,e,n),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(cn(t),cn(e)),this}},{key:"scale",value:function(t,e){return this.ctx.scale(t,e),this}},{key:"clearRect",value:function(t,e,n,r){return this.ctx.clearRect(t,e,n,r),this}},{key:"fillRect",value:function(t,e,n,r){return this.ctx.fillRect(cn(t)-.5,cn(e)-.5,cn(n),cn(r)),this}},{key:"fillText",value:function(t,e,n){return this.ctx.fillText(t,cn(e),cn(n)),this}},{key:"text",value:function(t,e){var n=this,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=!(arguments.length>3&&void 0!==arguments[3])||arguments[3],o=this.ctx,a=r.align,l=r.valign,c=r.font,u=r.color,s=r.strike,f=r.underline,h=e.textx(a);o.save(),o.beginPath(),this.attr({textAlign:a,textBaseline:l,font:"".concat(c.italic?"italic":""," ").concat(c.bold?"bold":""," ").concat(cn(c.size),"px ").concat(c.name),fillStyle:u,strokeStyle:u});var d="".concat(t).split("\n"),p=e.exttxtwidth?e.exttxtwidth+e.innerWidth():e.innerWidth(),y=[];d.forEach((function(t){var e=o.measureText(t).width;if(i&&e>cn(p)){for(var n={w:0,len:0,start:0},r=0;r<t.length;r+=1)n.w>=cn(p)&&(y.push(t.substr(n.start,n.len)),n={w:0,len:0,start:r}),n.len+=1,n.w+=o.measureText(t[r]).width+1;n.len>0&&y.push(t.substr(n.start,n.len))}else y.push(t)}));var v=(y.length-1)*(c.size+2),b=e.texty(l,v);return y.forEach((function(t){var e=o.measureText(t).width;n.fillText(t,h,b),s&&fn.call(n,"strike",h,b,a,l,c.size,e),f&&fn.call(n,"underline",h,b,a,l,c.size,e),b+=c.size+2})),o.restore(),this}},{key:"border",value:function(t,e){var n=this.ctx;return n.lineWidth=ln,n.strokeStyle=e,"medium"===t?n.lineWidth=cn(2)-.5:"thick"===t?n.lineWidth=cn(3):"dashed"===t?n.setLineDash([cn(3),cn(2)]):"dotted"===t?n.setLineDash([cn(1),cn(1)]):"double"===t&&n.setLineDash([cn(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],n=Qe(e,2),r=n[0],i=n[1];t.moveTo(un(r),un(i));for(var o=1;o<arguments.length;o+=1){var a=o<0||arguments.length<=o?void 0:arguments[o],l=Qe(a,2),c=l[0],u=l[1];t.lineTo(un(c),un(u))}t.stroke()}return this}},{key:"strokeBorders",value:function(t){var e=this.ctx;e.save();var n=t.borderTop,r=t.borderRight,i=t.borderBottom,o=t.borderLeft;n&&(this.border.apply(this,Ke(n)),this.line.apply(this,Ke(t.topxys()))),r&&(this.border.apply(this,Ke(r)),this.line.apply(this,Ke(t.rightxys()))),i&&(this.border.apply(this,Ke(i)),this.line.apply(this,Ke(t.bottomxys()))),o&&(this.border.apply(this,Ke(o)),this.line.apply(this,Ke(t.leftxys()))),e.restore()}},{key:"strokePattern",value:function(t){var e=this.ctx;e.save();var n=t.x,r=t.y,i=t.width,o=t.height,a=t.pattern;if(a){e.beginPath();var l=un(n),c=l+cn(i),u=un(r),s=u+cn(o);switch(a){case"None":case"Solid":break;case"HorizontalStripe":e.lineWidth=2,e.setLineDash([]),hn(e,l,u,c,s,4);break;case"ThinHorizontalStripe":e.lineWidth=1,e.setLineDash([]),hn(e,l,u,c,s,4);break;case"Gray75":e.lineWidth=2,e.setLineDash([2]),vn(e,l,u,c,s,3);break;case"VerticalStripe":e.lineWidth=2,e.setLineDash([]),dn(e,l,u,c,s,4);break;case"ThinVerticalStripe":e.lineWidth=1,e.setLineDash([]),dn(e,l,u,c,s,4);break;case"Gray50":e.lineWidth=2,e.setLineDash([2]),vn(e,l,u,c,s,3.5);break;case"ReverseDiagonalStripe":e.lineWidth=2,e.setLineDash([]),pn(e,l,u,c,s,4);break;case"ThinReverseDiagonalStripe":e.lineWidth=1,e.setLineDash([]),pn(e,l,u,c,s,4);break;case"Gray25":e.lineWidth=2,e.setLineDash([2]),vn(e,l,u,c,s,4);break;case"DiagonalStripe":e.lineWidth=2,e.setLineDash([]),yn(e,l,u,c,s,4);break;case"ThinDiagonalStripe":e.lineWidth=1,e.setLineDash([]),yn(e,l,u,c,s,4);break;case"Gray12":e.lineWidth=2,e.setLineDash([2]),vn(e,l,u,c,s,4.5);break;case"DiagonalCrosshatch":e.lineWidth=1.5,e.setLineDash([]),pn(e,l,u,c,s,4),yn(e,l,u,c,s,4);break;case"ThinHorizontalCrosshatch":e.lineWidth=1,e.setLineDash([]),hn(e,l,u,c,s,4),dn(e,l,u,c,s,4);break;case"Gray6":e.lineWidth=2,e.setLineDash([2]),vn(e,l,u,c,s,5);break;case"ThickDiagonalCrosshatch":e.lineWidth=2,e.setLineDash([]),pn(e,l,u,c,s,4),yn(e,l,u,c,s,4);break;case"ThinDiagonalCrosshatch":e.lineWidth=1,e.setLineDash([]),pn(e,l,u,c,s,4),yn(e,l,u,c,s,4)}e.closePath(),e.stroke()}e.restore()}},{key:"dropdown",value:function(t){var e=this.ctx,n=t.x,r=t.y,i=n+t.width-15,o=r+t.height-15;e.save(),e.beginPath(),e.moveTo(cn(i),cn(o)),e.lineTo(cn(i+8),cn(o)),e.lineTo(cn(i+4),cn(o+6)),e.closePath(),e.fillStyle="rgba(0, 0, 0, .45)",e.fill(),e.restore()}},{key:"error",value:function(t){var e=this.ctx,n=t.x,r=t.y,i=n+t.width-1;e.save(),e.beginPath(),e.moveTo(cn(i-8),cn(r-1)),e.lineTo(cn(i),cn(r-1)),e.lineTo(cn(i),cn(r+8)),e.closePath(),e.fillStyle="rgba(255, 0, 0, .65)",e.fill(),e.restore()}},{key:"frozen",value:function(t){var e=this.ctx,n=t.x,r=t.y,i=n+t.width-1;e.save(),e.beginPath(),e.moveTo(cn(i-8),cn(r-1)),e.lineTo(cn(i),cn(r-1)),e.lineTo(cn(i),cn(r+8)),e.closePath(),e.fillStyle="rgba(0, 255, 0, .85)",e.fill(),e.restore()}},{key:"rect",value:function(t,e){var n=this.ctx,r=t.x,i=t.y,o=t.width,a=t.height,l=t.bgcolor,c=t.pbgcolor,u=t.exttxtwidthR,s=t.exttxtwidthL;if(n.save(),n.beginPath(),n.fillStyle=void 0!==l?l:void 0!==c?c:"#ffffff",n.rect(un(r+1),un(i+1),cn(o-2),cn(a-2)),n.clip(),n.fill(),void 0!==u||void 0!==s){var f=void 0===u?0:u,h=void 0===s?0:s;n.restore(),n.save(),n.rect(un(r+1-h),un(i+1),cn(o+f+h-2),cn(a-2)),n.clip(),e(),n.restore()}else e(),n.restore()}}]),t}(),mn=[{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"}],gn=[{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 wn(t){for(var e=0;e<gn.length;e+=1){var n=gn[e];if(n.pt===t)return n.px}return t}function kn(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(t)))return;var n=[],r=!0,i=!1,o=void 0;try{for(var a,l=t[Symbol.iterator]();!(r=(a=l.next()).done)&&(n.push(a.value),!e||n.length!==e);r=!0);}catch(t){i=!0,o=t}finally{try{r||null==l.return||l.return()}finally{if(i)throw o}}return n}(t,e)||function(t,e){if(!t)return;if("string"==typeof t)return Sn(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Sn(t,e)}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Sn(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}var On=function(t){for(var e=[],n=[],r=[],i=0,o="",a=1,l="",c=0;c<t.length;c+=1){var u=t.charAt(c);if(" "!==u){if(u>="a"&&u<="z")r.push(u.toUpperCase());else if(u>="0"&&u<="9"||u>="A"&&u<="Z"||"."===u)r.push(u);else if('"'===u){for(c+=1;'"'!==t.charAt(c);)r.push(t.charAt(c)),c+=1;n.push('"'.concat(r.join(""))),r=[]}else if("-"===u&&/[+\-*/,(]/.test(l))r.push(u);else{if("("!==u&&r.length>0&&n.push(r.join("")),")"===u){var s=e.pop();if(2===i)try{for(var f=kn(p(n.pop()),2),h=f[0],d=f[1],v=kn(p(n.pop()),2),b=v[0],m=v[1],g=0,w=b;w<=h;w+=1)for(var k=m;k<=d;k+=1)n.push(y(w,k)),g+=1;n.push([s,g])}catch(t){}else if(1===i||3===i)3===i&&n.push(o),n.push([s,a]),a=1;else for(;"("!==s&&(n.push(s),!(e.length<=0));)s=e.pop();i=0}else if("="===u||">"===u||"<"===u){var S=t.charAt(c+1);o=u,"="!==S&&"-"!==S||(o+=S,c+=1),i=3}else if(":"===u)i=2;else if(","===u)3===i&&n.push(o),i=1,a+=1;else if("("===u&&r.length>0)e.push(r.join(""));else{if(e.length>0&&("+"===u||"-"===u)){var O=e[e.length-1];if("("!==O&&n.push(e.pop()),"*"===O||"/"===O)for(;e.length>0&&"("!==(O=e[e.length-1]);)n.push(e.pop())}e.push(u)}r=[]}l=u}}for(r.length>0&&n.push(r.join(""));e.length>0;)n.push(e.pop());return n},xn=function(t,e){var n=kn(t,1)[0],r=t;if('"'===n)return t.substring(1);var i=1;if("-"===n&&(r=t.substring(1),i=-1),r[0]>="0"&&r[0]<="9")return i*Number(r);var o=kn(p(r),2);return i*e(o[0],o[1])},Cn=function(t,e,n,r){for(var i=[],o=0;o<t.length;o+=1){var a=t[o],l=a[0];if("+"===a){var c=i.pop();i.push(W("+",i.pop(),c))}else if("-"===a)if(1===i.length){var u=i.pop();i.push(W("*",u,-1))}else{var s=i.pop();i.push(W("-",i.pop(),s))}else if("*"===a)i.push(W("*",i.pop(),i.pop()));else if("/"===a){var f=i.pop();i.push(W("/",i.pop(),f))}else if("="===l||">"===l||"<"===l){var h=i.pop();Number.isNaN(h)||(h=Number(h));var d=i.pop();Number.isNaN(d)||(d=Number(d));var p=!1;"="===l?p=d===h:">"===a?p=d>h:">="===a?p=d>=h:"<"===a?p=d<h:"<="===a&&(p=d<=h),i.push(p)}else if(Array.isArray(a)){for(var y=kn(a,2),v=y[0],b=y[1],m=[],g=0;g<b;g+=1)m.push(i.pop());i.push(e[v].render(m.reverse()))}else{if(r.includes(a))return 0;(l>="a"&&l<="z"||l>="A"&&l<="Z")&&r.push(a),i.push(xn(a,n)),r.pop()}}return i[0]},En=function t(e,n,r){var i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[];if("="===e[0]){var o=On(e.substring(1));return o.length<=0?e:Cn(o,n,(function(e,o){return t(r(e,o),n,r,i)}),i)}return e};function jn(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(t)))return;var n=[],r=!0,i=!1,o=void 0;try{for(var a,l=t[Symbol.iterator]();!(r=(a=l.next()).done)&&(n.push(a.value),!e||n.length!==e);r=!0);}catch(t){i=!0,o=t}finally{try{r||null==l.return||l.return()}finally{if(i)throw o}}return n}(t,e)||_n(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Rn(t){return function(t){if(Array.isArray(t))return An(t)}(t)||function(t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(t))return Array.from(t)}(t)||_n(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function _n(t,e){if(t){if("string"==typeof t)return An(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?An(t,e):void 0}}function An(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}var Tn=[{key:"SUM",title:et("formula.sum"),render:function(t){return t.reduce((function(t,e){return W("+",t,e)}),0)}},{key:"AVERAGE",title:et("formula.average"),render:function(t){return t.reduce((function(t,e){return Number(t)+Number(e)}),0)/t.length}},{key:"MAX",title:et("formula.max"),render:function(t){return Math.max.apply(Math,Rn(t.map((function(t){return Number(t)}))))}},{key:"MIN",title:et("formula.min"),render:function(t){return Math.min.apply(Math,Rn(t.map((function(t){return Number(t)}))))}},{key:"IF",title:et("formula._if"),render:function(t){var e=jn(t,3),n=e[0],r=e[1],i=e[2];return n?r:i}},{key:"AND",title:et("formula.and"),render:function(t){return t.every((function(t){return t}))}},{key:"OR",title:et("formula.or"),render:function(t){return t.some((function(t){return t}))}},{key:"CONCAT",title:et("formula.concat"),render:function(t){return t.join("")}}],Pn=Tn,Dn={};function In(t){return function(t){if(Array.isArray(t))return Nn(t)}(t)||Hn(t)||Mn(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function zn(t){return function(t){if(Array.isArray(t))return t}(t)||Hn(t)||Mn(t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Mn(t,e){if(t){if("string"==typeof t)return Nn(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Nn(t,e):void 0}}function Nn(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function Hn(t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(t))return Array.from(t)}Tn.forEach((function(t){Dn[t.key]=t}));var Fn=function(t){return t},Wn=function(t){if(/^(-?\d*.?\d*)$/.test(t)){var e=zn(Number(t).toFixed(2).toString().split("\\.")),n=e[0],r=e.slice(1);return[n.replace(/(\d)(?=(\d{3})+(?!\d))/g,"$1,")].concat(In(r))}return t},Ln=[{key:"normal",title:et("format.normal"),type:"string",render:Fn},{key:"text",title:et("format.text"),type:"string",render:Fn},{key:"number",title:et("format.number"),type:"number",label:"1,000.12",render:Wn},{key:"percent",title:et("format.percent"),type:"number",label:"10.12%",render:function(t){return"".concat(t,"%")}},{key:"rmb",title:et("format.rmb"),type:"number",label:"￥10.00",render:function(t){return"￥".concat(Wn(t))}},{key:"usd",title:et("format.usd"),type:"number",label:"$10.00",render:function(t){return"$".concat(Wn(t))}},{key:"eur",title:et("format.eur"),type:"number",label:"€10.00",render:function(t){return"€".concat(Wn(t))}},{key:"date",title:et("format.date"),type:"date",label:"26/09/2008",render:Fn},{key:"time",title:et("format.time"),type:"date",label:"15:59:00",render:Fn},{key:"datetime",title:et("format.datetime"),type:"date",label:"26/09/2008 15:59:00",render:Fn},{key:"duration",title:et("format.duration"),type:"date",label:"24:01:00",render:Fn}],Vn={};function Un(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(t)))return;var n=[],r=!0,i=!1,o=void 0;try{for(var a,l=t[Symbol.iterator]();!(r=(a=l.next()).done)&&(n.push(a.value),!e||n.length!==e);r=!0);}catch(t){i=!0,o=t}finally{try{r||null==l.return||l.return()}finally{if(i)throw o}}return n}(t,e)||function(t,e){if(!t)return;if("string"==typeof t)return qn(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return qn(t,e)}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function qn(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function $n(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}Ln.forEach((function(t){Vn[t.key]=t}));var Bn={fillStyle:"#f4f5f8"},Xn={fillStyle:"#fff",lineWidth:ln,strokeStyle:"#e6e6e6"};function Yn(t,e,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,i=t.cellRect(e,n),o=i.left,a=i.top,l=i.width,c=i.height;return new sn(o,a+r,l,c,3)}function Zn(t,e,n,r){var i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0,o=e.sortedRowMap,a=e.rows,l=e.cols,c=e.viewRangeCache;if(!a.isHide(n)&&!l.isHide(r)){var u=n;o.has(n)&&(u=o.get(n));var s=e.getCell(u,r);if(null!==s){var f=!1;"editable"in s&&!1===s.editable&&(f=!0);var h=e.getCellStyleOrDefault(u,r),d=Yn(e,u,r,i);d.bgcolor=h.bgcolor,d.pbgcolor=h.pbgcolor,void 0!==h.border&&(d.setBorders(h.border),t.strokeBorders(d));var p=d;if(h.hasbgcolor&&(void 0!==h.border&&void 0!==h.border.borderRight||(p.width+=2),void 0!==h.border&&void 0!==h.border.borderBottom||(p.height+=2)),!h.textwrap&&s.text&&s.text.length>0){var y=0,v=0;if(void 0===h.align||"center"===h.align||"left"===h.align)for(var b=r+1;b<=c.eci;b++){var m=e.getCell(u,b);if(null!==m&&void 0!==m.text&&m.text.length>0)break;y+=l.getWidth(b)}if(h.align&&("center"===h.align||"right"===h.align))for(var g=r-1;g>=c.sci;g--){var w=e.getCell(u,g);if(null!==w&&void 0!==w.text&&w.text.length>0)break;v+=l.getWidth(g)}y>0&&(d.exttxtwidthR=y),v>0&&(d.exttxtwidthL=v)}t.rect(p,(function(){var n="";n=e.settings.evalPaused||"server"===e.settings.updateMode?s.text||"":En(s.text||"",Dn,(function(t,n){return e.getCellTextOrDefault(n,t)})),h.format&&"server"!==e.settings.updateMode&&(n=Vn[h.format].render(n));var i=Object.assign({},h.font);i.size=wn(i.size),t.text(n,d,{align:h.align,valign:h.valign,font:i,color:h.color,strike:h.strike,underline:h.underline},h.textwrap),e.validations.getError(u,r)&&t.error(d),f&&t.frozen(d),e.comments.forEach((function(e){u===e.row&&r===e.col&&t.error(d)})),void 0!==h.pattern&&(d.setPattern(h.pattern),t.strokePattern(d))}))}}}function Gn(t){var e=this.data,n=this.draw;if(t){var r=e.autoFilter,i=e.TableAutoFilters;Jn(e,t,n,r),i.forEach((function(r){Jn(e,t,n,r)}))}}function Jn(t,e,n,r){if(r.active()){var i=r.hrange();e.intersects(i)&&i.each((function(e,r){var i=Yn(t,e,r);n.dropdown(i)}))}}function Kn(t,e,n,r,i){var o=this.draw,a=this.data;o.save(),o.translate(e,n).translate(r,i);var l=a.exceptRowSet;o.save(),o.translate(0,-0),t.eachReversCol((function(t,e){Zn(o,a,t,e)}),(function(t){return function(t){return!l.has(t)}(t)})),o.restore();var c=new Set;o.save(),o.translate(0,-0),a.eachMergesInView(t,(function(t){var e=t.sri,n=t.sci,r=t.eri;if(l.has(e)){if(!c.has(e)){c.add(e);var i=a.rows.sumHeight(e,r+1);o.translate(0,-i)}}else Zn(o,a,e,n)})),o.restore(),Gn.call(this,t),o.restore()}function Qn(t,e,n,r){var i=this.draw;i.save(),i.attr({fillStyle:"rgba(75, 137, 255, 0.08)"}).fillRect(t,e,n,r),i.restore()}function tr(t,e,n,r,i,o){var a=this,l=this.draw,c=this.data,u=e.h,s=e.w,f=o+r,d=i+n;l.save(),l.attr(Bn),"all"!==t&&"left"!==t||l.fillRect(0,f,n,u),"all"!==t&&"top"!==t||l.fillRect(d,0,s,r);var p=c.selector.range,y=p.sri,v=p.sci,b=p.eri,m=p.eci;l.attr({textAlign:"center",textBaseline:"middle",font:"500 ".concat(cn(12),"px Source Sans Pro"),fillStyle:"#585757",lineWidth:ln(),strokeStyle:"#e6e6e6"}),"all"!==t&&"left"!==t||(c.rowEach(e.sri,e.eri,(function(t,e,r){var i=f+e,o=t;l.line([0,i],[n,i]),y<=o&&o<b+1&&Qn.call(a,0,i,n,r),l.fillText(o+1,n/2,i+r/2),t>0&&c.rows.isHide(t-1)&&(l.save(),l.attr({strokeStyle:"#c6c6c6"}),l.line([5,i+5],[n-5,i+5]),l.restore())})),l.line([0,u+f],[n,u+f]),l.line([n,f],[n,u+f])),"all"!==t&&"top"!==t||(c.colEach(e.sci,e.eci,(function(t,e,n){var i=d+e,o=t;l.line([i,0],[i,r]),v<=o&&o<m+1&&Qn.call(a,i,0,n,r),l.fillText(h(o),i+n/2,r/2),t>0&&c.cols.isHide(t-1)&&(l.save(),l.attr({strokeStyle:"#c6c6c6"}),l.line([i+5,5],[i+5,r-5]),l.restore())})),l.line([s+d,0],[s+d,r]),l.line([0,r],[s+d,r])),l.restore()}function er(t,e){var n=this.draw;n.save(),n.attr({fillStyle:"#f4f5f8"}).fillRect(0,0,t,e),n.restore()}function nr(t,e,n,r,i){var o=t.sri,a=t.sci,l=t.eri,c=t.eci,u=t.w,s=t.h,f=this.draw,h=this.data;h.settings;f.save(),f.attr(Xn).translate(e+r,n+i),f.clearRect(0,0,u,s),h.showGrid?(h.rowEach(o,l,(function(t,e,n){t!==o&&f.line([0,e],[u,e]),t===l&&f.line([0,e+n],[u,e+n])})),h.colEach(a,c,(function(t,e,n){t!==a&&f.line([e,0],[e,s]),t===c&&f.line([e+n,0],[e+n,s])})),f.restore()):f.restore()}function rr(t,e,n,r){var i=this.draw,o=this.data,a=o.viewWidth()-t,l=o.viewHeight()-e;i.save().translate(t,e).attr({strokeStyle:"rgba(75, 137, 255, .6)"}),i.line([0,r],[a,r]),i.line([n,0],[n,l]),i.restore()}var ir=function(){function t(e,n){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.el=e,this.draw=new bn(e,n.viewWidth(),n.viewHeight()),this.data=n}var e,n,r;return e=t,(n=[{key:"resetData",value:function(t){this.data=t,this.render()}},{key:"render",value:function(){var t=this.data;if(!t.isupdating){t.rows;var e=t.cols.indexWidth,n=t.settings.row.height;this.draw.resize(t.viewWidth(),t.viewHeight()),this.clear();var r=t.viewRange(),i=t.freezeTotalWidth(),o=t.freezeTotalHeight(),a=t.scroll,l=a.x,c=a.y;nr.call(this,r,e,n,i,o),Kn.call(this,r,e,n,-l,-c),tr.call(this,"all",r,e,n,i,o),er.call(this,e,n);var u=Un(t.freeze,2),s=u[0],f=u[1];if(s>0||f>0){if(s>0){var h=r.clone();h.sri=0,h.eri=s-1,h.h=o,nr.call(this,h,e,n,i,0),Kn.call(this,h,e,n,-l,0),tr.call(this,"top",h,e,n,i,0)}if(f>0){var d=r.clone();d.sci=0,d.eci=f-1,d.w=i,nr.call(this,d,e,n,0,o),tr.call(this,"left",d,e,n,0,o),Kn.call(this,d,e,n,0,-c)}var p=t.freezeViewRange();nr.call(this,p,e,n,0,0),tr.call(this,"all",p,e,n,0,0),Kn.call(this,p,e,n,0,0),rr.call(this,e,n,i,o)}}}},{key:"clear",value:function(){this.draw.clear()}}])&&$n(e.prototype,n),r&&$n(e,r),t}();function or(t){return function(t){if(Array.isArray(t))return ar(t)}(t)||function(t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(t))return Array.from(t)}(t)||function(t,e){if(!t)return;if("string"==typeof t)return ar(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return ar(t,e)}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function ar(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function lr(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}var cr=[["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]],ur=["landscape","portrait"];function sr(t){return parseInt(96*t,10)}function fr(t){"cancel"===t?this.el.hide():this.toPrint()}function hr(t){var e=this.paper,n=t.target.value,r=cr[n];e.w=sr(r[1]),e.h=sr(r[2]),this.preview()}function dr(t){var e=this.paper,n=t.target.value,r=ur[n];e.orientation=r,this.preview()}var pr=function(){function t(e){var n,r;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.paper={w:sr(cr[0][1]),h:sr(cr[0][2]),padding:50,orientation:ur[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.el=c("div","".concat(bt,"-print")).children(c("div","".concat(bt,"-print-bar")).children(c("div","-title").child("Print settings"),c("div","-right").children(c("div","".concat(bt,"-buttons")).children(new Je("cancel").on("click",fr.bind(this,"cancel")),new Je("next","primary").on("click",fr.bind(this,"next"))))),c("div","".concat(bt,"-print-content")).children(this.contentEl=c("div","-content"),c("div","-sider").child(c("form","").children(c("fieldset","").children(c("label","").child("".concat(tt("print.size"))),(n=c("select","")).children.apply(n,or(cr.map((function(t,e){return c("option","").attr("value",e).child("".concat(t[0]," ( ").concat(t[1],"''x").concat(t[2],"'' )"))})))).on("change",hr.bind(this))),c("fieldset","").children(c("label","").child("".concat(tt("print.orientation"))),(r=c("select","")).children.apply(r,or(ur.map((function(t,e){return c("option","").attr("value",e).child("".concat(tt("print.orientations")[e]))})))).on("change",dr.bind(this))))))).hide()}var e,n,r;return e=t,(n=[{key:"resetData",value:function(t){this.data=t}},{key:"preview",value:function(){var t=this,e=this.data,n=this.paper,r=n.width,i=n.height,o=n.padding,a=r-2*o,l=i-2*o,u=e.contentRange(),s=parseInt(u.h/l,10)+1,f=a/u.w,h=o,d=o;f>1&&(h+=(a-u.w)/2);var p=0,y=0;this.contentEl.html(""),this.canvases=[];for(var v={sri:0,sci:0,eri:0,eci:0},b=function(n){var o=0,a=0,s=c("div","".concat(bt,"-canvas-card")),b=c("canvas","".concat(bt,"-canvas"));t.canvases.push(b.el);var m=new bn(b.el,r,i);for(m.save(),m.translate(h,d),f<1&&m.scale(f,f);p<=u.eri;p+=1){var g=e.rows.getHeight(p);if(!((o+=g)<l)){a=-(o-g);break}for(var w=0;w<=u.eci;w+=1)Zn(m,e,p,w,y),v.eci=w}v.eri=p,m.restore(),m.save(),m.translate(h,d),f<1&&m.scale(f,f);var k=y;e.eachMergesInView(v,(function(t){var n=t.sri,r=t.sci;Zn(m,e,n,r,k)})),m.restore(),v.sri=v.eri,v.sci=v.eci,y+=a,t.contentEl.child(c("div","".concat(bt,"-canvas-card-wraper")).child(s.child(b)))},m=0;m<s;m+=1)b()}},{key:"toPrint",value:function(){this.el.hide();var t=this.paper,e=c("iframe","").hide().el;window.document.body.appendChild(e);var n=e.contentWindow,r=n.document,i=document.createElement("style");i.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    "),r.head.appendChild(i),this.canvases.forEach((function(t){var e=t.cloneNode(!1);e.getContext("2d").drawImage(t,0,0),r.body.appendChild(e)})),n.print()}}])&&lr(e.prototype,n),r&&lr(e,r),t}();function yr(t){return function(t){if(Array.isArray(t))return vr(t)}(t)||function(t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(t))return Array.from(t)}(t)||function(t,e){if(!t)return;if("string"==typeof t)return vr(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return vr(t,e)}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function vr(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function br(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function mr(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}var gr=[{key:"copy",title:et("contextmenu.copy"),label:"Ctrl+C"},{key:"cut",title:et("contextmenu.cut"),label:"Ctrl+X"},{key:"paste",title:et("contextmenu.paste"),label:"Ctrl+V"},{key:"paste-value",title:et("contextmenu.pasteValue"),label:"Ctrl+Shift+V"},{key:"paste-format",title:et("contextmenu.pasteFormat"),label:"Ctrl+Alt+V"},{key:"divider"},{key:"insert-row",title:et("contextmenu.insertRow")},{key:"insert-column",title:et("contextmenu.insertColumn")},{key:"divider"},{key:"delete-row",title:et("contextmenu.deleteRow")},{key:"delete-column",title:et("contextmenu.deleteColumn")},{key:"delete-cell-text",title:et("contextmenu.deleteCellText")},{key:"hide",title:et("contextmenu.hide")},{key:"divider"},{key:"validation",title:et("contextmenu.validation")},{key:"divider"},{key:"cell-editable",title:et("contextmenu.celleditable")},{key:"cell-non-editable",title:et("contextmenu.cellnoneditable")}];function wr(t){var e=this;return"divider"===t.key?c("div","".concat(bt,"-item divider")):c("div","".concat(bt,"-item")).on("click",(function(){e.itemClick(t.key),e.hide()})).children(t.title(),c("div","label").child(t.label||""))}function kr(){var t=this;return gr.map((function(e){return wr.call(t,e)}))}var Sr=function(){function t(e){var n,r=arguments.length>1&&void 0!==arguments[1]&&arguments[1];br(this,t),this.menuItems=kr.call(this),this.el=(n=c("div","".concat(bt,"-contextmenu"))).children.apply(n,yr(this.menuItems)).hide(),this.viewFn=e,this.itemClick=function(){},this.isHide=r,this.setMode("range")}var e,n,r;return e=t,(n=[{key:"setMode",value:function(t){var e=this.menuItems[12];"row-col"===t?e.show():e.hide()}},{key:"hide",value:function(){var t=this.el;t.hide(),Vt(t)}},{key:"setPosition",value:function(t,e){if(!this.isHide){var n=this.el,r=n.show().offset(),i=r.width,o=r.height,a=this.viewFn(),l=t;a.width-t<=i&&(l-=i),n.css("left","".concat(l,"px"));var c=e;o+e>a.height&&(c-=o+e-a.height),n.css("top","".concat(c,"px")).css("max-height","".concat(a.height,"px")).css("bottom","auto"),Ut(n)}}}])&&mr(e.prototype,n),r&&mr(e,r),t}();function Or(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function xr(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}var Cr=function(){function t(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,r=arguments.length>2?arguments[2]:void 0,i=arguments.length>3?arguments[3]:void 0;Or(this,t),this.tip=tt("toolbar.".concat(e.replace(/-[a-z]/g,(function(t){return t[1].toUpperCase()})))),this.activeTip=null===n?null:tt("toolbar.".concat(n.replace(/-[a-z]/g,(function(t){return t[1].toUpperCase()})))),r&&(this.tip+=" (".concat(r,")")),this.tag=e,this.shortcut=r,this.value=i,this.el=this.element(),this.change=function(){}}var e,n,r;return e=t,(n=[{key:"element",value:function(){var t=this.tip,e=this.activeTip;return c("div","".concat(bt,"-toolbar-btn")).on("mouseenter",(function(n){!function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;if(!e.classList.contains("active")||null!==n){var r=e.getBoundingClientRect(),i=r.left,o=r.top,a=r.width,l=r.height,u=e.classList.contains("active")?n:t,s=c("div","".concat(bt,"-tooltip")).html(u).show();document.body.appendChild(s.el);var f=s.box();s.css("left","".concat(i+a/2-f.width/2,"px")).css("top","".concat(o+l+2,"px")),Wt(e,"mouseleave",(function(){document.body.contains(s.el)&&document.body.removeChild(s.el)})),Wt(e,"click",(function(){document.body.contains(s.el)&&document.body.removeChild(s.el)}))}}(t,n.target,e)})).attr("data-tooltip",t)}},{key:"setState",value:function(){}}])&&xr(e.prototype,n),r&&xr(e,r),t}();function Er(t){return(Er="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function jr(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Rr(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function _r(t,e,n){return(_r="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,n){var r=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=Dr(t)););return t}(t,e);if(r){var i=Object.getOwnPropertyDescriptor(r,e);return i.get?i.get.call(n):i.value}})(t,e,n||t)}function Ar(t,e){return(Ar=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}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 Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=Dr(t);if(e){var i=Dr(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return Pr(this,n)}}function Pr(t,e){return!e||"object"!==Er(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function Dr(t){return(Dr=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var Ir=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&Ar(t,e)}(o,t);var e,n,r,i=Tr(o);function o(){return jr(this,o),i.apply(this,arguments)}return e=o,(n=[{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(n){return t.change(e,t.getValue(n))},_r(Dr(o.prototype),"element",this).call(this).child(this.dd)}},{key:"setState",value:function(t){t&&(this.value=t,this.dd.setTitle(t))}}])&&Rr(e.prototype,n),r&&Rr(e,r),o}(Cr);function zr(t){return(zr="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Mr(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Nr(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function Hr(t,e){return(Hr=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}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 Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=Lr(t);if(e){var i=Lr(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return Wr(this,n)}}function Wr(t,e){return!e||"object"!==zr(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function Lr(t){return(Lr=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var Vr=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&Hr(t,e)}(o,t);var e,n,r,i=Fr(o);function o(t,e,n,r){var a,l;Mr(this,o),(l=i.call(this,"div","".concat(bt,"-dropdown ").concat(r))).title=t,l.change=function(){},l.headerClick=function(){},"string"==typeof t?l.title=c("div","".concat(bt,"-dropdown-title")).child(t):n&&l.title.addClass("arrow-left"),l.contentEl=c("div","".concat(bt,"-dropdown-content")).css("width",e).hide();for(var u=arguments.length,s=new Array(u>4?u-4:0),f=4;f<u;f++)s[f-4]=arguments[f];return(a=l).setContentChildren.apply(a,s),l.headerEl=c("div","".concat(bt,"-dropdown-header")),l.headerEl.on("click",(function(){"block"!==l.contentEl.css("display")?l.show():l.hide()})).children(l.title,n?c("div","".concat(bt,"-icon arrow-right")).child(c("div","".concat(bt,"-icon-img arrow-down"))):""),l.children(l.headerEl,l.contentEl),l}return e=o,(n=[{key:"setContentChildren",value:function(){var t;this.contentEl.html(""),arguments.length>0&&(t=this.contentEl).children.apply(t,arguments)}},{key:"setTitle",value:function(t){this.title.html(t),this.hide()}},{key:"show",value:function(){var t=this;this.contentEl.show(),this.parent().active(),Ut(this.parent(),(function(){t.hide()}))}},{key:"hide",value:function(){this.parent().active(!1),this.contentEl.hide(),Vt(this.parent())}}])&&Nr(e.prototype,n),r&&Nr(e,r),o}(l);function Ur(t){return(Ur="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function qr(t){return function(t){if(Array.isArray(t))return $r(t)}(t)||function(t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(t))return Array.from(t)}(t)||function(t,e){if(!t)return;if("string"==typeof t)return $r(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return $r(t,e)}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function $r(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function Br(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function Xr(t,e){return(Xr=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}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 Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=Gr(t);if(e){var i=Gr(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return Zr(this,n)}}function Zr(t,e){return!e||"object"!==Ur(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function Gr(t){return(Gr=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var Jr=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&Xr(t,e)}(o,t);var e,n,r,i=Yr(o);function o(t,e){var n;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,o);var r=new xt("align-".concat(e)),a=t.map((function(t){return(e="align-".concat(t),c("div","".concat(bt,"-item")).child(new xt(e))).on("click",(function(){n.setTitle(t),n.change(t)}));var e}));return n=i.call.apply(i,[this,r,"auto",!0,"bottom-left"].concat(qr(a)))}return e=o,(n=[{key:"setTitle",value:function(t){this.title.setName("align-".concat(t)),this.hide()}}])&&Br(e.prototype,n),r&&Br(e,r),o}(Vr);function Kr(t){return(Kr="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Qr(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function ti(t,e){return(ti=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function ei(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 Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=ri(t);if(e){var i=ri(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return ni(this,n)}}function ni(t,e){return!e||"object"!==Kr(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function ri(t){return(ri=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var ii=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&ti(t,e)}(o,t);var e,n,r,i=ei(o);function o(t){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,o),i.call(this,"align",null,"",t)}return e=o,(n=[{key:"dropdown",value:function(){var t=this.value;return new Jr(["left","center","right"],t)}}])&&Qr(e.prototype,n),r&&Qr(e,r),o}(Ir);function oi(t){return(oi="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function ai(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function li(t,e){return(li=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function ci(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 Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=si(t);if(e){var i=si(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return ui(this,n)}}function ui(t,e){return!e||"object"!==oi(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function si(t){return(si=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var fi=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&li(t,e)}(o,t);var e,n,r,i=ci(o);function o(t){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,o),i.call(this,"valign",null,"",t)}return e=o,(n=[{key:"dropdown",value:function(){var t=this.value;return new Jr(["top","middle","bottom"],t)}}])&&ai(e.prototype,n),r&&ai(e,r),o}(Ir);function hi(t){return(hi="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function di(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function pi(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function yi(t,e,n){return(yi="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,n){var r=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=gi(t)););return t}(t,e);if(r){var i=Object.getOwnPropertyDescriptor(r,e);return i.get?i.get.call(n):i.value}})(t,e,n||t)}function vi(t,e){return(vi=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}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 Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=gi(t);if(e){var i=gi(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return mi(this,n)}}function mi(t,e){return!e||"object"!==hi(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function gi(t){return(gi=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var wi=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&vi(t,e)}(o,t);var e,n,r,i=bi(o);function o(){return di(this,o),i.apply(this,arguments)}return e=o,(n=[{key:"element",value:function(){var t=this,e=this.tag;return yi(gi(o.prototype),"element",this).call(this).child(new xt(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")}}])&&pi(e.prototype,n),r&&pi(e,r),o}(Cr);function ki(t){return(ki="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Si(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function Oi(t,e){return(Oi=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}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 Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=Ei(t);if(e){var i=Ei(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return Ci(this,n)}}function Ci(t,e){return!e||"object"!==ki(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function Ei(t){return(Ei=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var ji=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&Oi(t,e)}(o,t);var e,n,r,i=xi(o);function o(){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,o),i.call(this,"autofilter")}return e=o,(n=[{key:"setState",value:function(){}}])&&Si(e.prototype,n),r&&Si(e,r),o}(wi);function Ri(t){return(Ri="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function _i(t,e){return(_i=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function Ai(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 Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=Pi(t);if(e){var i=Pi(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return Ti(this,n)}}function Ti(t,e){return!e||"object"!==Ri(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function Pi(t){return(Pi=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var Di=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&_i(t,e)}(n,t);var e=Ai(n);function n(){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,n),e.call(this,"font-bold",null,"Ctrl+B")}return n}(wi);function Ii(t){return(Ii="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function zi(t,e){return(zi=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}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 Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=Hi(t);if(e){var i=Hi(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return Ni(this,n)}}function Ni(t,e){return!e||"object"!==Ii(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function Hi(t){return(Hi=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var Fi=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&zi(t,e)}(n,t);var e=Mi(n);function n(){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,n),e.call(this,"font-italic",null,"Ctrl+I")}return n}(wi);function Wi(t){return(Wi="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Li(t,e){return(Li=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}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 Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=qi(t);if(e){var i=qi(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return Ui(this,n)}}function Ui(t,e){return!e||"object"!==Wi(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function qi(t){return(qi=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var $i=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&Li(t,e)}(n,t);var e=Vi(n);function n(){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,n),e.call(this,"strike")}return n}(wi);function Bi(t){return(Bi="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Xi(t,e){return(Xi=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}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 Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=Gi(t);if(e){var i=Gi(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return Zi(this,n)}}function Zi(t,e){return!e||"object"!==Bi(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function Gi(t){return(Gi=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var Ji=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&Xi(t,e)}(n,t);var e=Yi(n);function n(){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,n),e.call(this,"underline",null,"Ctrl+U")}return n}(wi);function Ki(t){return function(t){if(Array.isArray(t))return Qi(t)}(t)||function(t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(t))return Array.from(t)}(t)||function(t,e){if(!t)return;if("string"==typeof t)return Qi(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Qi(t,e)}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Qi(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}var to=["#ffffff","#000100","#e7e5e6","#445569","#5b9cd6","#ed7d31","#a5a5a5","#ffc001","#4371c6","#71ae47"],eo=[["#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"]],no=["#c00000","#fe0000","#fdc101","#ffff01","#93d051","#00b04e","#01b0f1","#0170c1","#012060","#7030a0"];function ro(t){var e=this;return c("td","").child(c("div","".concat(bt,"-color-palette-cell")).on("click.stop",(function(){return e.change(t)})).css("background-color",t))}var io=function t(){var e,n,r,i=this;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.el=c("div","".concat(bt,"-color-palette")),this.change=function(){};var o=c("table","").children((e=c("tbody","")).children.apply(e,[(n=c("tr","".concat(bt,"-theme-color-placeholders"))).children.apply(n,Ki(to.map((function(t){return ro.call(i,t)}))))].concat(Ki(eo.map((function(t){var e;return(e=c("tr","".concat(bt,"-theme-colors"))).children.apply(e,Ki(t.map((function(t){return ro.call(i,t)}))))}))),[(r=c("tr","".concat(bt,"-standard-colors"))).children.apply(r,Ki(no.map((function(t){return ro.call(i,t)}))))])));this.el.child(o)};function oo(t){return(oo="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function ao(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function lo(t,e){return(lo=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}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 Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=so(t);if(e){var i=so(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return uo(this,n)}}function uo(t,e){return!e||"object"!==oo(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function so(t){return(so=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var fo=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&lo(t,e)}(o,t);var e,n,r,i=co(o);function o(t,e){var n;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,o);var r=new xt(t).css("height","16px").css("border-bottom","3px solid ".concat(e)),a=new io;return a.change=function(t){n.setTitle(t),n.change(t)},n=i.call(this,r,"auto",!1,"bottom-left",a.el)}return e=o,(n=[{key:"setTitle",value:function(t){this.title.css("border-color",t),this.hide()}}])&&ao(e.prototype,n),r&&ao(e,r),o}(Vr);function ho(t){return(ho="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function po(t){return function(t){if(Array.isArray(t))return yo(t)}(t)||function(t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(t))return Array.from(t)}(t)||function(t,e){if(!t)return;if("string"==typeof t)return yo(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return yo(t,e)}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function yo(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function vo(t,e){return(vo=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}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 Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=go(t);if(e){var i=go(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return mo(this,n)}}function mo(t,e){return!e||"object"!==ho(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function go(t){return(go=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var wo=[["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>']],ko=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&vo(t,e)}(n,t);var e=bo(n);function n(t){var r;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,n);var i=new xt("line-type"),o=0,a=wo.map((function(e,n){return c("div","".concat(bt,"-item state ").concat(t===e[0]?"checked":"")).on("click",(function(){a[o].toggle("checked"),a[n].toggle("checked"),o=n,r.hide(),r.change(e)})).child(c("div","".concat(bt,"-line-type")).html(e[1]))}));return r=e.call.apply(e,[this,i,"auto",!1,"bottom-left"].concat(po(a)))}return n}(Vr);function So(t){return function(t){if(Array.isArray(t))return Co(t)}(t)||function(t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(t))return Array.from(t)}(t)||xo(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Oo(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(t)))return;var n=[],r=!0,i=!1,o=void 0;try{for(var a,l=t[Symbol.iterator]();!(r=(a=l.next()).done)&&(n.push(a.value),!e||n.length!==e);r=!0);}catch(t){i=!0,o=t}finally{try{r||null==l.return||l.return()}finally{if(i)throw o}}return n}(t,e)||xo(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function xo(t,e){if(t){if("string"==typeof t)return Co(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Co(t,e):void 0}}function Co(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function Eo(){var t;return c("table","").child((t=c("tbody","")).children.apply(t,arguments))}function jo(t){var e=this;return c("td","").child(c("div","".concat(bt,"-border-palette-cell")).child(new xt("border-".concat(t))).on("click",(function(){e.mode=t;var n=e.mode,r=e.style,i=e.color;e.change({mode:n,style:r,color:i})})))}var Ro=function t(){var e,n,r=this;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.color="#000",this.style="thin",this.mode="all",this.change=function(){},this.ddColor=new fo("line-color",this.color),this.ddColor.change=function(t){r.color=t},this.ddType=new ko(this.style),this.ddType.change=function(t){var e=Oo(t,1)[0];r.style=e},this.el=c("div","".concat(bt,"-border-palette"));var i=Eo(c("tr","").children(c("td","".concat(bt,"-border-palette-left")).child(Eo((e=c("tr","")).children.apply(e,So(["all","inside","horizontal","vertical","outside"].map((function(t){return jo.call(r,t)})))),(n=c("tr","")).children.apply(n,So(["left","top","right","bottom","none"].map((function(t){return jo.call(r,t)})))))),c("td","".concat(bt,"-border-palette-right")).children(c("div","".concat(bt,"-toolbar-btn")).child(this.ddColor.el),c("div","".concat(bt,"-toolbar-btn")).child(this.ddType.el))));this.el.child(i)};function _o(t){return(_o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Ao(t,e){return(Ao=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}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 Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=Do(t);if(e){var i=Do(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return Po(this,n)}}function Po(t,e){return!e||"object"!==_o(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function Do(t){return(Do=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var Io=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&Ao(t,e)}(n,t);var e=To(n);function n(){var t;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,n);var r=new xt("border-all"),i=new Ro;return i.change=function(e){t.change(e),t.hide()},t=e.call(this,r,"auto",!1,"bottom-left",i.el)}return n}(Vr);function zo(t){return(zo="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Mo(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function No(t,e){return(No=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}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 Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=Wo(t);if(e){var i=Wo(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return Fo(this,n)}}function Fo(t,e){return!e||"object"!==zo(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function Wo(t){return(Wo=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var Lo=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&No(t,e)}(o,t);var e,n,r,i=Ho(o);function o(){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,o),i.call(this,"border")}return e=o,(n=[{key:"dropdown",value:function(){return new Io}}])&&Mo(e.prototype,n),r&&Mo(e,r),o}(Ir);function Vo(t){return(Vo="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Uo(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function qo(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function $o(t,e,n){return($o="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,n){var r=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=Zo(t)););return t}(t,e);if(r){var i=Object.getOwnPropertyDescriptor(r,e);return i.get?i.get.call(n):i.value}})(t,e,n||t)}function Bo(t,e){return(Bo=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}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 Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=Zo(t);if(e){var i=Zo(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return Yo(this,n)}}function Yo(t,e){return!e||"object"!==Vo(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function Zo(t){return(Zo=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var Go=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&Bo(t,e)}(o,t);var e,n,r,i=Xo(o);function o(){return Uo(this,o),i.apply(this,arguments)}return e=o,(n=[{key:"element",value:function(){var t=this;return $o(Zo(o.prototype),"element",this).call(this).child(new xt(this.tag)).on("click",(function(){return t.change(t.tag)}))}},{key:"setState",value:function(t){this.el.disabled(t)}}])&&qo(e.prototype,n),r&&qo(e,r),o}(Cr);function Jo(t){return(Jo="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Ko(t,e){return(Ko=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function Qo(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 Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=ea(t);if(e){var i=ea(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return ta(this,n)}}function ta(t,e){return!e||"object"!==Jo(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function ea(t){return(ea=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var na=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&Ko(t,e)}(n,t);var e=Qo(n);function n(){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,n),e.call(this,"clearformat")}return n}(Go);function ra(t){return(ra="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function ia(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function oa(t,e){return(oa=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function aa(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 Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=ca(t);if(e){var i=ca(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return la(this,n)}}function la(t,e){return!e||"object"!==ra(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function ca(t){return(ca=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var ua=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&oa(t,e)}(o,t);var e,n,r,i=aa(o);function o(){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,o),i.call(this,"paintformat")}return e=o,(n=[{key:"setState",value:function(){}}])&&ia(e.prototype,n),r&&ia(e,r),o}(wi);function sa(t){return(sa="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function fa(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function ha(t,e){return(ha=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function da(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 Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=ya(t);if(e){var i=ya(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return pa(this,n)}}function pa(t,e){return!e||"object"!==sa(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function ya(t){return(ya=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var va=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&ha(t,e)}(o,t);var e,n,r,i=da(o);function o(t){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,o),i.call(this,"color",null,void 0,t)}return e=o,(n=[{key:"dropdown",value:function(){var t=this.tag,e=this.value;return new fo(t,e)}}])&&fa(e.prototype,n),r&&fa(e,r),o}(Ir);function ba(t){return(ba="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function ma(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function ga(t,e){return(ga=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function wa(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 Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=Sa(t);if(e){var i=Sa(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return ka(this,n)}}function ka(t,e){return!e||"object"!==ba(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function Sa(t){return(Sa=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var Oa=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&ga(t,e)}(o,t);var e,n,r,i=wa(o);function o(t){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,o),i.call(this,"bgcolor",null,void 0,t)}return e=o,(n=[{key:"dropdown",value:function(){var t=this.tag,e=this.value;return new fo(t,e)}}])&&ma(e.prototype,n),r&&ma(e,r),o}(Ir);function xa(t){return(xa="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Ca(t){return function(t){if(Array.isArray(t))return Ea(t)}(t)||function(t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(t))return Array.from(t)}(t)||function(t,e){if(!t)return;if("string"==typeof t)return Ea(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Ea(t,e)}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Ea(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function ja(t,e){return(ja=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function Ra(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 Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=Aa(t);if(e){var i=Aa(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return _a(this,n)}}function _a(t,e){return!e||"object"!==xa(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function Aa(t){return(Aa=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var Ta=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&ja(t,e)}(n,t);var e=Ra(n);function n(){var t;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,n);var r=gn.map((function(e){return c("div","".concat(bt,"-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(Ca(r)))}return n}(Vr);function Pa(t){return(Pa="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Da(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function Ia(t,e){return(Ia=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function za(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 Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=Na(t);if(e){var i=Na(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return Ma(this,n)}}function Ma(t,e){return!e||"object"!==Pa(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function Na(t){return(Na=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var Ha=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&Ia(t,e)}(o,t);var e,n,r,i=za(o);function o(){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,o),i.call(this,"font-size")}return e=o,(n=[{key:"getValue",value:function(t){return t.pt}},{key:"dropdown",value:function(){return new Ta}}])&&Da(e.prototype,n),r&&Da(e,r),o}(Ir);function Fa(t){return(Fa="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Wa(t){return function(t){if(Array.isArray(t))return La(t)}(t)||function(t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(t))return Array.from(t)}(t)||function(t,e){if(!t)return;if("string"==typeof t)return La(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return La(t,e)}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function La(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function Va(t,e){return(Va=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function Ua(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 Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=$a(t);if(e){var i=$a(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return qa(this,n)}}function qa(t,e){return!e||"object"!==Fa(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function $a(t){return($a=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var Ba=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&Va(t,e)}(n,t);var e=Ua(n);function n(){var t;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,n);var r=mn.map((function(e){return c("div","".concat(bt,"-item")).on("click",(function(){t.setTitle(e.title),t.change(e)})).child(e.title)}));return t=e.call.apply(e,[this,mn[0].title,"160px",!0,"bottom-left"].concat(Wa(r)))}return n}(Vr);function Xa(t){return(Xa="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Ya(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function Za(t,e){return(Za=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}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 Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=Ka(t);if(e){var i=Ka(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return Ja(this,n)}}function Ja(t,e){return!e||"object"!==Xa(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function Ka(t){return(Ka=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var Qa=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&Za(t,e)}(o,t);var e,n,r,i=Ga(o);function o(){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,o),i.call(this,"font-name")}return e=o,(n=[{key:"getValue",value:function(t){return t.key}},{key:"dropdown",value:function(){return new Ba}}])&&Ya(e.prototype,n),r&&Ya(e,r),o}(Ir);function tl(t){return(tl="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function el(t){return function(t){if(Array.isArray(t))return nl(t)}(t)||function(t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(t))return Array.from(t)}(t)||function(t,e){if(!t)return;if("string"==typeof t)return nl(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return nl(t,e)}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function nl(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function rl(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function il(t,e){return(il=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function ol(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 Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=ll(t);if(e){var i=ll(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return al(this,n)}}function al(t,e){return!e||"object"!==tl(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function ll(t){return(ll=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var cl=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&il(t,e)}(o,t);var e,n,r,i=ol(o);function o(){var t;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,o);var e=Ln.slice(0);return e.splice(2,0,{key:"divider"}),e.splice(8,0,{key:"divider"}),e=e.map((function(e){var n=c("div","".concat(bt,"-item"));return"divider"===e.key?n.addClass("divider"):(n.child(e.title()).on("click",(function(){t.setTitle(e.title()),t.change(e)})),e.label&&n.child(c("div","label").html(e.label))),n})),t=i.call.apply(i,[this,"Normal","220px",!0,"bottom-left"].concat(el(e)))}return e=o,(n=[{key:"setTitle",value:function(t){for(var e=0;e<Ln.length;e+=1)Ln[e].key===t&&this.title.html(Ln[e].title());this.hide()}}])&&rl(e.prototype,n),r&&rl(e,r),o}(Vr);function ul(t){return(ul="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function sl(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function fl(t,e){return(fl=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function hl(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 Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=pl(t);if(e){var i=pl(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return dl(this,n)}}function dl(t,e){return!e||"object"!==ul(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function pl(t){return(pl=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var yl=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&fl(t,e)}(o,t);var e,n,r,i=hl(o);function o(){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,o),i.call(this,"format")}return e=o,(n=[{key:"getValue",value:function(t){return t.key}},{key:"dropdown",value:function(){return new cl}}])&&sl(e.prototype,n),r&&sl(e,r),o}(Ir);function vl(t){return(vl="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function bl(t){return function(t){if(Array.isArray(t))return ml(t)}(t)||function(t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(t))return Array.from(t)}(t)||function(t,e){if(!t)return;if("string"==typeof t)return ml(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return ml(t,e)}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function ml(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function gl(t,e){return(gl=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function wl(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 Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=Sl(t);if(e){var i=Sl(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return kl(this,n)}}function kl(t,e){return!e||"object"!==vl(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function Sl(t){return(Sl=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var Ol=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&gl(t,e)}(n,t);var e=wl(n);function n(){var t;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,n);var r=Tn.map((function(e){return c("div","".concat(bt,"-item")).on("click",(function(){t.hide(),t.change(e)})).child(e.key)}));return t=e.call.apply(e,[this,new xt("formula"),"180px",!0,"bottom-left"].concat(bl(r)))}return n}(Vr);function xl(t){return(xl="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Cl(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function El(t,e){return(El=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function jl(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 Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=_l(t);if(e){var i=_l(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return Rl(this,n)}}function Rl(t,e){return!e||"object"!==xl(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function _l(t){return(_l=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var Al=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&El(t,e)}(o,t);var e,n,r,i=jl(o);function o(){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,o),i.call(this,"formula")}return e=o,(n=[{key:"getValue",value:function(t){return t.key}},{key:"dropdown",value:function(){return new Ol}}])&&Cl(e.prototype,n),r&&Cl(e,r),o}(Ir);function Tl(t){return(Tl="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Pl(t,e){return(Pl=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function Dl(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 Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=zl(t);if(e){var i=zl(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return Il(this,n)}}function Il(t,e){return!e||"object"!==Tl(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function zl(t){return(zl=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var Ml=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&Pl(t,e)}(n,t);var e=Dl(n);function n(){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,n),e.call(this,"freeze")}return n}(wi);function Nl(t){return(Nl="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Hl(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function Fl(t,e){return(Fl=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function Wl(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 Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=Vl(t);if(e){var i=Vl(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return Ll(this,n)}}function Ll(t,e){return!e||"object"!==Nl(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function Vl(t){return(Vl=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var Ul=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&Fl(t,e)}(o,t);var e,n,r,i=Wl(o);function o(){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,o),i.call(this,"merge","unmerge")}return e=o,(n=[{key:"setState",value:function(t,e){this.el.active(t).disabled(e)}}])&&Hl(e.prototype,n),r&&Hl(e,r),o}(wi);function ql(t){return(ql="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function $l(t,e){return($l=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function Bl(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 Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=Yl(t);if(e){var i=Yl(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return Xl(this,n)}}function Xl(t,e){return!e||"object"!==ql(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function Yl(t){return(Yl=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var Zl=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&$l(t,e)}(n,t);var e=Bl(n);function n(){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,n),e.call(this,"print","Ctrl+P")}return n}(Go);function Gl(t){return(Gl="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Jl(t,e){return(Jl=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function Kl(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 Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=tc(t);if(e){var i=tc(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return Ql(this,n)}}function Ql(t,e){return!e||"object"!==Gl(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function tc(t){return(tc=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var ec=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&Jl(t,e)}(n,t);var e=Kl(n);function n(){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,n),e.call(this,"textwrap")}return n}(wi);function nc(t){return(nc="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function rc(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function ic(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function oc(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&ac(t,e)}function ac(t,e){return(ac=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function lc(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 Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=uc(t);if(e){var i=uc(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return cc(this,n)}}function cc(t,e){return!e||"object"!==nc(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function uc(t){return(uc=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var sc=function(t){oc(n,t);var e=lc(n);function n(){var t;ic(this,n);var r=new xt("ellipsis"),i=c("div","".concat(bt,"-toolbar-more"));return(t=e.call(this,r,"auto",!1,"bottom-right",i)).moreBtns=i,t.contentEl.css("max-width","420px"),t}return n}(Vr),fc=function(t){oc(o,t);var e,n,r,i=lc(o);function o(){var t;return ic(this,o),(t=i.call(this,"more")).el.hide(),t}return e=o,(n=[{key:"dropdown",value:function(){return new sc}},{key:"show",value:function(){this.el.show()}},{key:"hide",value:function(){this.el.hide()}}])&&rc(e.prototype,n),r&&rc(e,r),o}(Ir);function hc(t){return(hc="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function dc(t,e){return(dc=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function pc(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 Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=vc(t);if(e){var i=vc(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return yc(this,n)}}function yc(t,e){return!e||"object"!==hc(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function vc(t){return(vc=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var bc=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&dc(t,e)}(n,t);var e=pc(n);function n(){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,n),e.call(this,"sort")}return n}(Go);function mc(t){return(mc="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function gc(t,e){return(gc=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function wc(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 Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=Sc(t);if(e){var i=Sc(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return kc(this,n)}}function kc(t,e){return!e||"object"!==mc(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function Sc(t){return(Sc=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var Oc=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&gc(t,e)}(n,t);var e=wc(n);function n(){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,n),e.call(this,"search")}return n}(Go);function xc(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function Cc(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(t)))return;var n=[],r=!0,i=!1,o=void 0;try{for(var a,l=t[Symbol.iterator]();!(r=(a=l.next()).done)&&(n.push(a.value),!e||n.length!==e);r=!0);}catch(t){i=!0,o=t}finally{try{r||null==l.return||l.return()}finally{if(i)throw o}}return n}(t,e)||function(t,e){if(!t)return;if("string"==typeof t)return Ec(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Ec(t,e)}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Ec(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function jc(){return c("div","".concat(bt,"-toolbar-divider"))}function Rc(){var t=this;this.btns2=[],this.items.forEach((function(e){if(Array.isArray(e))e.forEach((function(e){var n=e.el,r=n.box(),i=n.computedStyle(),o=i.marginLeft,a=i.marginRight;t.btns2.push([n,r.width+parseInt(o,10)+parseInt(a,10)])}));else{var n=e.box(),r=e.computedStyle(),i=r.marginLeft,o=r.marginRight;t.btns2.push([e,n.width+parseInt(i,10)+parseInt(o,10)])}}))}function _c(){var t,e,n=this.el,r=this.btns,i=this.moreEl,o=this.btns2,a=i.dd,l=a.moreBtns,c=a.contentEl,u=n.box(),s=160,f=12,h=[],d=[];o.forEach((function(t,e){var n=Cc(t,2),r=n[0],i=n[1];s+=i,e===o.length-1||s<u.width?h.push(r):(f+=i,d.push(r))})),(t=r.html("")).children.apply(t,h),(e=l.html("")).children.apply(e,d),c.css("width","".concat(f,"px")),d.length>0?i.show():i.hide()}var Ac=function(){function t(e,n,r,i){var o=this;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.data=e,this.change=function(){},this.widthFn=n,this.isHide=r;var a=e.defaultStyle();this.items=[[new Zl,this.paintformatEl=new ua,this.clearformatEl=new na],jc(),[this.formatEl=new yl],jc(),[this.fontEl=new Qa,this.fontSizeEl=new Ha],jc(),[this.boldEl=new Di,this.italicEl=new Fi,this.underlineEl=new Ji,this.strikeEl=new $i,this.textColorEl=new va(a.color)],jc(),[this.fillColorEl=new Oa(a.bgcolor),this.borderEl=new Lo,this.mergeEl=new Ul],jc(),[this.alignEl=new ii(a.align),this.valignEl=new fi(a.valign),this.textwrapEl=new ec],jc(),[this.freezeEl=new Ml,this.autofilterEl=new ji,this.formulaEl=new Al,this.moreEl=new fc,this.sortEl=new bc,this.searchEl=new Oc]],r&&i&&(this.items=[[this.moreEl=new fc,this.sortEl=new bc,this.searchEl=new Oc]]),this.el=c("div","".concat(bt,"-toolbar")),this.btns=c("div","".concat(bt,"-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)})),this.el.child(this.btns),r&&!i?this.el.hide():(this.reset(),setTimeout((function(){Rc.call(o),_c.call(o)}),0),Wt(window,"resize",(function(){_c.call(o)})))}var e,n,r;return e=t,(n=[{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 n=e.font,r=e.format;this.formatEl.setState(r),this.fontEl.setState(n.name),this.fontSizeEl.setState(n.size),this.boldEl.setState(n.bold),this.italicEl.setState(n.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())}}}])&&xc(e.prototype,n),r&&xc(e,r),t}();function Tc(t){return function(t){if(Array.isArray(t))return Pc(t)}(t)||function(t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(t))return Array.from(t)}(t)||function(t,e){if(!t)return;if("string"==typeof t)return Pc(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Pc(t,e)}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Pc(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function Dc(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Ic(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}var zc=function(){function t(e,n){var r,i=this,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"600px",a=!(arguments.length>3&&void 0!==arguments[3])||arguments[3],l=arguments.length>4&&void 0!==arguments[4]&&arguments[4];Dc(this,t),this.moving=!1,this.drag=l,this.title=e,this.el=c("div","".concat(bt,"-modal")).css("width",o).css("position","absolute").children(c("div","".concat(bt,"-modal-header")).children(new xt("close").on("click.stop",(function(){return i.hide()})),this.title),(r=c("div","".concat(bt,"-modal-content"))).children.apply(r,Tc(n))).hide(),this.showDimmer=a,this.drag&&this.el.on("mousedown.stop",(function(t){return i.mousedownHandler(t)}))}var e,n,r;return e=t,(n=[{key:"show",value:function(){var t=this;if(!this.moving){this.showDimmer&&(this.dimmer=c("div","".concat(bt,"-dimmer active")),document.body.appendChild(this.dimmer.el));var e=this.el.show().box(),n=e.width,r=e.height,i=document.documentElement,o=i.clientHeight,a=i.clientWidth;this.el.offset({left:(a-n)/2,top:(o-r)/3}),window.xkeydownEsc=function(e){27===e.keyCode&&t.hide()},Wt(window,"keydown",window.xkeydownEsc)}}},{key:"hide",value:function(){this.el.hide(),this.showDimmer&&document.body.removeChild(this.dimmer.el),Lt(window,"keydown",window.xkeydownEsc),delete window.xkeydownEsc}},{key:"mousedownHandler",value:function(t){var e=this,n=t;qt(window,(function(t){if(e.moving=!0,null!==n){var r=e.el.offset(void 0);e.el.offset({left:r.left+t.movementX,top:r.top+t.movementY}),n=t}}),(function(){n=null,e.moving=!1}))}}])&&Ic(e.prototype,n),r&&Ic(e,r),t}();function Mc(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}var Nc=function(){function t(e,n){var r=this;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.vchange=function(){},this.el=c("div","".concat(bt,"-form-input")),this.input=c("input","").css("width",e).on("input",(function(t){return r.vchange(t)})).attr("placeholder",n),this.el.child(this.input)}var e,n,r;return e=t,(n=[{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:"val",value:function(t){return this.input.val(t)}}])&&Mc(e.prototype,n),r&&Mc(e,r),t}();function Hc(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Fc(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}var Wc=function(){function t(e,n,r){var i=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(){};Hc(this,t),this.key=e,this.getTitle=o,this.vchange=function(){},this.el=c("div","".concat(bt,"-form-select")),this.suggest=new xe(n.map((function(t){return{key:t,title:i.getTitle(t)}})),(function(t){i.itemClick(t.key),a(t.key),i.vchange(t.key)}),r,this.el),this.el.children(this.itemEl=c("div","input-text").html(this.getTitle(e)),this.suggest.el).on("click",(function(){return i.show()}))}var e,n,r;return e=t,(n=[{key:"show",value:function(){this.suggest.search("")}},{key:"itemClick",value:function(t){this.key=t,this.itemEl.html(this.getTitle(t))}},{key:"val",value:function(t){return void 0!==t?(this.key=t,this.itemEl.html(this.getTitle(t)),this):this.key}}])&&Fc(e.prototype,n),r&&Fc(e,r),t}();function Lc(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}var Vc={number:/(^\d+$)|(^\d+(\.\d{0,4})?$)/,date:/^\d{4}-\d{1,2}-\d{1,2}$/},Uc=function(){function t(e,n,r,i){var o=this;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.label="",this.rule=n,r&&(this.label=c("label","label").css("width","".concat(i,"px")).html(r)),this.tip=c("div","tip").child("tip").hide(),this.input=e,this.input.vchange=function(){return o.validate()},this.el=c("div","".concat(bt,"-form-field")).children(this.label,e.el,this.tip)}var e,n,r;return e=t,(n=[{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,n=this.tip,r=this.el,i=t.val();return e.required&&/^\s*$/.test(i)?(n.html(tt("validation.required")),r.addClass("error"),!1):!e.type&&!e.pattern||(e.pattern||Vc[e.type]).test(i)?(r.removeClass("error"),!0):(n.html(tt("validation.notMatch")),r.addClass("error"),!1)}}])&&Lc(e.prototype,n),r&&Lc(e,r),t}();function qc(t){return(qc="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function $c(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function Bc(t,e){return(Bc=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function Xc(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 Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=Zc(t);if(e){var i=Zc(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return Yc(this,n)}}function Yc(t,e){return!e||"object"!==qc(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function Zc(t){return(Zc=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var Gc=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&Bc(t,e)}(o,t);var e,n,r,i=Xc(o);function o(){var t;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,o);var e=new Uc(new Wc("cell",["cell"],"100%",(function(t){return tt("dataValidation.modeType.".concat(t))})),{required:!0},"".concat(tt("dataValidation.range"),":"),100),n=new Uc(new Nc("120px","E3 or E3:F12"),{required:!0,pattern:/^([A-Z]{1,2}[1-9]\d*)(:[A-Z]{1,2}[1-9]\d*)?$/}),r=new Uc(new Wc("list",["list","number","date","phone","email"],"100%",(function(t){return tt("dataValidation.type.".concat(t))}),(function(e){return t.criteriaSelected(e)})),{required:!0},"".concat(tt("dataValidation.criteria"),":"),100),a=new Uc(new Wc("be",["be","nbe","eq","neq","lt","lte","gt","gte"],"160px",(function(t){return tt("dataValidation.operator.".concat(t))}),(function(e){return t.criteriaOperatorSelected(e)})),{required:!0}).hide(),l=new Uc(new Nc("70px","10"),{required:!0}).hide(),u=new Uc(new Nc("70px","100"),{required:!0,type:"number"}).hide(),s=new Uc(new Nc("120px","a,b,c"),{required:!0}),f=new Uc(new Nc("70px","10"),{required:!0,type:"number"}).hide();return(t=i.call(this,tt("contextmenu.validation"),[c("div","".concat(bt,"-form-fields")).children(e.el,n.el),c("div","".concat(bt,"-form-fields")).children(r.el,a.el,l.el,u.el,f.el,s.el),c("div","".concat(bt,"-buttons")).children(new Je("cancel").on("click",(function(){return t.btnClick("cancel")})),new Je("remove").on("click",(function(){return t.btnClick("remove")})),new Je("save","primary").on("click",(function(){return t.btnClick("save")})))])).mf=e,t.rf=n,t.cf=r,t.of=a,t.minvf=l,t.maxvf=u,t.vf=f,t.svf=s,t.change=function(){},t}return e=o,(n=[{key:"showVf",value:function(t){var e="date"===t?"2018-11-12":"10",n=this.vf;n.input.hint(e),n.show()}},{key:"criteriaSelected",value:function(t){var e=this.of,n=this.minvf,r=this.maxvf,i=this.vf,o=this.svf;"date"===t||"number"===t?(e.show(),n.rule.type=t,r.rule.type=t,"date"===t?(n.hint("2018-11-12"),r.hint("2019-11-12")):(n.hint("10"),r.hint("100")),n.show(),r.show(),i.hide(),o.hide()):("list"===t?o.show():o.hide(),i.hide(),e.hide(),n.hide(),r.hide())}},{key:"criteriaOperatorSelected",value:function(t){if(t){var e=this.minvf,n=this.maxvf,r=this.vf;if("be"===t||"nbe"===t)e.show(),n.show(),r.hide();else{var i=this.cf.val();r.rule.type=i,"date"===i?r.hint("2018-11-12"):r.hint("10"),r.show(),e.hide(),n.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"],n=0;n<e.length;n+=1){var r=this[e[n]];if(r.isShow()&&!r.validate())return}var i=this.mf.val(),o=this.rf.val(),a=this.cf.val(),l="phone"===a||"email"===a?"":this.of.val(),c=this.svf.val();"number"!==a&&"date"!==a||(c="be"===l||"nbe"===l?[this.minvf.val(),this.maxvf.val()]:this.vf.val()),this.change("save",i,o,{type:a,operator:l,required:!1,value:c}),this.hide()}}},{key:"setValue",value:function(t){if(t){var e=this.mf,n=this.rf,r=this.cf,i=this.of,o=this.svf,a=this.vf,l=this.minvf,c=this.maxvf,u=t.mode,s=t.ref,f=t.validator||{type:"list"},h=f.type,d=f.operator,p=f.value;e.val(u||"cell"),n.val(s),r.val(h),i.val(d),Array.isArray(p)?(l.val(p[0]),c.val(p[1])):(o.val(p||""),a.val(p||"")),this.criteriaSelected(h),this.criteriaOperatorSelected(d)}this.show()}}])&&$c(e.prototype,n),r&&$c(e,r),o}(zc);function Jc(t){return(Jc="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Kc(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function Qc(t,e){return(Qc=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function tu(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 Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=nu(t);if(e){var i=nu(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return eu(this,n)}}function eu(t,e){return!e||"object"!==Jc(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function nu(t){return(nu=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var ru=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&Qc(t,e)}(o,t);var e,n,r,i=tu(o);function o(){var t;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,o);var e=new Uc(new Nc("120px",""),{required:!0,pattern:/^([A-Z]{1,2}[1-9]\d*)(:[A-Z]{1,2}[1-9]\d*)?$/},"".concat(tt("dataSort.ci"),":"),100),n=new Uc(new Wc("desc",["asc","desc"],"100%",(function(t){return tt("dataSort.order.".concat(t))}),(function(){})),{required:!0},"".concat(tt("dataSort.criteria"),":"),100);return(t=i.call(this,tt("contextmenu.sort"),[c("div","".concat(bt,"-form-fields")).children(e.el),c("div","".concat(bt,"-form-fields")).children(n.el),c("div","".concat(bt,"-buttons")).children(new Je("cancel").on("click",(function(){return t.btnClick("cancel")})),new Je("ok","primary").on("click",(function(){return t.btnClick("ok")})))])).cf=e,t.of=n,t.ci=null,t.values=[],t.change=function(){},t}return e=o,(n=[{key:"btnClick",value:function(t){if("ok"===t){if(!this.cf.validate())return;var e=this.ci,n=this.values,r=this.of.val();this.change("ok",e,r,n)}this.hide()}},{key:"setValue",value:function(t){if(t){var e=this.cf,n=this.of,r=t.ref,i=t.sort,o=t.ci,a=t.m,l=(i||{order:"asc"}).order;e.val(r),n.val(l),this.ci=o,this.values=a}this.show()}}])&&Kc(e.prototype,n),r&&Kc(e,r),o}(zc);function iu(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function ou(t){return c("div","".concat(bt,"-item ").concat(t))}function au(t){var e=this;return ou("state").child(tt("sort.".concat(t))).on("click.stop",(function(){return e.itemClick(t)}))}function lu(t){var e=this,n=this.filterbEl,r=this.filterValues;n.html(""),Object.keys(t).forEach((function(i,o){var a=t[i],l=r.includes(i)?"checked":"";n.child(c("div","".concat(bt,"-item state ").concat(l)).on("click.stop",(function(){return e.filterClick(o,i)})).children(""===i?tt("filter.empty"):i,c("div","label").html("(".concat(a,")"))))}))}function cu(){var t=this.filterhEl,e=this.filterValues,n=this.values;t.html("".concat(e.length," / ").concat(n.length)),t.checked(e.length===n.length)}var uu=function(){function t(){var e=this;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.filterbEl=c("div","".concat(bt,"-body")),this.filterhEl=c("div","".concat(bt,"-header state")).on("click.stop",(function(){return e.filterClick(0,"all")})),this.el=c("div","".concat(bt,"-sort-filter")).children(this.sortAscEl=au.call(this,"asc"),this.sortDescEl=au.call(this,"desc"),ou("divider"),c("div","".concat(bt,"-filter")).children(this.filterhEl,this.filterbEl),c("div","".concat(bt,"-buttons")).children(new Je("cancel").on("click",(function(){return e.btnClick("cancel")})),new Je("ok","primary").on("click",(function(){return e.btnClick("ok")})))).hide(),this.ci=null,this.sortDesc=null,this.values=null,this.filterValues=[]}var e,n,r;return e=t,(n=[{key:"btnClick",value:function(t){if("ok"===t){var e=this.ci,n=this.sort,r=this.filterValues;this.ok&&this.ok(e,n,"in",r)}this.hide()}},{key:"itemClick",value:function(t){this.sort=t;var e=this.sortAscEl,n=this.sortDescEl;e.checked("asc"===t),n.checked("desc"===t)}},{key:"filterClick",value:function(t,e){var n=this.filterbEl,r=this.filterValues,i=this.values,o=n.children();"all"===e?o.length===r.length?(this.filterValues=[],o.forEach((function(t){return c(t).checked(!1)}))):(this.filterValues=Array.from(i),o.forEach((function(t){return c(t).checked(!0)}))):c(o[t]).toggle("checked")?r.push(e):r.splice(r.findIndex((function(t){return t===e})),1),cu.call(this)}},{key:"set",value:function(t,e,n,r){this.ci=t;var i=this.sortAscEl,o=this.sortDescEl;null!==r?(this.sort=r.order,i.checked(r.asc()),o.checked(r.desc())):(this.sortDesc=null,i.checked(!1),o.checked(!1)),this.values=Object.keys(e),this.filterValues=n?Array.from(n.value):Object.keys(e),lu.call(this,e,n),cu.call(this)}},{key:"setOffset",value:function(t){var e=this;this.el.offset(t).show();var n=1;Ut(this.el,(function(){n<=0&&(e.hide(),n=5),n-=1}))}},{key:"show",value:function(){this.el.show()}},{key:"hide",value:function(){this.el.hide(),Vt(this.el)}}])&&iu(e.prototype,n),r&&iu(e,r),t}();function su(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}var fu=function(){function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.el=c("div","".concat(bt,"-comment-tip")).hide()}var e,n,r;return e=t,(n=[{key:"hide",value:function(){this.el.hide()}},{key:"setPosition",value:function(t,e){var n=this.el,r=e.left+e.width,i=e.top-e.height/2;n.css("left","".concat(r,"px")),n.css("top","".concat(i,"px")),n.html(t).show()}}])&&su(e.prototype,n),r&&su(e,r),t}();function hu(t){return(hu="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function du(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function pu(t,e,n){return(pu="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,n){var r=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=mu(t)););return t}(t,e);if(r){var i=Object.getOwnPropertyDescriptor(r,e);return i.get?i.get.call(n):i.value}})(t,e,n||t)}function yu(t,e){return(yu=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function vu(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 Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=mu(t);if(e){var i=mu(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return bu(this,n)}}function bu(t,e){return!e||"object"!==hu(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function mu(t){return(mu=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var gu=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&yu(t,e)}(o,t);var e,n,r,i=vu(o);function o(){var t;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,o);var e=new Uc(new Nc("120px",""),{required:!0},"".concat(tt("dataSearch.label"),":"),100);return(t=i.call(this,tt("toolbar.search"),[c("div","".concat(bt,"-form-fields")).child(e.el),c("div","".concat(bt,"-buttons")).children(new Je("previous").on("click",(function(){return t.btnClick("previous")})),new Je("next").on("click",(function(){return t.btnClick("next")})),new Je("close","primary").on("click",(function(){return t.btnClick("close")})))],"500px",!1,!0)).formField=e,t.change=function(){},t}return e=o,(n=[{key:"btnClick",value:function(t){if("close"!==t){if(!this.formField.validate())return;var e=this.formField.val().toUpperCase().trim();switch(t){case"previous":this.change("previous",e);break;case"next":this.change("next",e)}}else this.hide()}},{key:"show",value:function(){pu(mu(o.prototype),"show",this).call(this),this.formField.input.focus()}}])&&du(e.prototype,n),r&&du(e,r),o}(zc);function wu(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}var ku=function(){function t(e,n){var r=this;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.data=e,this.mode=n,this.inputChange=function(){},this.enter=function(){},this.el=c("div","".concat(bt,"-formula-bar")),this.barLabel=c("div","".concat(bt,"-bar-label")),this.formulaInput=c("input","".concat(bt,"-formula-input")).on("input",(function(t){r.inputChange(t.target.value)})).on("keydown",(function(t){13===(t.keyCode||t.which)&&(r.formulaInput.el.blur(),r.enter(t))})),"read"===this.mode&&this.formulaInput.attr("disabled","disabled"),this.el.children(this.barLabel,this.formulaInput),this.reset()}var e,n,r;return e=t,(n=[{key:"resetData",value:function(t){this.data=t,this.reset()}},{key:"reset",value:function(){var t=this.data,e=t.selector,n=h(e.ci)+""+(e.ri+1),r=t.getSelectedCell(),i="";r&&(r.text&&(i=r.text),r.ufv&&(i=r.ufv),r.f&&(i=r.f)),this.barLabel.html(n),this.formulaInput.val(i)}}])&&wu(e.prototype,n),r&&wu(e,r),t}();function Su(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function Ou(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(t)))return;var n=[],r=!0,i=!1,o=void 0;try{for(var a,l=t[Symbol.iterator]();!(r=(a=l.next()).done)&&(n.push(a.value),!e||n.length!==e);r=!0);}catch(t){i=!0,o=t}finally{try{r||null==l.return||l.return()}finally{if(i)throw o}}return n}(t,e)||function(t,e){if(!t)return;if("string"==typeof t)return xu(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return xu(t,e)}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function xu(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function Cu(t,e){var n,r=this;return function(){for(var i=r,o=arguments.length,a=new Array(o),l=0;l<o;l++)a[l]=arguments[l];var c=a;n||(n=setTimeout((function(){n=null,t.apply(i,c)}),e))}}function Eu(){var t=this.data,e=this.verticalScrollbar,n=this.horizontalScrollbar,r=t.getSelectedRect(),i=r.l,o=r.t,a=r.left,l=r.top,c=r.width,u=r.height,s=this.getTableOffset();if(Math.abs(a)+c>s.width)n.move({left:i+c-s.width});else{var f=t.freezeTotalWidth();a<f&&n.move({left:i-1-f})}if(Math.abs(l)+u>s.height)e.move({top:o+u-s.height-1});else{var h=t.freezeTotalHeight();l<h&&e.move({top:o-1-h})}}function ju(){var t=this.data,e=this.verticalScrollbar,n=this.horizontalScrollbar,r=t.getSelectedRectBySearch(),i=r.l,o=r.t;n.move({left:i-1}),e.move({top:o-1})}function Ru(t,e,n){var r=!(arguments.length>3&&void 0!==arguments[3])||arguments[3],i=arguments.length>4&&void 0!==arguments[4]&&arguments[4];if(-1!==e||-1!==n){var o=this.table,a=this.selector,l=this.toolbar,c=this.formulaBar,u=this.data,s=this.contextMenu;if(s.setMode(-1===e||-1===n?"row-col":"range"),u.canSelected(e,n)){var f=u.getCell(e,n);t?(a.setEnd(e,n,i),this.trigger("cells-selected",f,a.range)):(a.set(e,n,r),this.trigger("cell-selected",f,e,n)),l.reset(),c.reset(),o.render()}}}function _u(t,e){var n=this.selector,r=this.data,i=r.rows,o=r.cols,a=Ou(n.indexes,2),l=a[0],c=a[1],u=n.range,s=u.eri,f=u.eci;if(t){var h=Ou(n.moveIndexes,2);l=h[0],c=h[1]}"left"===e?c>0&&(c-=1):"right"===e?(f!==c&&(c=f),c<o.len-1&&(c+=1)):"up"===e?l>0&&(l-=1):"down"===e?(s!==l&&(l=s),l<i.len-1&&(l+=1)):"row-first"===e?c=0:"row-last"===e?c=o.len-1:"col-first"===e?l=0:"col-last"===e&&(l=i.len-1),t&&(n.moveIndexes=[l,c]),Ru.call(this,t,l,c),Eu.call(this)}function Au(t){if(0===t.buttons&&t.target.className!=="".concat(bt,"-resizer-hover")){var e=t.offsetX,n=t.offsetY,r=this.rowResizer,i=this.colResizer,o=this.tableEl,a=this.data,l=a.rows,c=a.cols,u=a.settings.row.height;if(e>c.indexWidth&&n>u)return r.hide(),void i.hide();var s=o.box(),f=a.getCellRectByXY(t.offsetX,t.offsetY);f.ri>=0&&-1===f.ci?(f.width=c.indexWidth,r.show(f,{width:s.width}),l.isHide(f.ri-1)?r.showUnhide(f.ri):r.hideUnhide()):r.hide(),-1===f.ri&&f.ci>=0?(f.height=u,f.top=0,i.show(f,{height:s.height}),c.isHide(f.ci-1)?i.showUnhide(f.ci):i.hideUnhide()):i.hide()}}function Tu(t){var e=this.verticalScrollbar,n=this.horizontalScrollbar,r=this.data,i=e.scroll().top,o=n.scroll().left,a=r.rows,l=r.cols,c=t.deltaY,u=t.deltaX,s=function(t,e){var n=t,r=0;do{r=e(n),n+=1}while(r<=0);return r},f=function(t){if(t>0){var n=r.scroll.ri+1;if(n<a.len){var o=s(n,(function(t){return a.getHeight(t)}));e.move({top:i+o-1})}}else{var l=r.scroll.ri-1;if(l>=0){var c=s(l,(function(t){return a.getHeight(t)}));e.move({top:0===l?0:i-c})}}},h=Math.abs(c),d=Math.abs(u),p=Math.max(h,d);/Firefox/i.test(window.navigator.userAgent)&&Cu(f(t.detail),50),p===d&&Cu(function(t){if(t>0){var e=r.scroll.ci+1;if(e<l.len){var i=s(e,(function(t){return l.getWidth(t)}));n.move({left:o+i-1})}}else{var a=r.scroll.ci-1;if(a>=0){var c=s(a,(function(t){return l.getWidth(t)}));n.move({left:0===a?0:o-c})}}}(u),50),p===h&&Cu(f(c),50)}function Pu(t,e){var n=this.verticalScrollbar,r=this.horizontalScrollbar,i=n.scroll().top,o=r.scroll().left;"left"===t||"right"===t?r.move({left:o-e}):"up"!==t&&"down"!==t||n.move({top:i-e})}function Du(){var t=this.data,e=this.verticalScrollbar,n=this.getTableOffset().height,r=t.exceptRowTotalHeight(0,-1);e.set(n,t.rows.totalHeight()-r)}function Iu(){var t=this.data,e=this.horizontalScrollbar,n=this.getTableOffset().width;t&&e.set(n,t.cols.totalWidth())}function zu(){var t=this.selector,e=this.data,n=this.editor,r=Ou(e.freeze,2),i=r[0],o=r[1];if(i>0||o>0){var a=e.freezeTotalWidth(),l=e.freezeTotalHeight();n.setFreezeLengths(a,l)}t.resetAreaOffset()}function Mu(){var t=this.tableEl,e=this.overlayerEl,n=this.overlayerCEl,r=this.table,i=this.toolbar,o=this.formulaBar,a=this.selector,l=this.el,c=this.getTableOffset(),u=this.getRect();t.attr(u),e.offset(u),n.offset(c),l.css("width","".concat(u.width,"px")),Du.call(this),Iu.call(this),zu.call(this),r.render(),i.reset(),o.reset(),a.reset()}function Nu(){var t=this.data,e=this.selector;t.clearClipboard(),e.hideClipboard()}function Hu(){var t=this.data,e=this.selector;t.copy(),e.showClipboard()}function Fu(){var t=this.data,e=this.selector;t.cut(),e.showClipboard()}function Wu(t,e){var n=this.data;if("read"!==n.settings.mode&&!n.getLocked())if(n.paste(t,(function(t){return Ct("Tip",t)})))Mu.call(this);else if(e&&null==n.clipboard.range){var r=e.clipboardData.getData("text/plain");r.length>0&&(this.data.pasteFromText(r),Mu.call(this))}}function Lu(){this.data.hideRowsOrCols(),Mu.call(this)}function Vu(t,e){this.data.unhideRowsOrCols(t,e),Mu.call(this)}function Uu(){this.data.autofilter(),Mu.call(this)}function qu(){this.data.autoSort(),Mu.call(this)}function $u(){var t=this.toolbar;t.paintformatActive()&&(Wu.call(this,"format"),Nu.call(this),t.paintformatToggle())}function Bu(t){var e=this,n=this.selector,r=this.data,i=this.table,o=this.sortFilter,a=t.offsetX,l=t.offsetY,c=t.target.className==="".concat(bt,"-selector-corner"),u=r.getCellRectByXY(a,l),s=u.left,f=u.top,h=u.width,d=u.height,p=u.ri,y=u.ci,v=r.autoFilter,b=r.TableAutoFilters;if(v.includes(p,y)&&s+h-20<a&&f+d-20<l){var m=v.items(y,(function(t,e){return r.rows.getCell(t,e)}));return o.set(y,m,v.getFilter(y),v.getSort(y)),o.setOffset({left:s,top:f+d+2}),void(r.currentAutoFilter=v)}for(var g=0,w=b.length;g<w;g++){var k=b[g];if(k.includes(p,y)&&s+h-20<a&&f+d-20<l){var S=k.items(y,(function(t,e){return r.rows.getCell(t,e)}));return o.set(y,S,k.getFilter(y),k.getSort(y)),o.setOffset({left:s,top:f+d+2}),void(r.currentAutoFilter=k)}}t.shiftKey||(c?n.showAutofill(p,y):Ru.call(this,!1,p,y),qt(window,(function(t){var i=r.getCellRectByXY(t.offsetX,t.offsetY);p=i.ri,y=i.ci,c?n.showAutofill(p,y):1!==t.buttons||t.shiftKey||Ru.call(e,!0,p,y,!0,!0)}),(function(){r.getLocked()||(c&&n.arange&&"read"!==r.settings.mode&&r.autofill(n.arange,"all",(function(t){return Ct("Tip",t)}))&&i.render(),n.hideAutofill(),$u.call(e))}))),c||1!==t.buttons||t.shiftKey&&Ru.call(this,!0,p,y)}function Xu(){var t=this.editor,e=this.data.getSelectedRect(),n=this.getTableOffset(),r="top";e.top>n.height/2&&(r="bottom"),t.setOffset(e,r)}function Yu(){var t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],e=this.editor,n=this.data;"read"!==n.settings.mode&&(n.getLocked()||(Xu.call(this),e.setCell(n.getSelectedCell(),n.getSelectedValidator(),t),Nu.call(this)))}function Zu(){var t=this.formulaBar,e=this.data;t.resetData(e)}function Gu(t){var e=this,n=this.data,r=this.table,i=this.selector;n.scrolly(t,(function(){i.resetBRLAreaOffset(),Xu.call(e),r.render()}))}function Ju(t){var e=this,n=this.data,r=this.table,i=this.selector;n.scrollx(t,(function(){i.resetBRTAreaOffset(),Xu.call(e),r.render()}))}function Ku(t,e){var n=t.ri,r=this.table,i=this.selector;this.data.rows.setHeight(n,e),r.render(),i.resetAreaOffset(),Du.call(this),Xu.call(this)}function Qu(t,e){var n=t.ci,r=this.table,i=this.selector;this.data.cols.setWidth(n,e),r.render(),i.resetAreaOffset(),Iu.call(this),Xu.call(this)}function ts(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"finished",n=this.data,r=this.table;if("read"!==n.settings.mode&&!n.getLocked()){n.setSelectedCellText(t,e);var i=n.selector,o=i.ri,a=i.ci;if("finished"===e){if("server"===n.settings.updateMode)return;r.render()}else this.trigger("cell-edited",t,o,a)}}function es(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),Nu.call(this),Mu.call(this)}function ns(t,e){var n=this.data,r=this.modalSort,i=this.modalSearch;if("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?Hu.call(this):Nu.call(this);else if("clearformat"===t)es.call(this,"delete-cell-format");else if("link"===t);else if("chart"===t);else if("autofilter"===t)Uu.call(this);else if("freeze"===t)if(e){var o=n.selector,a=o.ri,l=o.ci;this.freeze(a,l)}else this.freeze(0,0);else"sort"===t?r.setValue(n.getSelectedSort()):"search"===t?i.show():(n.setSelectedCellAttr(t,e),"formula"!==t||n.selector.multiple()||Yu.call(this),Mu.call(this))}function rs(t,e,n,r){this.data.setAutoFilter(t,e,n,r),Mu.call(this),this.data.updateConditionImageVisible()}function is(){var t,e,n,r,i,o,a=this,l=this.selector,c=this.overlayerEl,u=this.rowResizer,s=this.colResizer,f=this.verticalScrollbar,h=this.horizontalScrollbar,d=this.editor,p=this.contextMenu,y=this.commentTip,v=this.toolbar,b=this.formulaBar,m=this.modalValidation,g=this.modalSort,w=this.modalSearch,k=this.sortFilter,S=this.el;c.on("mousemove",(function(t){Au.call(a,t)})).on("mousedown",(function(t){d.clear(),p.hide(),y.hide(),2===t.buttons?(a.data.xyInSelectedRect(t.offsetX,t.offsetY)||Bu.call(a,t),p.setPosition(t.offsetX,t.offsetY),t.stopPropagation()):2===t.detail?Yu.call(a):Bu.call(a,t)})).on("mousewheel.stop",(function(t){Tu.call(a,t)})).on("mouseout",(function(t){var e=t.offsetX;t.offsetY<=0&&s.hide(),e<=0&&u.hide()})),l.inputChange=function(t){ts.call(a,t,"input"),Yu.call(a),Zu.call(a)},b.inputChange=function(t){ts.call(a,t,"input"),Yu.call(a,!1)},b.enter=function(t){d.clear(),t.preventDefault()},Wt(S.el,"mousemove",(function(t){y.hide();var e=t.offsetX,n=t.offsetY,r=a.data,i=r.comments,o=r.getCellRectByXY(e,n);o.ri>=0&&o.ci>=0&&i.forEach((function(t){o.ri===t.row&&o.ci===t.col&&y.setPosition(t.note,o)}))})),t=c.el,n=(e={move:function(t,e){Pu.call(a,t,e)}}).move,r=e.end,i=0,o=0,Wt(t,"touchstart",(function(t){var e=t.touches[0],n=e.pageX,r=e.pageY;i=n,o=r})),Wt(t,"touchmove",(function(t){if(n){var e=t.changedTouches[0],r=e.pageX,a=e.pageY,l=r-i,c=a-o;(Math.abs(l)>10||Math.abs(c)>10)&&($t(l,c,t,n),i=r,o=a),t.preventDefault()}})),Wt(t,"touchend",(function(t){if(r){var e=t.changedTouches[0],n=e.pageX,a=e.pageY;$t(n-i,a-o,t,r)}})),v.change=function(t,e){return ns.call(a,t,e)},k.ok=function(t,e,n,r){return rs.call(a,t,e,n,r)},u.finishedFn=function(t,e){Ku.call(a,t,e)},s.finishedFn=function(t,e){Qu.call(a,t,e)},u.unhideFn=function(t){Vu.call(a,"row",t)},s.unhideFn=function(t){Vu.call(a,"col",t)},f.moveFn=function(t,e){Gu.call(a,t,e)},h.moveFn=function(t,e){Ju.call(a,t,e)},d.change=function(t,e){ts.call(a,e,t),Zu.call(a)},m.change=function(t){if("save"===t){for(var e,n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];(e=a.data).addValidation.apply(e,r)}else a.data.removeValidation()},g.change=function(t,e,n,r){"ok"===t&&(qu.call(a),rs.call(a,e,n,"all",r))},w.change=function(t,e){if("close"!==t){var n=a.data,r=n.search,i=n.rows,o=r.keywords,c=r.current,u=[];if(o===e)u=r.result;else{var s=i.len>0?i._:{};for(var f in s){var h=s[f].cells;for(var d in h){if(-1!==h[d].text.toUpperCase().indexOf(e)){var p={ri:f,ci:d};u.push(p)}}}r.keywords=e,r.result=u}if(0===u.length)return void alert("We couldn't find what you were looking for.");var y=Ou(l.indexes,2),v=y[0],b=y[1];for(var m in u){var g=Number(m)+1,w=u.length-1;if(Number(v)===Number(u[m].ri)&&Number(b)===Number(u[m].ci)){c=g;break}if(Number(v)<Number(u[0].ri)){c=0;break}if(Number(v)>=Number(u[m].ri)&&Number(v)<Number(u[g].ri)){c=g;break}if(Number(v)>Number(u[w].ri)){c=w+1;break}}switch(t){case"previous":c>1&&c--;break;case"next":c<u.length&&c++}var k=c>0?c:1;r.current=k,l.set(u[k-1].ri,u[k-1].ci),ju.call(a)}},p.itemClick=function(t){"validation"===t?m.setValue(a.data.getSelectedValidation()):"sort"===t?g.setValue(a.data.getSelectedSort()):"copy"===t?Hu.call(a):"cut"===t?Fu.call(a):"paste"===t?Wu.call(a,"all"):"paste-value"===t?Wu.call(a,"text"):"paste-format"===t?Wu.call(a,"format"):"hide"===t?Lu.call(a):es.call(a,t)},Wt(window,"resize",(function(){a.reload()})),Wt(window,"click",(function(t){a.focusing=c.contains(t.target)})),Wt(window,"paste",(function(t){a.focusing&&(Wu.call(a,"all",t),t.preventDefault())})),Wt(window,"keydown",(function(t){if(a.focusing){var e=t.keyCode||t.which,n=t.key,r=t.ctrlKey,i=t.shiftKey,o=t.metaKey;if(r||o)switch(e){case 90:a.undo(),t.preventDefault();break;case 89:a.redo(),t.preventDefault();break;case 67:Hu.call(a),t.preventDefault();break;case 88:Fu.call(a),t.preventDefault();break;case 85:v.trigger("underline"),t.preventDefault();break;case 86:break;case 37:_u.call(a,i,"row-first"),t.preventDefault();break;case 38:_u.call(a,i,"col-first"),t.preventDefault();break;case 39:_u.call(a,i,"row-last"),t.preventDefault();break;case 40:_u.call(a,i,"col-last"),t.preventDefault();break;case 32:Ru.call(a,!1,-1,a.data.selector.ci,!1),t.preventDefault();break;case 66:v.trigger("bold");break;case 73:v.trigger("italic")}else{switch(e){case 32:i&&Ru.call(a,!1,a.data.selector.ri,-1,!1);break;case 27:p.hide(),y.hide(),Nu.call(a);break;case 37:_u.call(a,i,"left"),t.preventDefault();break;case 38:_u.call(a,i,"up"),t.preventDefault();break;case 39:_u.call(a,i,"right"),t.preventDefault();break;case 40:_u.call(a,i,"down"),t.preventDefault();break;case 9:d.clear(),_u.call(a,!1,i?"left":"right"),t.preventDefault();break;case 13:d.clear(),_u.call(a,!1,i?"up":"down"),t.preventDefault();break;case 8:es.call(a,"delete-cell-text"),t.preventDefault()}"Delete"===n?(es.call(a,"delete-cell-text"),t.preventDefault()):e>=65&&e<=90||e>=48&&e<=57||e>=96&&e<=105||"="===t.key?(ts.call(a,t.key,"input"),Yu.call(a),Zu.call(a)):113===e&&Yu.call(a)}}}))}var os=function(){function t(e,n){var r=this;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.eventMap=new Map;var i=n.settings,o=i.view,a=i.showToolbar,l=i.showContextmenu,u=i.mode,s=i.showPartToolbar;this.el=c("div","".concat(bt,"-sheet")),this.toolbar=new Ac(n,o.width,!a,s),this.formulaBar=new ku(n,u),this.print=new pr(n),e.children(this.toolbar.el,this.formulaBar.el,this.el,this.print.el),this.data=n,this.tableEl=c("canvas","".concat(bt,"-table"));var f=n.settings.row.height;this.rowResizer=new Yt(!1,f),this.colResizer=new Yt(!0,n.cols.minWidth),this.verticalScrollbar=new Gt(!0),this.horizontalScrollbar=new Gt(!1),this.editor=new qe(Pn,(function(){return r.getTableOffset()}),f,this),this.modalValidation=new Gc,this.modalSort=new ru,this.modalSearch=new gu,this.contextMenu=new Sr((function(){return r.getRect()}),!l),this.commentTip=new fu,this.selector=new ye(n),this.overlayerCEl=c("div","".concat(bt,"-overlayer-content")).children(this.editor.el,this.selector.el),this.overlayerEl=c("div","".concat(bt,"-overlayer")).child(this.overlayerCEl),this.sortFilter=new uu,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.modalValidation.el,this.modalSort.el,this.modalSearch.el,this.sortFilter.el),this.table=new ir(this.tableEl.el,n),is.call(this),Mu.call(this),Ru.call(this,!1,0,0)}var e,n,r;return e=t,(n=[{key:"on",value:function(t,e){return this.eventMap.set(t,e),this}},{key:"trigger",value:function(t){var e=this.eventMap;if(e.has(t)){for(var n,r=arguments.length,i=new Array(r>1?r-1:0),o=1;o<r;o++)i[o-1]=arguments[o];(n=e.get(t)).call.apply(n,[this].concat(i))}}},{key:"resetData",value:function(t){this.editor.clear(),this.data=t,Du.call(this),Iu.call(this),this.toolbar.resetData(t),this.formulaBar.resetData(t),this.print.resetData(t),this.selector.resetData(t),this.table.resetData(t),this.data.reloadImagesShapes()}},{key:"loadData",value:function(t){return this.data.setData(t),Mu.call(this),this}},{key:"freeze",value:function(t,e){return this.data.setFreeze(t,e),Mu.call(this),this}},{key:"undo",value:function(){this.data.undo(),Mu.call(this)}},{key:"redo",value:function(){this.data.redo(),Mu.call(this)}},{key:"reload",value:function(){return Mu.call(this),this}},{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,n=t.cols,r=this.data.settings.row.height,i=this.getRect(),o=i.width,a=i.height;return{width:o-n.indexWidth,height:a-e.height,left:n.indexWidth,top:r}}}])&&Su(e.prototype,n),r&&Su(e,r),t}();function as(t){return(as="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function ls(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(t)))return;var n=[],r=!0,i=!1,o=void 0;try{for(var a,l=t[Symbol.iterator]();!(r=(a=l.next()).done)&&(n.push(a.value),!e||n.length!==e);r=!0);}catch(t){i=!0,o=t}finally{try{r||null==l.return||l.return()}finally{if(i)throw o}}return n}(t,e)||us(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function cs(t){return function(t){if(Array.isArray(t))return ss(t)}(t)||function(t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(t))return Array.from(t)}(t)||us(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function us(t,e){if(t){if("string"==typeof t)return ss(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?ss(t,e):void 0}}function ss(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function fs(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function hs(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function ds(t,e,n){return e&&hs(t.prototype,e),n&&hs(t,n),t}function ps(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&ys(t,e)}function ys(t,e){return(ys=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function vs(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 Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=ms(t);if(e){var i=ms(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return bs(this,n)}}function bs(t,e){return!e||"object"!==as(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function ms(t){return(ms=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var gs=function(t){ps(n,t);var e=vs(n);function n(t){var r;fs(this,n);var i=new xt("ellipsis");return(r=e.call(this,i,"auto",!1,"top-left")).contentClick=t,r}return ds(n,[{key:"reset",value:function(t){var e=this,n=t.map((function(t,n){return c("div","".concat(bt,"-item")).css("width","150px").css("font-weight","normal").on("click",(function(){e.contentClick(n),e.hide()})).child(t)}));this.setContentChildren.apply(this,cs(n))}},{key:"setTitle",value:function(){}}]),n}(Vr),ws=function(t){ps(n,t);var e=vs(n);function n(t){var r;fs(this,n);var i=new xt("pagination");return(r=e.call(this,i,"100px",!1,"top-left")).contentEl.css("max-height","298px"),r.contentEl.css("overflow-y","auto"),r.contentClick=t,r}return ds(n,[{key:"reset",value:function(t){var e=this,n=t.map((function(t,n){return c("div","".concat(bt,"-item")).css("width","auto").css("font-weight","normal").on("click",(function(){e.contentClick(n),e.hide()})).child(t)}));this.setContentChildren.apply(this,cs(n))}}]),n}(Vr),ks=[{key:"delete",title:et("contextmenu.deleteSheet")}];function Ss(t){var e=this;return c("div","".concat(bt,"-item")).child(t.title()).on("click",(function(){e.itemClick(t.key),e.hide()}))}function Os(){var t=this;return ks.map((function(e){return Ss.call(t,e)}))}var xs=function(){function t(){var e;fs(this,t),this.el=(e=c("div","".concat(bt,"-contextmenu")).css("width","160px")).children.apply(e,cs(Os.call(this))).hide(),this.itemClick=function(){}}return ds(t,[{key:"hide",value:function(){var t=this.el;t.hide(),Vt(t)}},{key:"setOffset",value:function(t){var e=this.el;e.offset(t),e.show(),Ut(e)}}]),t}(),Cs=function(){function t(){var e=this,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:function(){},r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(){},i=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(){},l=arguments.length>5?arguments[5]:void 0;fs(this,t),this.settings=l,this.addFunc=n,this.swapFunc=r,this.updateFunc=o,this.scrollFunc=a,this.dataNames=[],this.activeEl=null,this.deleteEl=null,this.items=[],this.moreEl=new gs((function(t){e.clickSwap2(e.items[t])})),this.paginationEl=new ws((function(t){e.scrollFunc(t)})),this.contextMenu=new xs,this.contextMenu.itemClick=i,this.el=c("div","".concat(bt,"-bottombar")).children(this.contextMenu.el,this.menuEl=this.setMenuEl())}return ds(t,[{key:"setMenuEl",value:function(){var t=this;return"edit"===this.settings.mode?c("ul","".concat(bt,"-menu")).child(c("li","").children(new xt("add").on("click",(function(){t.dataNames.length<10?t.addFunc():Ct("Warning","It is less than or equal to 10")})),c("span","").child(this.moreEl))):c("ul","".concat(bt,"-menu")).child(c("li","").children(c("span","").child(this.moreEl)))}},{key:"addItem",value:function(t,e,n,r){this.dataNames.push(t);var i=c("li",e?"active":"").child(t);void 0!==n&&(i.el.style.color=r,i.el.style.backgroundColor=n),this.setItemEvent(i),e&&this.clickSwap(i),this.items.push(i),this.menuEl.child(i),this.moreEl.reset(this.dataNames)}},{key:"addPagination",value:function(t){for(var e=[],n=1;n<=t;n++){var r=n+"";e.push(r)}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(n){var r=n.target,i=r.offsetLeft,o=r.offsetHeight;e.contextMenu.setOffset({left:i,bottom:o+1}),e.deleteEl=t})).on("dblclick",(function(){if(!(t.el.children.length>0)){var n=t.html(),r=new Nc("auto","");r.val(n),r.input.on("blur",(function(t){var i=t.target.value,o=e.dataNames.findIndex((function(t){return t===n}));e.renameItem(o,i,r)})),t.html("").child(r.el),r.focus()}})):t.on("click",(function(){e.clickSwap2(t)}))}},{key:"renameItem",value:function(t,e,n){this.dataNames[t]!==e?this.dataNames.indexOf(e)>=0?Ct("Error","Same worksheet name already exist",(function(){n.focus()})):(this.dataNames.splice(t,1,e),this.moreEl.reset(this.dataNames),this.items[t].html("").child(e),this.updateFunc(t,e)):n.focus()}},{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:"deleteItem",value:function(){var t=this.activeEl,e=this.deleteEl;if(this.items.length>1){var n=this.items.findIndex((function(t){return t===e}));if(this.items.splice(n,1),this.dataNames.splice(n,1),this.menuEl.removeChild(e.el),this.moreEl.reset(this.dataNames),t===e){var r=ls(this.items,1)[0];return this.activeEl=r,this.activeEl.toggle(),[n,0]}return[n,-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}}]),t}();n(1);function Es(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(t)))return;var n=[],r=!0,i=!1,o=void 0;try{for(var a,l=t[Symbol.iterator]();!(r=(a=l.next()).done)&&(n.push(a.value),!e||n.length!==e);r=!0);}catch(t){i=!0,o=t}finally{try{r||null==l.return||l.return()}finally{if(i)throw o}}return n}(t,e)||function(t,e){if(!t)return;if("string"==typeof t)return js(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return js(t,e)}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function js(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function Rs(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function _s(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function As(t){var e=[],n=0;this.run=function(t){var r=this;this.startHandler(t,(function(){n--,t.timestm,t.isfinish,e.length>0&&r.run(e.shift())}))},this.startHandler=function(r,i){var o=this;r.isfinish?e.length>0&&this.run(e.shift()):0!=n?setTimeout((function(){return o.startHandler(r,i)}),300):(n++,r.timestm,r.isfinish,t(r,i))},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===n}}var Ts=function t(e,n,r,i){_s(this,t),this.item=e,this.url=n,this.callback=r,this.callbackerror=i,this.isfinish=!1,this.timestm="["+(new Date).getTime()+"] "};function Ps(t,e){var n=$.ajax({url:t.url,type:"post",dataType:"json",data:t.item});t.timestm,t.isfinish,n.done((function(n){t.timestm,t.callback&&(t.callback(n),t.isfinish=!0),e()})),n.fail((function(n,r,i){t.timestm,t.callbackerror&&(t.callbackerror(n,r,i),t.isfinish=!0),e()}))}var Ds=function(){function t(e){var n=this,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};_s(this,t);var i=e;this.options=r,this.sheetIndex=0,this.datas=[],this.uniqueid="",this.imageDiv=null,this.imageUrl=null,this.basicZorder=0,this.buffer=new As(Ps),"string"==typeof e&&(i=document.querySelector(e)),this.bottombar=new Cs((function(){if(n.uniqueid.endsWith(".csv"))Ct("Warning","CSV file does not support more than one worksheet");else if(n.uniqueid.endsWith(".tsv"))Ct("Warning","TSV file does not support more than one worksheet");else{var t=n.addSheet();t.showGrid=!0,n.sheet.resetData(t)}}),(function(t){var e=n.datas[t];e.scroll={ci:0,ri:0,riact:0,x:0,y:0,yact:0},n.sheet.resetData(e),n.resetPagination(e),n.sheet.verticalScrollbar.move({top:0})}),(function(){n.deleteSheet()}),(function(t,e){n.renameSheet(t,e)}),(function(t){var e=t*n.data.settings.row.len,r=n.data.rows.sumHeight(0,e);n.sheet.verticalScrollbar.move({top:r-1})}),this.options),this.isloading=!0,this.data=this.addSheet(),this.isloading=!1,this.resetPagination(this.data);var o=c("div","".concat(bt)).on("contextmenu",(function(t){return t.preventDefault()}));i.appendChild(o.el),this.sheet=new os(o,this.data),o.child(this.bottombar.el)}var e,n,r;return e=t,r=[{key:"locale",value:function(t,e){nt(t,e)}}],(n=[{key:"setImageInfo",value:function(t,e,n){return this.imageDiv=t,this.imageUrl=e,this.basicZorder=n,this}},{key:"addSheet",value:function(t){var e=this,n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],r=arguments.length>2?arguments[2]:void 0,i=arguments.length>3?arguments[3]:void 0,o=t||"sheet".concat(this.sheetIndex),a=new Ft(o,this.options);return a.change=function(){for(var t,n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];(t=e.sheet).trigger.apply(t,["change"].concat(r))},a.updateCellsData=function(t){var n=e.sheet.data,r=n.updateCellError,i=n.updateMyCells,o=e.uniqueid,a=e.imageUrl;t.Error?(t.cell&&(i.call(e.sheet.data,[t.cell]),e.reRender()),t.cells&&(i.call(e.sheet.data,t.cells),e.reRender()),r(t.Error)):"update"===t.op&&(t.data.forEach((function(t,n,r){for(var i=0,l=new Array;i<e.datas.length;i++)if(e.datas[i].name===t.name){e.datas[i].updateMyCells(t.cells),e.datas[i].updateShapes(t.shapes,l);break}e.sheet.data.updateShapeSrcToRefresh(o,a,t.pickey,l)})),e.reRender())},a.updateServerError=function(){for(var t,n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];(t=e.sheet).trigger.apply(t,["updateServerError"].concat(r))},a.updateCellError=function(){for(var t,n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];(t=e.sheet).trigger.apply(t,["updateCellError"].concat(r))},a.updateCellServer=function(t){var n=e.sheet.data,r=n.settings,i=n.updateServerError,o=n.updateCellsData,a=e.uniqueid,l=(e.showMask,e.closeMask,e.buffer);if("server"===r.updateMode){var c={p:JSON.stringify(t),uid:a,folderName:r.folderName,fileName:r.fileName};l.append(new Ts(c,r.updateUrl,(function(t){o(t)}),(function(t,e,n){i(t,e,n)})))}},a.loadImages=function(){var t=e.sheet.data.images,n=(e.uniqueid,e.imageDiv),r=(e.imageUrl,e.basicZorder);null!=t&&t.forEach((function(t){null==t.src?n.append('<img onload="this.removeAttribute(\'class\')" id="p_'+t.id+"_"+t.tick+'" class="resize-image"  alt="" style="position: absolute;top:'+t.top+"px;left:"+t.left+"px; z-index:"+(r+t.zorder)+";width: "+t.width+"px;height:"+t.height+'px">'):n.append('<img onload="this.removeAttribute(\'class\')" id="p_'+t.id+"_"+t.tick+'" src="'+t.src+'" class="resize-image"  alt="" style="position: absolute;top:'+t.top+"px;left:"+t.left+"px; z-index:"+(r+t.zorder)+";width: "+t.width+"px;height:"+t.height+'px">')}))},a.loadShapes=function(){var t=e.sheet.data.shapes,n=(e.uniqueid,e.imageDiv),r=(e.imageUrl,e.basicZorder);null!=t&&t.forEach((function(t){null==t.src?n.append('<img onload="this.removeAttribute(\'class\')" id="s_'+t.id+"_"+t.tick+'" class="resize-image"  alt="" style="position: absolute;top:'+t.top+"px;left:"+t.left+"px; z-index:"+(r+t.zorder)+";width: "+t.width+"px;height:"+t.height+'px">'):n.append('<img onload="this.removeAttribute(\'class\')" id="s_'+t.id+"_"+t.tick+'" src="'+t.src+'" class="resize-image"  alt="" style="position: absolute;top:'+t.top+"px;left:"+t.left+"px; z-index:"+(r+t.zorder)+";width: "+t.width+"px;height:"+t.height+'px">')}))},a.fillImageSrc=function(){var t=e.sheet.data,n=t.images,r=t.shapes,i=t.sheetid,o=t.isImageOk,a=e.uniqueid,l=(e.imageDiv,e.imageUrl);if(e.basicZorder,void 0===o&&void 0!==i&&(null!=r&&r.length>0||null!=n&&n.length>0)){var c=e;$.get(l+"?uid="+a+"&id="+i+"_batch.zip",(function(t){var e=new Array;null!=n&&n.forEach((function(t){if(null==t.src){var n={};n.id="p_"+t.id+"_"+t.tick,n.name=t.id+"."+t.tick,n.it=t,e.push(n)}})),null!=r&&r.forEach((function(t){if(null==t.src){var n={};n.id="s_"+t.id+"_"+t.tick,n.name=t.id+"."+t.tick,n.it=t,e.push(n)}})),c.sheet.data.fillImageOnebyOne(t,e),c.sheet.data.isImageOk=!0}))}},a.fillImageOnebyOne=function(t,e){var n=new XMLHttpRequest;n.onreadystatechange=function(){if(4==n.readyState){var t=n.response,r=new Uint8Array(t);JSZip.loadAsync(r).then((function(t){e.forEach((function(e,n,r){t.file(e.name).async("blob").then((function(t){var n=URL.createObjectURL(t);$("#"+e.id).attr("src",n),e.it.src=n}))}))}))}},n.open("GET",t,!0),n.responseType="arraybuffer",n.send()},a.loadConditionImage=function(){var t=e.sheet.data.conditionimg,n=e.imageDiv,r=e.basicZorder;t&&t.forEach((function(t){if(t.data){var e=a.createConditionImage(t,r);t.data=void 0,t.image=e,n.append(e)}else n.append(t.image)}))},a.reloadImagesShapes=function(){var t=e.imageDiv;null!=t&&(t.empty(),a.loadImages(),a.loadShapes(),a.loadConditionImage(),a.fillImageSrc())},this.datas.push(a),this.bottombar.addItem(o,n,r,i),this.sheetIndex+=1,this.isloading||this.sheet.data.addSheetOpr(o),a}},{key:"resetPagination",value:function(t){var e=t.rows.len,n=t.settings.row.len,r=e%n==0?e/n:Math.ceil(e/n);this.bottombar.addPagination(r)}},{key:"deleteSheet",value:function(){var t=Es(this.bottombar.deleteItem(),2),e=t[0],n=t[1];if(e>=0){var r=this.datas[e].name;this.sheet.data.delSheetOpr(r),this.datas.splice(e,1),n>=0&&this.sheet.resetData(this.datas[n])}}},{key:"renameSheet",value:function(t,e){var n=this.datas[t].name;this.datas[t].name=e,this.sheet.data.renameSheetOpr(n,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 n=0;n<e.length;n+=1){var r=e[n];this.addSheet(r.name,0===n,r.tabcolor,r.fontcolor).setData(r)}return this.isloading=!1,this}},{key:"getData",value:function(){return this.datas.map((function(t){return t.getData()}))}},{key:"cellText",value:function(t,e,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;return this.datas[r].setCellText(t,e,n,"finished"),this}},{key:"setActiveCell",value:function(t,e){return this.sheet.selector.set(t,e),this}},{key:"setActiveSheet",value:function(t){return this.bottombar.clickSwap2(this.bottombar.items[t]),this}},{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 n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return this.datas[n].getCell(t,e)}},{key:"cellStyle",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return this.datas[n].getCellStyle(t,e)}},{key:"reRender",value:function(){return this.sheet.table.render(),this}},{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:"showMask",value:function(){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)}},{key:"closeMask",value:function(){var t=document.getElementById("aspose_mask_bg");null!=t&&t.parentNode.removeChild(t)}}])&&Rs(e.prototype,n),r&&Rs(e,r),t}(),Is=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return new Ds(t,e)};window&&(window.x_spreadsheet=Is,window.x_spreadsheet.locale=function(t,e){return nt(t,e)});e.default=Ds}]);