diff --git a/.versions b/.versions index dc7666a..2c5499b 100644 --- a/.versions +++ b/.versions @@ -1,4 +1,4 @@ -awsp:handsontable@0.12.1 +awsp:handsontable@0.12.2 base64@1.0.3 binary-heap@1.0.3 callback-hook@1.0.3 @@ -9,7 +9,7 @@ geojson-utils@1.0.3 id-map@1.0.3 jquery@1.11.3_2 json@1.0.3 -local-test:awsp:handsontable@0.12.1 +local-test:awsp:handsontable@0.12.2 logging@1.0.7 meteor@1.1.6 minimongo@1.0.8 diff --git a/README.md b/README.md index bd3f72b..c229827 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@ -# Meteor Handsontable (@version 0.12.1) -This package uses the latest version of Handsontable (currently @version 0.20.1) in MeteorJS. +# Meteor Handsontable (@version 0.12.2) +This package uses the latest version of Handsontable (currently @version 0.20.2) in MeteorJS. ## Installation @@ -15,7 +15,7 @@ meteor add awsp:handsontable ## Important Notes -This package contains the latest yet slightly modified version of Handsontable (version 0.20.1). Minor change has been made to the UI as well. +This package contains the latest yet slightly modified version of Handsontable (version 0.20.2). Minor change has been made to the UI as well. The new version of Handsontable no longer necessary requires jQuery to work. In order to introduce the latest Handsontable to Meteor, a minimum of modification was made to Handsontable in this package to fix some of the conflicts when used in Meteor. @@ -77,6 +77,7 @@ For more details on usage and supported formulas, ## Release Notes +* Version 0.12.2 - Update Handsontable version to 0.20.2. * Version 0.12.1 - Update Handsontable version to 0.20.1. * Version 0.12.0 - Update Handsontable version to 0.20.0. * Version 0.11.0 - Update Handsontable version to 0.19.0. @@ -99,7 +100,7 @@ https://github.com/awsp/handsontable-meteor ## Versions Tracking -* Handsontable - 0.20.1 [Release Notes](https://github.com/handsontable/handsontable/releases) +* Handsontable - 0.20.2 [Release Notes](https://github.com/handsontable/handsontable/releases) * ruleJS - 0.0.5 diff --git a/bower.json b/bower.json index 12cf4e3..a17016a 100644 --- a/bower.json +++ b/bower.json @@ -1,7 +1,7 @@ { "name": "awsp:handsontable", "main": "package.js", - "version": "0.12.0", + "version": "0.12.2", "homepage": "https://github.com/awsp/handsontable-meteor", "authors": [ "awsp " @@ -21,6 +21,6 @@ "tests" ], "dependencies": { - "handsontable": "~0.20.1" + "handsontable": "~0.20.2" } } diff --git a/bower_components/handsontable/.bower.json b/bower_components/handsontable/.bower.json index e87f8e1..2aea777 100644 --- a/bower_components/handsontable/.bower.json +++ b/bower_components/handsontable/.bower.json @@ -1,7 +1,7 @@ { "name": "handsontable", "description": "Spreadsheet-like data grid editor that provides copy/paste functionality compatible with Excel/Google Docs", - "version": "0.20.1", + "version": "0.20.2", "main": [ "./dist/handsontable.js", "./dist/handsontable.css" @@ -46,13 +46,13 @@ "devDependencies": { "chroma-js": "~0.5.6" }, - "_release": "0.20.1", + "_release": "0.20.2", "_resolution": { "type": "version", - "tag": "0.20.1", - "commit": "ea60a6ba773981733b1ee0000b37a688956ca43a" + "tag": "0.20.2", + "commit": "c10835f033c78df9bc16013acda97fe8a880ee0f" }, "_source": "git://github.com/handsontable/handsontable.git", - "_target": "~0.20.1", + "_target": "~0.20.2", "_originalSource": "handsontable" } \ No newline at end of file diff --git a/bower_components/handsontable/bower.json b/bower_components/handsontable/bower.json index 0d65ac1..42d76a8 100644 --- a/bower_components/handsontable/bower.json +++ b/bower_components/handsontable/bower.json @@ -1,7 +1,7 @@ { "name": "handsontable", "description": "Spreadsheet-like data grid editor that provides copy/paste functionality compatible with Excel/Google Docs", - "version": "0.20.1", + "version": "0.20.2", "main": ["./dist/handsontable.js", "./dist/handsontable.css"], "homepage": "http://handsontable.com/", "repository": { diff --git a/bower_components/handsontable/dist/handsontable.full.js b/bower_components/handsontable/dist/handsontable.full.js index bfe7ab3..3c9c26a 100644 --- a/bower_components/handsontable/dist/handsontable.full.js +++ b/bower_components/handsontable/dist/handsontable.full.js @@ -1187,7 +1187,7 @@ var Walkontable = function Walkontable(settings) { } } else if (coords.col < fixedColumns) { return this.wtOverlays.leftOverlay.clone.wtTable.getCell(coords); - } else if (coords.row >= totalRows - fixedRowsBottom) { + } else if (coords.row > totalRows - fixedRowsBottom) { if (this.wtOverlays.bottomOverlay.clone) { return this.wtOverlays.bottomOverlay.clone.wtTable.getCell(coords); } @@ -1698,7 +1698,7 @@ var $WalkontableLeftOverlay = WalkontableLeftOverlay; } }, onScroll: function() { - this.wot.getSetting('onScrollHorizontally'); + this.wot.getSetting('onScrollVertically'); }, sumCellSizes: function(from, to) { var sum = 0; @@ -1881,7 +1881,7 @@ var $WalkontableTopOverlay = WalkontableTopOverlay; } }, onScroll: function() { - this.wot.getSetting('onScrollVertically'); + this.wot.getSetting('onScrollHorizontally'); }, sumCellSizes: function(from, to) { var sum = 0; @@ -2135,6 +2135,9 @@ var WalkontableOverlays = function WalkontableOverlays(wotInstance) { left: null } }; + this.verticalScrolling = false; + this.horizontalScrolling = false; + this.delegatedScrollCallback = false; this.registerListeners(); }; ($traceurRuntime.createClass)(WalkontableOverlays, { @@ -2147,8 +2150,14 @@ var WalkontableOverlays = function WalkontableOverlays(wotInstance) { return; } this.wot.draw(true); - this.topOverlay.onScroll(); - this.leftOverlay.onScroll(); + if (this.verticalScrolling) { + this.leftOverlay.onScroll(); + } + if (this.horizontalScrolling) { + this.topOverlay.onScroll(); + } + this.verticalScrolling = false; + this.horizontalScrolling = false; }, registerListeners: function() { var $__3 = this; @@ -2271,6 +2280,7 @@ var WalkontableOverlays = function WalkontableOverlays(wotInstance) { var topOverlay; var leftOverlay; var bottomOverlay; + var delegatedScroll = false; if (this.topOverlay.needFullRender) { topOverlay = this.topOverlay.clone.wtTable.holder; } @@ -2286,26 +2296,32 @@ var WalkontableOverlays = function WalkontableOverlays(wotInstance) { if (target === master) { tempScrollValue = getScrollLeft(target); if (this.overlayScrollPositions.master.left !== tempScrollValue) { + this.horizontalScrolling = true; this.overlayScrollPositions.master.left = tempScrollValue; scrollValueChanged = true; if (topOverlay) { topOverlay.scrollLeft = tempScrollValue; + delegatedScroll = (this.mainTableScrollableElement !== window); } if (bottomOverlay) { bottomOverlay.scrollLeft = tempScrollValue; + delegatedScroll = (this.mainTableScrollableElement !== window); } } tempScrollValue = getScrollTop(target); if (this.overlayScrollPositions.master.top !== tempScrollValue) { + this.verticalScrolling = true; this.overlayScrollPositions.master.top = tempScrollValue; scrollValueChanged = true; if (leftOverlay) { leftOverlay.scrollTop = tempScrollValue; + delegatedScroll = (this.mainTableScrollableElement !== window); } } } else if (target === bottomOverlay) { tempScrollValue = getScrollLeft(target); if (this.overlayScrollPositions.bottom.left !== tempScrollValue) { + this.horizontalScrolling = true; this.overlayScrollPositions.bottom.left = tempScrollValue; scrollValueChanged = true; master.scrollLeft = tempScrollValue; @@ -2317,6 +2333,7 @@ var WalkontableOverlays = function WalkontableOverlays(wotInstance) { } else if (target === topOverlay) { tempScrollValue = getScrollLeft(target); if (this.overlayScrollPositions.top.left !== tempScrollValue) { + this.horizontalScrolling = true; this.overlayScrollPositions.top.left = tempScrollValue; scrollValueChanged = true; master.scrollLeft = tempScrollValue; @@ -2328,6 +2345,7 @@ var WalkontableOverlays = function WalkontableOverlays(wotInstance) { } else if (target === leftOverlay) { tempScrollValue = getScrollTop(target); if (this.overlayScrollPositions.left.top !== tempScrollValue) { + this.verticalScrolling = true; this.overlayScrollPositions.left.top = tempScrollValue; scrollValueChanged = true; master.scrollTop = tempScrollValue; @@ -2338,7 +2356,14 @@ var WalkontableOverlays = function WalkontableOverlays(wotInstance) { } } if (!this.keyPressed && scrollValueChanged && event.type === 'scroll') { - this.refreshAll(); + if (this.delegatedScrollCallback) { + this.delegatedScrollCallback = false; + } else { + this.refreshAll(); + } + if (delegatedScroll) { + this.delegatedScrollCallback = true; + } } }, syncScrollWithMaster: function() { @@ -3823,9 +3848,9 @@ var domHelpers = ($__helpers_47_dom_47_element__ = require("helpers/dom/element" var domEventHelpers = ($__helpers_47_dom_47_event__ = require("helpers/dom/event"), $__helpers_47_dom_47_event__ && $__helpers_47_dom_47_event__.__esModule && $__helpers_47_dom_47_event__ || {default: $__helpers_47_dom_47_event__}); var HELPERS = [arrayHelpers, browserHelpers, dataHelpers, functionHelpers, mixedHelpers, numberHelpers, objectHelpers, settingHelpers, stringHelpers, unicodeHelpers]; var DOM = [domHelpers, domEventHelpers]; -Handsontable.buildDate = 'Thu Nov 19 2015 10:51:56 GMT+0100 (CET)'; +Handsontable.buildDate = 'Fri Dec 04 2015 11:56:12 GMT+0100 (CET)'; Handsontable.packageName = 'handsontable'; -Handsontable.version = '0.20.1'; +Handsontable.version = '0.20.2'; var baseVersion = '@@baseVersion'; if (!/^@@/.test(baseVersion)) { Handsontable.baseVersion = baseVersion; @@ -5518,6 +5543,9 @@ Handsontable.Core = function Core(rootElement, userSettings) { this.addHook = function(key, callback) { Handsontable.hooks.add(key, callback, instance); }; + this.hasHook = function(key) { + return Handsontable.hooks.has(key, instance); + }; this.addHookOnce = function(key, callback) { Handsontable.hooks.once(key, callback, instance); }; @@ -7796,6 +7824,9 @@ SelectEditor.prototype.init = function() { }; SelectEditor.prototype.registerHooks = function() { var $__5 = this; + this.instance.addHook('afterScrollHorizontally', (function() { + return $__5.refreshDimensions(); + })); this.instance.addHook('afterScrollVertically', (function() { return $__5.refreshDimensions(); })); @@ -8261,6 +8292,9 @@ TextEditor.prototype.bindEvents = function() { this.eventManager.addEventListener(this.TEXTAREA, 'paste', function(event) { stopPropagation(event); }); + this.instance.addHook('afterScrollHorizontally', function() { + editor.refreshDimensions(); + }); this.instance.addHook('afterScrollVertically', function() { editor.refreshDimensions(); }); @@ -9870,7 +9904,7 @@ function deepClone(obj) { function clone(object) { var result = {}; objectEach(object, (function(value, key) { - return result[key] = value; + result[key] = value; })); return result; } @@ -10019,6 +10053,12 @@ Object.defineProperties(exports, { isPercentValue: {get: function() { return isPercentValue; }}, + substitute: {get: function() { + return substitute; + }}, + padStart: {get: function() { + return padStart; + }}, __esModule: {value: true} }); var $__mixed__, @@ -10075,6 +10115,36 @@ function randomString() { function isPercentValue(value) { return /^([0-9][0-9]?\%$)|(^100\%$)/.test(value); } +function substitute(template) { + var variables = arguments[1] !== (void 0) ? arguments[1] : {}; + return (template + '').replace(/(?:\\)?\[([^\[\]]+)]/g, function(match, name) { + if (match.charAt(0) === '\\') { + return match.substr(1, match.length - 1); + } + return variables[name] === void 0 ? '' : variables[name]; + }); +} +function padStart(string, maxLength) { + var fillString = arguments[2] !== (void 0) ? arguments[2] : ' '; + string = string + ''; + if (string.length >= maxLength) { + return string; + } + fillString = String(fillString); + var fillStringLength = fillString.length; + if (!fillStringLength) { + fillString = ' '; + } + var fillLen = maxLength - string.length; + var timesToRepeat = Math.ceil(fillLen / fillString.length); + var truncatedString = ''; + rangeEach(timesToRepeat, (function(index) { + truncatedString += fillString; + })); + truncatedString = truncatedString.slice(0, fillLen); + return truncatedString + string; +} +; //# },{"mixed":48,"number":49}],53:[function(require,module,exports){ @@ -10273,7 +10343,7 @@ Object.defineProperties(exports, { }); var $__helpers_47_array__, $__helpers_47_object__; -var REGISTERED_HOOKS = ['afterCellMetaReset', 'afterChange', 'afterChangesObserved', 'afterColumnMove', 'afterColumnResize', 'afterContextMenuDefaultOptions', 'afterContextMenuHide', 'afterContextMenuShow', 'afterCopyLimit', 'afterCreateCol', 'afterCreateRow', 'afterDeselect', 'afterDestroy', 'afterDocumentKeyDown', 'afterGetCellMeta', 'afterGetColHeader', 'afterGetRowHeader', 'afterInit', 'afterIsMultipleSelectionCheck', 'afterLoadData', 'afterMomentumScroll', 'afterOnCellCornerMouseDown', 'afterOnCellMouseDown', 'afterOnCellMouseOver', 'afterRemoveCol', 'afterRemoveRow', 'afterRender', 'afterRenderer', 'afterScrollHorizontally', 'afterScrollVertically', 'afterSelection', 'afterSelectionByProp', 'afterSelectionEnd', 'afterSelectionEndByProp', 'afterSetCellMeta', 'afterUpdateSettings', 'afterValidate', 'beforeAutofill', 'beforeCellAlignment', 'beforeChange', 'beforeChangeRender', 'beforeDrawBorders', 'beforeGetCellMeta', 'beforeInit', 'beforeInitWalkontable', 'beforeKeyDown', 'beforeOnCellMouseDown', 'beforeRemoveCol', 'beforeRemoveRow', 'beforeRender', 'beforeSetRangeEnd', 'beforeTouchScroll', 'beforeValidate', 'construct', 'init', 'modifyCol', 'modifyColumnHeader', 'modifyColWidth', 'modifyRow', 'modifyRowHeader', 'modifyRowHeight', 'persistentStateLoad', 'persistentStateReset', 'persistentStateSave', 'beforeColumnSort', 'afterColumnSort', 'afterAutofillApplyValues', 'modifyCopyableRange', 'beforeColumnMove', 'afterColumnMove', 'beforeRowMove', 'afterRowMove', 'beforeColumnResize', 'afterColumnResize', 'beforeRowResize', 'afterRowResize']; +var REGISTERED_HOOKS = ['afterCellMetaReset', 'afterChange', 'afterChangesObserved', 'afterContextMenuDefaultOptions', 'afterContextMenuHide', 'afterContextMenuShow', 'afterCopyLimit', 'afterCreateCol', 'afterCreateRow', 'afterDeselect', 'afterDestroy', 'afterDocumentKeyDown', 'afterGetCellMeta', 'afterGetColHeader', 'afterGetRowHeader', 'afterInit', 'afterLoadData', 'afterMomentumScroll', 'afterOnCellCornerMouseDown', 'afterOnCellMouseDown', 'afterOnCellMouseOver', 'afterRemoveCol', 'afterRemoveRow', 'afterRender', 'afterRenderer', 'afterScrollHorizontally', 'afterScrollVertically', 'afterSelection', 'afterSelectionByProp', 'afterSelectionEnd', 'afterSelectionEndByProp', 'afterSetCellMeta', 'afterUpdateSettings', 'afterValidate', 'beforeAutofill', 'beforeCellAlignment', 'beforeChange', 'beforeChangeRender', 'beforeDrawBorders', 'beforeGetCellMeta', 'beforeInit', 'beforeInitWalkontable', 'beforeKeyDown', 'beforeOnCellMouseDown', 'beforeRemoveCol', 'beforeRemoveRow', 'beforeRender', 'beforeSetRangeEnd', 'beforeTouchScroll', 'beforeValidate', 'construct', 'init', 'modifyCol', 'modifyColHeader', 'modifyColWidth', 'modifyRow', 'modifyRowHeader', 'modifyRowHeight', 'persistentStateLoad', 'persistentStateReset', 'persistentStateSave', 'beforeColumnSort', 'afterColumnSort', 'afterAutofillApplyValues', 'modifyCopyableRange', 'beforeColumnMove', 'afterColumnMove', 'beforeRowMove', 'afterRowMove', 'beforeColumnResize', 'afterColumnResize', 'beforeRowResize', 'afterRowResize']; var arrayEach = ($__helpers_47_array__ = require("helpers/array"), $__helpers_47_array__ && $__helpers_47_array__.__esModule && $__helpers_47_array__ || {default: $__helpers_47_array__}).arrayEach; var objectEach = ($__helpers_47_object__ = require("helpers/object"), $__helpers_47_object__ && $__helpers_47_object__.__esModule && $__helpers_47_object__ || {default: $__helpers_47_object__}).objectEach; var Hooks = function Hooks() { @@ -11964,6 +12034,9 @@ var $Comments = Comments; this.addHook('afterRenderer', (function(TD, row, col, prop, value, cellProperties) { return $__6.onAfterRenderer(TD, cellProperties); })); + this.addHook('afterScrollHorizontally', (function() { + return $__6.refreshEditorPosition(); + })); this.addHook('afterScrollVertically', (function() { return $__6.refreshEditorPosition(); })); @@ -12343,7 +12416,10 @@ var $ContextMenu = ContextMenu; $__11.hot.runHooks('afterContextMenuDefaultOptions', predefinedItems); $__11.itemsFactory.setPredefinedItems(predefinedItems.items); var menuItems = $__11.itemsFactory.getVisibleItems(settings); - $__11.menu = new Menu($__11.hot, {className: 'htContextMenu'}); + $__11.menu = new Menu($__11.hot, { + className: 'htContextMenu', + keepInViewport: true + }); $__11.menu.setMenuItems(menuItems); $__11.menu.addLocalHook('afterOpen', (function() { return $__11.onMenuAfterOpen(); diff --git a/bower_components/handsontable/dist/handsontable.full.min.js b/bower_components/handsontable/dist/handsontable.full.min.js index 1ade626..f5b8466 100644 --- a/bower_components/handsontable/dist/handsontable.full.min.js +++ b/bower_components/handsontable/dist/handsontable.full.min.js @@ -24,26 +24,26 @@ TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -!function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var t;t="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this,t.Handsontable=e()}}(function(){var e;return function(e,t,n){return function o(e,t,n){function r(a,l){if(!t[a]){if(!e[a]){var u="function"==typeof require&&require;if(!l&&u)return u(a,!0);if(i)return i(a,!0);if(s[a]&&"undefined"!=typeof window[s[a]])return window[s[a]];var c=new Error("Cannot find module '"+a+"'");throw c.code="MODULE_NOT_FOUND",c}var d=t[a]={exports:{}};e[a][0].call(d.exports,function(t){var n=e[a][1][t];return r(n?n:t)},d,d.exports,o,e,t,n)}return t[a].exports}for(var i="function"==typeof require&&require,s=JSON.parse('{"zeroclipboard":"ZeroClipboard","moment":"moment","pikaday":"Pikaday"}')||{},a=0;a1)for(t=1,o=arguments.length;o>t;t++)r.push(arguments[t]);if(l){if("undefined"==typeof l[e])throw new Error("Handsontable do not provide action: "+e);i=l[e].apply(l,r),"destroy"===e&&a.removeData()}return i}}(window,jQuery,Handsontable)},{}],2:[function(e,t,n){"use strict";Object.defineProperties(n,{WalkontableBorder:{get:function(){return b}},__esModule:{value:!0}});var o,r,i,s,a,l=(o=e("helpers/dom/element"),o&&o.__esModule&&o||{"default":o}),u=l.getComputedStyle,c=l.getTrimmingContainer,d=l.innerWidth,h=l.innerHeight,f=l.offset,p=l.outerHeight,g=l.outerWidth,m=(r=e("helpers/dom/event"),r&&r.__esModule&&r||{"default":r}).stopImmediatePropagation,v=(i=e("eventManager"),i&&i.__esModule&&i||{"default":i}).EventManager,w=(s=e("cell/coords"),s&&s.__esModule&&s||{"default":s}).WalkontableCellCoords,y=(a=e("overlay/_base.js"),a&&a.__esModule&&a||{"default":a}).WalkontableOverlay,b=function(e,t){t&&(this.eventManager=new v(e),this.instance=e,this.wot=e,this.settings=t,this.mouseDown=!1,this.main=null,this.top=null,this.left=null,this.bottom=null,this.right=null,this.topStyle=null,this.leftStyle=null,this.bottomStyle=null,this.rightStyle=null,this.cornerDefaultStyle={width:"5px",height:"5px",borderWidth:"2px",borderStyle:"solid",borderColor:"#FFF"},this.corner=null,this.cornerStyle=null,this.createBorders(t),this.registerListeners())};$traceurRuntime.createClass(b,{registerListeners:function(){var e=this;this.eventManager.addEventListener(document.body,"mousedown",function(){return e.onMouseDown()}),this.eventManager.addEventListener(document.body,"mouseup",function(){return e.onMouseUp()});for(var t=this,n=function(n,o){t.eventManager.addEventListener(t.main.childNodes[n],"mouseenter",function(t){return e.onMouseEnter(t,e.main.childNodes[n])})},o=0,r=this.main.childNodes.length;r>o;o++)n(o,r)},onMouseDown:function(){this.mouseDown=!0},onMouseUp:function(){this.mouseDown=!1},onMouseEnter:function(e,t){function n(e){return e.clientYMath.ceil(i.top+i.height)?!0:e.clientXMath.ceil(i.left+i.width)?!0:void 0}function o(e){n(e)&&(r.eventManager.removeEventListener(document.body,"mousemove",o),t.style.display="block")}if(this.mouseDown&&this.wot.getSetting("hideBorderOnMouseDownOver")){e.preventDefault(),m(e);var r=this,i=t.getBoundingClientRect();t.style.display="none",this.eventManager.addEventListener(document.body,"mousemove",o)}},createBorders:function(e){this.main=document.createElement("div");var t=["top","left","bottom","right","corner"],n=this.main.style;n.position="absolute",n.top=0,n.left=0;for(var o=0;5>o;o++){var r=t[o],i=document.createElement("div");i.className="wtBorder "+(this.settings.className||""),this.settings[r]&&this.settings[r].hide&&(i.className+=" hidden"),n=i.style,n.backgroundColor=this.settings[r]&&this.settings[r].color?this.settings[r].color:e.border.color,n.height=this.settings[r]&&this.settings[r].width?this.settings[r].width+"px":e.border.width+"px",n.width=this.settings[r]&&this.settings[r].width?this.settings[r].width+"px":e.border.width+"px",this.main.appendChild(i)}this.top=this.main.childNodes[0],this.left=this.main.childNodes[1],this.bottom=this.main.childNodes[2],this.right=this.main.childNodes[3],this.topStyle=this.top.style,this.leftStyle=this.left.style,this.bottomStyle=this.bottom.style,this.rightStyle=this.right.style,this.corner=this.main.childNodes[4],this.corner.className+=" corner",this.cornerStyle=this.corner.style,this.cornerStyle.width=this.cornerDefaultStyle.width,this.cornerStyle.height=this.cornerDefaultStyle.height,this.cornerStyle.border=[this.cornerDefaultStyle.borderWidth,this.cornerDefaultStyle.borderStyle,this.cornerDefaultStyle.borderColor].join(" "),Handsontable.mobileBrowser&&this.createMultipleSelectorHandles(),this.disappear(),this.wot.wtTable.bordersHolder||(this.wot.wtTable.bordersHolder=document.createElement("div"),this.wot.wtTable.bordersHolder.className="htBorders",this.wot.wtTable.spreader.appendChild(this.wot.wtTable.bordersHolder)),this.wot.wtTable.bordersHolder.insertBefore(this.main,this.wot.wtTable.bordersHolder.firstChild)},createMultipleSelectorHandles:function(){this.selectionHandles={topLeft:document.createElement("DIV"),topLeftHitArea:document.createElement("DIV"),bottomRight:document.createElement("DIV"),bottomRightHitArea:document.createElement("DIV")};var e=10,t=40;this.selectionHandles.topLeft.className="topLeftSelectionHandle",this.selectionHandles.topLeftHitArea.className="topLeftSelectionHandle-HitArea",this.selectionHandles.bottomRight.className="bottomRightSelectionHandle",this.selectionHandles.bottomRightHitArea.className="bottomRightSelectionHandle-HitArea",this.selectionHandles.styles={topLeft:this.selectionHandles.topLeft.style,topLeftHitArea:this.selectionHandles.topLeftHitArea.style,bottomRight:this.selectionHandles.bottomRight.style,bottomRightHitArea:this.selectionHandles.bottomRightHitArea.style};var n={position:"absolute",height:t+"px",width:t+"px","border-radius":parseInt(t/1.5,10)+"px"};for(var o in n)n.hasOwnProperty(o)&&(this.selectionHandles.styles.bottomRightHitArea[o]=n[o],this.selectionHandles.styles.topLeftHitArea[o]=n[o]);var r={position:"absolute",height:e+"px",width:e+"px","border-radius":parseInt(e/1.5,10)+"px",background:"#F5F5FF",border:"1px solid #4285c8"};for(var i in r)r.hasOwnProperty(i)&&(this.selectionHandles.styles.bottomRight[i]=r[i],this.selectionHandles.styles.topLeft[i]=r[i]);this.main.appendChild(this.selectionHandles.topLeft),this.main.appendChild(this.selectionHandles.bottomRight),this.main.appendChild(this.selectionHandles.topLeftHitArea),this.main.appendChild(this.selectionHandles.bottomRightHitArea)},isPartRange:function(e,t){return!this.wot.selections.area.cellRange||e==this.wot.selections.area.cellRange.to.row&&t==this.wot.selections.area.cellRange.to.col?!1:!0},updateMultipleSelectionHandlesPosition:function(e,t,n,o,r,i){var s=parseInt(this.selectionHandles.styles.topLeft.width,10),a=parseInt(this.selectionHandles.styles.topLeftHitArea.width,10);this.selectionHandles.styles.topLeft.top=parseInt(n-s,10)+"px",this.selectionHandles.styles.topLeft.left=parseInt(o-s,10)+"px",this.selectionHandles.styles.topLeftHitArea.top=parseInt(n-a/4*3,10)+"px",this.selectionHandles.styles.topLeftHitArea.left=parseInt(o-a/4*3,10)+"px",this.selectionHandles.styles.bottomRight.top=parseInt(n+i,10)+"px",this.selectionHandles.styles.bottomRight.left=parseInt(o+r,10)+"px",this.selectionHandles.styles.bottomRightHitArea.top=parseInt(n+i-a/4,10)+"px",this.selectionHandles.styles.bottomRightHitArea.left=parseInt(o+r-a/4,10)+"px",this.settings.border.multipleSelectionHandlesVisible&&this.settings.border.multipleSelectionHandlesVisible()?(this.selectionHandles.styles.topLeft.display="block",this.selectionHandles.styles.topLeftHitArea.display="block",this.isPartRange(e,t)?(this.selectionHandles.styles.bottomRight.display="none",this.selectionHandles.styles.bottomRightHitArea.display="none"):(this.selectionHandles.styles.bottomRight.display="block",this.selectionHandles.styles.bottomRightHitArea.display="block")):(this.selectionHandles.styles.topLeft.display="none",this.selectionHandles.styles.bottomRight.display="none",this.selectionHandles.styles.topLeftHitArea.display="none",this.selectionHandles.styles.bottomRightHitArea.display="none"),e==this.wot.wtSettings.getSetting("fixedRowsTop")||t==this.wot.wtSettings.getSetting("fixedColumnsLeft")?(this.selectionHandles.styles.topLeft.zIndex="9999",this.selectionHandles.styles.topLeftHitArea.zIndex="9999"):(this.selectionHandles.styles.topLeft.zIndex="",this.selectionHandles.styles.topLeftHitArea.zIndex="")},appear:function(e){if(!this.disabled){var t,n,o,r,i,s,a,l,m,v,b,C,R,_,S,E,T,O,M;M=y.isOverlayTypeOf(this.wot.cloneOverlay,y.CLONE_TOP)||y.isOverlayTypeOf(this.wot.cloneOverlay,y.CLONE_TOP_LEFT_CORNER)?this.wot.getSetting("fixedRowsTop"):y.isOverlayTypeOf(this.wot.cloneOverlay,y.CLONE_BOTTOM)||y.isOverlayTypeOf(this.wot.cloneOverlay,y.CLONE_BOTTOM_LEFT_CORNER)?this.wot.getSetting("fixedRowsBottom"):this.wot.wtTable.getRenderedRowsCount();for(var k=0;M>k;k++){var H=this.wot.wtTable.rowFilter.renderedToSource(k);if(H>=e[0]&&H<=e[2]){R=H;break}}for(var D=M-1;D>=0;D--){var x=this.wot.wtTable.rowFilter.renderedToSource(D);if(x>=e[0]&&x<=e[2]){S=x;break}}M=this.wot.wtTable.getRenderedColumnsCount();for(var A=0;M>A;A++){var P=this.wot.wtTable.columnFilter.renderedToSource(A);if(P>=e[1]&&P<=e[3]){_=P;break}}for(var N=M-1;N>=0;N--){var L=this.wot.wtTable.columnFilter.renderedToSource(N);if(L>=e[1]&&L<=e[3]){E=L;break}}if(void 0===R||void 0===_)return void this.disappear();t=R!==S||_!==E,n=this.wot.wtTable.getCell(new w(R,_)),o=t?this.wot.wtTable.getCell(new w(S,E)):n,r=f(n),i=t?f(o):r,s=f(this.wot.wtTable.TABLE),l=r.top,b=i.top+p(o)-l,v=r.left,C=i.left+g(o)-v,a=l-s.top-1,m=v-s.left-1;var W=u(n);parseInt(W.borderTopWidth,10)>0&&(a+=1,b=b>0?b-1:0),parseInt(W.borderLeftWidth,10)>0&&(m+=1,C=C>0?C-1:0),this.topStyle.top=a+"px",this.topStyle.left=m+"px",this.topStyle.width=C+"px",this.topStyle.display="block",this.leftStyle.top=a+"px",this.leftStyle.left=m+"px",this.leftStyle.height=b+"px",this.leftStyle.display="block";var I=Math.floor(this.settings.border.width/2);this.bottomStyle.top=a+b-I+"px",this.bottomStyle.left=m+"px",this.bottomStyle.width=C+"px",this.bottomStyle.display="block",this.rightStyle.top=a+"px",this.rightStyle.left=m+C-I+"px",this.rightStyle.height=b+1+"px",this.rightStyle.display="block",Handsontable.mobileBrowser||!this.hasSetting(this.settings.border.cornerVisible)||this.isPartRange(S,E)?this.cornerStyle.display="none":(this.cornerStyle.top=a+b-4+"px",this.cornerStyle.left=m+C-4+"px",this.cornerStyle.borderRightWidth=this.cornerDefaultStyle.borderWidth,this.cornerStyle.width=this.cornerDefaultStyle.width,this.cornerStyle.display="block",T=c(this.wot.wtTable.TABLE),E===this.wot.getSetting("totalColumns")-1&&(O=o.offsetLeft+g(o)>=d(T),O&&(this.cornerStyle.left=Math.floor(m+C-3-parseInt(this.cornerDefaultStyle.width)/2)+"px",this.cornerStyle.borderRightWidth=0)),S===this.wot.getSetting("totalRows")-1&&(O=o.offsetTop+p(o)>=h(T),O&&(this.cornerStyle.top=Math.floor(a+b-3-parseInt(this.cornerDefaultStyle.height)/2)+"px",this.cornerStyle.borderBottomWidth=0))),Handsontable.mobileBrowser&&this.updateMultipleSelectionHandlesPosition(R,_,a,m,C,b)}},disappear:function(){this.topStyle.display="none",this.leftStyle.display="none",this.bottomStyle.display="none",this.rightStyle.display="none",this.cornerStyle.display="none",Handsontable.mobileBrowser&&(this.selectionHandles.styles.topLeft.display="none",this.selectionHandles.styles.bottomRight.display="none")},hasSetting:function(e){return"function"==typeof e?e():!!e}},{}),window.WalkontableBorder=b},{"cell/coords":5,eventManager:41,"helpers/dom/element":45,"helpers/dom/event":46,"overlay/_base.js":11}],3:[function(e,t,n){"use strict";Object.defineProperties(n,{WalkontableViewportColumnsCalculator:{get:function(){return r}},__esModule:{value:!0}});var o=new WeakMap,r=function(e,t,n,r,i,s,a){o.set(this,{viewportWidth:e,scrollOffset:t,totalColumns:n,columnWidthFn:r,overrideFn:i,onlyFullyVisible:s}),this.count=0,this.startColumn=null,this.endColumn=null,this.startPosition=null,this.stretchAllRatio=0,this.stretchLastWidth=0,this.stretch=a,this.totalTargetWidth=0,this.needVerifyLastColumnWidth=!0,this.stretchAllColumnsWidth=[],this.calculate()},i=r;$traceurRuntime.createClass(r,{calculate:function(){for(var e,t=0,n=!0,r=[],i=o.get(this),s=i.onlyFullyVisible,a=i.overrideFn,l=i.scrollOffset,u=i.totalColumns,c=i.viewportWidth,d=0;u>d;d++)if(e=this._getColumnWidth(d),l>=t&&!s&&(this.startColumn=d),t>=l&&l+c>=t+e&&(null==this.startColumn&&(this.startColumn=d),this.endColumn=d),r.push(t),t+=e,s||(this.endColumn=d),t>=l+c){n=!1;break}if(this.endColumn===u-1&&n)for(this.startColumn=this.endColumn;this.startColumn>0;){var h=r[this.endColumn]+e-r[this.startColumn-1];if((c>=h||!s)&&this.startColumn--,h>c)break}null!==this.startColumn&&a&&a(this),this.startPosition=r[this.startColumn],void 0==this.startPosition&&(this.startPosition=null),null!==this.startColumn&&(this.count=this.endColumn-this.startColumn+1)},refreshStretching:function(e){if("none"!==this.stretch){for(var t,n,r=0,i=o.get(this),s=i.totalColumns,a=0;s>a;a++)t=this._getColumnWidth(a),r+=t;this.totalTargetWidth=e,n=r-e,"all"===this.stretch&&0>n?(this.stretchAllRatio=e/r,this.stretchAllColumnsWidth=[],this.needVerifyLastColumnWidth=!0):"last"===this.stretch&&e!==1/0&&(this.stretchLastWidth=-n+this._getColumnWidth(s-1))}},getStretchedColumnWidth:function(e,t){var n=null;return"all"===this.stretch&&0!==this.stretchAllRatio?n=this._getStretchedAllColumnWidth(e,t):"last"===this.stretch&&0!==this.stretchLastWidth&&(n=this._getStretchedLastColumnWidth(e)),n},_getStretchedAllColumnWidth:function(e,t){var n=0,r=o.get(this),i=r.totalColumns;if(this.stretchAllColumnsWidth[e]||(this.stretchAllColumnsWidth[e]=Math.round(t*this.stretchAllRatio)),this.stretchAllColumnsWidth.length===i&&this.needVerifyLastColumnWidth){this.needVerifyLastColumnWidth=!1;for(var s=0;sf;f++){var p=l(f);if(void 0===p&&(p=i.DEFAULT_HEIGHT),u>=e&&!s&&(this.startRow=f),e>=u&&u+d-h>=e+p&&(null===this.startRow&&(this.startRow=f),this.endRow=f),n.push(e),e+=p,s||(this.endRow=f),e>=u+d-h){t=!1;break}}if(this.endRow===c-1&&t)for(this.startRow=this.endRow;this.startRow>0;){var g=n[this.endRow]+p-n[this.startRow-1];if((d-h>=g||!s)&&this.startRow--,g>=d-h)break}null!==this.startRow&&a&&a(this),this.startPosition=n[this.startRow],void 0==this.startPosition&&(this.startPosition=null),null!==this.startRow&&(this.count=this.endRow-this.startRow+1)}},{get DEFAULT_HEIGHT(){return 23}}),window.WalkontableViewportRowsCalculator=r},{}],5:[function(e,t,n){"use strict";Object.defineProperties(n,{WalkontableCellCoords:{get:function(){return o}},__esModule:{value:!0}});var o=function(e,t){"undefined"!=typeof e&&"undefined"!=typeof t?(this.row=e,this.col=t):(this.row=null,this.col=null)};$traceurRuntime.createClass(o,{isValid:function(e){return this.row<0||this.col<0?!1:this.row>=e.getSetting("totalRows")||this.col>=e.getSetting("totalColumns")?!1:!0},isEqual:function(e){return e===this?!0:this.row===e.row&&this.col===e.col},isSouthEastOf:function(e){return this.row>=e.row&&this.col>=e.col},isNorthWestOf:function(e){return this.row<=e.row&&this.col<=e.col},isSouthWestOf:function(e){return this.row>=e.row&&this.col<=e.col},isNorthEastOf:function(e){return this.row<=e.row&&this.col>=e.col}},{}),window.WalkontableCellCoords=o},{}],6:[function(e,t,n){"use strict";Object.defineProperties(n,{WalkontableCellRange:{get:function(){return i}},__esModule:{value:!0}});var o,r=(o=e("cell/coords"),o&&o.__esModule&&o||{"default":o}).WalkontableCellCoords,i=function(e,t,n){this.highlight=e,this.from=t,this.to=n},s=i;$traceurRuntime.createClass(i,{isValid:function(e){return this.from.isValid(e)&&this.to.isValid(e)},isSingle:function(){return this.from.row===this.to.row&&this.from.col===this.to.col},getHeight:function(){return Math.max(this.from.row,this.to.row)-Math.min(this.from.row,this.to.row)+1},getWidth:function(){return Math.max(this.from.col,this.to.col)-Math.min(this.from.col,this.to.col)+1},includes:function(e){var t=this.getTopLeftCorner(),n=this.getBottomRightCorner();return e.row<0&&(e.row=0),e.col<0&&(e.col=0),t.row<=e.row&&n.row>=e.row&&t.col<=e.col&&n.col>=e.col},includesRange:function(e){return this.includes(e.getTopLeftCorner())&&this.includes(e.getBottomRightCorner())},isEqual:function(e){return Math.min(this.from.row,this.to.row)==Math.min(e.from.row,e.to.row)&&Math.max(this.from.row,this.to.row)==Math.max(e.from.row,e.to.row)&&Math.min(this.from.col,this.to.col)==Math.min(e.from.col,e.to.col)&&Math.max(this.from.col,this.to.col)==Math.max(e.from.col,e.to.col)},overlaps:function(e){return e.isSouthEastOf(this.getTopLeftCorner())&&e.isNorthWestOf(this.getBottomRightCorner())},isSouthEastOf:function(e){return this.getTopLeftCorner().isSouthEastOf(e)||this.getBottomRightCorner().isSouthEastOf(e)},isNorthWestOf:function(e){return this.getTopLeftCorner().isNorthWestOf(e)||this.getBottomRightCorner().isNorthWestOf(e)},expand:function(e){var t=this.getTopLeftCorner(),n=this.getBottomRightCorner();return e.rown.row||e.col>n.col?(this.from=new r(Math.min(t.row,e.row),Math.min(t.col,e.col)),this.to=new r(Math.max(n.row,e.row),Math.max(n.col,e.col)),!0):!1},expandByRange:function(e){if(this.includesRange(e)||!this.overlaps(e))return!1;var t=this.getTopLeftCorner(),n=this.getBottomRightCorner(),o=(this.getTopRightCorner(),this.getBottomLeftCorner(),e.getTopLeftCorner()),i=e.getBottomRightCorner(),a=Math.min(t.row,o.row),l=Math.min(t.col,o.col),u=Math.max(n.row,i.row),c=Math.max(n.col,i.col),d=new r(a,l),h=new r(u,c),f=new s(d,d,h).isCorner(this.from,e),p=e.isEqual(new s(d,d,h));return f&&!p&&(this.from.col>d.col&&(d.col=c,h.col=l),this.from.row>d.row&&(d.row=u,h.row=a)),this.from=d,this.to=h,!0},getDirection:function(){return this.from.isNorthWestOf(this.to)?"NW-SE":this.from.isNorthEastOf(this.to)?"NE-SW":this.from.isSouthEastOf(this.to)?"SE-NW":this.from.isSouthWestOf(this.to)?"SW-NE":void 0},setDirection:function(e){switch(e){case"NW-SE":this.from=this.getTopLeftCorner(),this.to=this.getBottomRightCorner();break;case"NE-SW":this.from=this.getTopRightCorner(),this.to=this.getBottomLeftCorner();break;case"SE-NW":this.from=this.getBottomRightCorner(),this.to=this.getTopLeftCorner();break;case"SW-NE":this.from=this.getBottomLeftCorner(),this.to=this.getTopRightCorner()}},getTopLeftCorner:function(){return new r(Math.min(this.from.row,this.to.row),Math.min(this.from.col,this.to.col))},getBottomRightCorner:function(){return new r(Math.max(this.from.row,this.to.row),Math.max(this.from.col,this.to.col))},getTopRightCorner:function(){return new r(Math.min(this.from.row,this.to.row),Math.max(this.from.col,this.to.col))},getBottomLeftCorner:function(){return new r(Math.max(this.from.row,this.to.row),Math.min(this.from.col,this.to.col))},isCorner:function(e,t){return t&&t.includes(e)&&(this.getTopLeftCorner().isEqual(new r(t.from.row,t.from.col))||this.getTopRightCorner().isEqual(new r(t.from.row,t.to.col))||this.getBottomLeftCorner().isEqual(new r(t.to.row,t.from.col))||this.getBottomRightCorner().isEqual(new r(t.to.row,t.to.col)))?!0:e.isEqual(this.getTopLeftCorner())||e.isEqual(this.getTopRightCorner())||e.isEqual(this.getBottomLeftCorner())||e.isEqual(this.getBottomRightCorner())},getOppositeCorner:function(e,t){if(!(e instanceof r))return!1;if(t&&t.includes(e)){if(this.getTopLeftCorner().isEqual(new r(t.from.row,t.from.col)))return this.getBottomRightCorner();if(this.getTopRightCorner().isEqual(new r(t.from.row,t.to.col)))return this.getBottomLeftCorner();if(this.getBottomLeftCorner().isEqual(new r(t.to.row,t.from.col)))return this.getTopRightCorner();if(this.getBottomRightCorner().isEqual(new r(t.to.row,t.to.col)))return this.getTopLeftCorner()}return e.isEqual(this.getBottomRightCorner())?this.getTopLeftCorner():e.isEqual(this.getTopLeftCorner())?this.getBottomRightCorner():e.isEqual(this.getTopRightCorner())?this.getBottomLeftCorner():e.isEqual(this.getBottomLeftCorner())?this.getTopRightCorner():void 0},getBordersSharedWith:function(e){if(!this.includesRange(e))return[];var t={top:Math.min(this.from.row,this.to.row),bottom:Math.max(this.from.row,this.to.row),left:Math.min(this.from.col,this.to.col),right:Math.max(this.from.col,this.to.col)},n={top:Math.min(e.from.row,e.to.row),bottom:Math.max(e.from.row,e.to.row),left:Math.min(e.from.col,e.to.col),right:Math.max(e.from.col,e.to.col)},o=[];return t.top==n.top&&o.push("top"),t.right==n.right&&o.push("right"),t.bottom==n.bottom&&o.push("bottom"),t.left==n.left&&o.push("left"),o},getInner:function(){for(var e=this.getTopLeftCorner(),t=this.getBottomRightCorner(),n=[],o=e.row;o<=t.row;o++)for(var i=e.col;i<=t.col;i++)this.from.row===o&&this.from.col===i||this.to.row===o&&this.to.col===i||n.push(new r(o,i));return n},getAll:function(){for(var e=this.getTopLeftCorner(),t=this.getBottomRightCorner(),n=[],o=e.row;o<=t.row;o++)for(var i=e.col;i<=t.col;i++)e.row===o&&e.col===i?n.push(e):t.row===o&&t.col===i?n.push(t):n.push(new r(o,i));return n},forAll:function(e){for(var t=this.getTopLeftCorner(),n=this.getBottomRightCorner(),o=t.row;o<=n.row;o++)for(var r=t.col;r<=n.col;r++){var i=e(o,r);if(i===!1)return}}},{}),window.WalkontableCellRange=i},{"cell/coords":5}],7:[function(e,t,n){"use strict";Object.defineProperties(n,{Walkontable:{get:function(){return x}},__esModule:{value:!0}});var o,r,i,s,a,l,u,c,d,h,f,p,g,m,v=(o=e("helpers/dom/element"),o&&o.__esModule&&o||{"default":o}),w=v.addClass,y=v.fastInnerText,b=v.isVisible,C=v.removeClass,R=(r=e("helpers/object"),r&&r.__esModule&&r||{"default":r}).objectEach,_=(i=e("helpers/string"),i&&i.__esModule&&i||{"default":i}),S=_.toUpperCaseFirst,E=_.randomString,T=(s=e("event"),s&&s.__esModule&&s||{"default":s}).WalkontableEvent,O=(a=e("overlays"),a&&a.__esModule&&a||{"default":a}).WalkontableOverlays,M=(l=e("scroll"),l&&l.__esModule&&l||{"default":l}).WalkontableScroll,k=(u=e("settings"),u&&u.__esModule&&u||{"default":u}).WalkontableSettings,H=(c=e("table"),c&&c.__esModule&&c||{"default":c}).WalkontableTable,D=(d=e("viewport"),d&&d.__esModule&&d||{"default":d}).WalkontableViewport,x=((h=e("overlay/_base.js"),h&&h.__esModule&&h||{"default":h}).WalkontableOverlay,(f=e("overlay/top.js"),f&&f.__esModule&&f||{"default":f}).WalkontableTopOverlay,(p=e("overlay/left.js"),p&&p.__esModule&&p||{"default":p}).WalkontableLeftOverlay,(g=e("overlay/debug.js"),g&&g.__esModule&&g||{"default":g}).WalkontableDebugOverlay,(m=e("overlay/topLeftCorner.js"),m&&m.__esModule&&m||{"default":m}).WalkontableTopLeftCornerOverlay,function(e){var t=[];if(this.guid="wt_"+E(),e.cloneSource?(this.cloneSource=e.cloneSource,this.cloneOverlay=e.cloneOverlay,this.wtSettings=e.cloneSource.wtSettings,this.wtTable=new H(this,e.table,e.wtRootElement),this.wtScroll=new M(this),this.wtViewport=e.cloneSource.wtViewport,this.wtEvent=new T(this),this.selections=this.cloneSource.selections):(this.wtSettings=new k(this,e),this.wtTable=new H(this,e.table),this.wtScroll=new M(this),this.wtViewport=new D(this),this.wtEvent=new T(this),this.selections=this.getSetting("selections"),this.wtOverlays=new O(this),this.exportSettingsAsClassNames()),this.wtTable.THEAD.childNodes.length&&this.wtTable.THEAD.childNodes[0].childNodes.length){for(var n=0,o=this.wtTable.THEAD.childNodes[0].childNodes.length;o>n;n++)t.push(this.wtTable.THEAD.childNodes[0].childNodes[n].innerHTML);this.getSetting("columnHeaders").length||this.update("columnHeaders",[function(e,n){y(n,t[e])}])}this.drawn=!1,this.drawInterrupted=!1});$traceurRuntime.createClass(x,{draw:function(){var e=void 0!==arguments[0]?arguments[0]:!1;return this.drawInterrupted=!1,e||b(this.wtTable.TABLE)?this.wtTable.draw(e):this.drawInterrupted=!0,this},getCell:function(e){var t=void 0!==arguments[1]?arguments[1]:!1;if(!t)return this.wtTable.getCell(e);var n=this.wtSettings.getSetting("totalRows"),o=this.wtSettings.getSetting("fixedRowsTop"),r=this.wtSettings.getSetting("fixedRowsBottom"),i=this.wtSettings.getSetting("fixedColumnsLeft");if(e.row=n-r){if(this.wtOverlays.bottomLeftCornerOverlay.clone)return this.wtOverlays.bottomLeftCornerOverlay.clone.wtTable.getCell(e)}else{if(e.col=n-r&&this.wtOverlays.bottomOverlay.clone)return this.wtOverlays.bottomOverlay.clone.wtTable.getCell(e)}return this.wtTable.getCell(e)},update:function(e,t){return this.wtSettings.update(e,t)},scrollVertical:function(e){return this.wtOverlays.topOverlay.scrollTo(e),this.getSetting("onScrollVertically"),this},scrollHorizontal:function(e){return this.wtOverlays.leftOverlay.scrollTo(e),this.getSetting("onScrollHorizontally"),this},scrollViewport:function(e){return this.wtScroll.scrollViewport(e),this},getViewport:function(){return[this.wtTable.getFirstVisibleRow(),this.wtTable.getFirstVisibleColumn(),this.wtTable.getLastVisibleRow(),this.wtTable.getLastVisibleColumn()]},getOverlayName:function(){return this.cloneOverlay?this.cloneOverlay.type:"master"},exportSettingsAsClassNames:function(){var e=this,t={rowHeaders:["array"],columnHeaders:["array"]},n=[],o=[];R(t,function(t,r){t.indexOf("array")>-1&&e.getSetting(r).length&&o.push("ht"+S(r)),n.push("ht"+S(r))}),C(this.wtTable.wtRootElement.parentNode,n),w(this.wtTable.wtRootElement.parentNode,o)},getSetting:function(e,t,n,o,r){return this.wtSettings.getSetting(e,t,n,o,r)},hasSetting:function(e){return this.wtSettings.has(e)},destroy:function(){this.wtOverlays.destroy(),this.wtEvent.destroy()}},{}),window.Walkontable=x},{event:8,"helpers/dom/element":45,"helpers/object":50,"helpers/string":52,"overlay/_base.js":11,"overlay/debug.js":12,"overlay/left.js":13,"overlay/top.js":14,"overlay/topLeftCorner.js":15,overlays:16,scroll:17,settings:19,table:20,viewport:22}],8:[function(e,t,n){"use strict";function o(e){var t=this,n=c(e);this.instance=e;var o=[null,null];this.dblClickTimeout=[null,null];var r,i,s=function(e){var n=t.parentCell(e.realTarget);l(e.realTarget,"corner")?t.instance.getSetting("onCellCornerMouseDown",e,e.realTarget):n.TD&&t.instance.hasSetting("onCellMouseDown")&&t.instance.getSetting("onCellMouseDown",e,n.coords,n.TD,t.instance),2!==e.button&&n.TD&&(o[0]=n.TD,clearTimeout(t.dblClickTimeout[0]),t.dblClickTimeout[0]=setTimeout(function(){o[0]=null},1e3))},d=function(e){t.instance.touchMoving=!0},h=function(e){n.addEventListener(this,"touchmove",d),t.checkIfTouchMove=setTimeout(function(){return t.instance.touchMoving===!0?(t.instance.touchMoving=void 0,void n.removeEventListener("touchmove",d,!1)):void s(e)},30)},f=function(e){var n,o;t.instance.hasSetting("onCellMouseOver")&&(n=t.instance.wtTable.TABLE,o=a(e.realTarget,["TD","TH"],n),o&&o!==i&&u(o,n)&&(i=o,t.instance.getSetting("onCellMouseOver",e,t.instance.wtTable.getCoords(o),o,t.instance)))},p=function(e){if(2!==e.button){var n=t.parentCell(e.realTarget);n.TD===o[0]&&n.TD===o[1]?(l(e.realTarget,"corner")?t.instance.getSetting("onCellCornerDblClick",e,n.coords,n.TD,t.instance):t.instance.getSetting("onCellDblClick",e,n.coords,n.TD,t.instance),o[0]=null,o[1]=null):n.TD===o[0]&&(o[1]=n.TD,clearTimeout(t.dblClickTimeout[1]),t.dblClickTimeout[1]=setTimeout(function(){o[1]=null},500))}},g=function(e){clearTimeout(r),e.preventDefault(),p(e)};if(n.addEventListener(this.instance.wtTable.holder,"mousedown",s),n.addEventListener(this.instance.wtTable.TABLE,"mouseover",f),n.addEventListener(this.instance.wtTable.holder,"mouseup",p),this.instance.wtTable.holder.parentNode.parentNode&&Handsontable.mobileBrowser&&!t.instance.wtTable.isWorkingOnClone()){var m="."+this.instance.wtTable.holder.parentNode.className.split(" ").join(".");n.addEventListener(this.instance.wtTable.holder,"touchstart",function(e){t.instance.touchApplied=!0,u(e.target,m)&&h.call(e.target,e)}),n.addEventListener(this.instance.wtTable.holder,"touchend",function(e){t.instance.touchApplied=!1,u(e.target,m)&&g.call(e.target,e)}),t.instance.momentumScrolling||(t.instance.momentumScrolling={}),n.addEventListener(this.instance.wtTable.holder,"scroll",function(e){clearTimeout(t.instance.momentumScrolling._timeout),t.instance.momentumScrolling.ongoing||t.instance.getSetting("onBeforeTouchScroll"),t.instance.momentumScrolling.ongoing=!0,t.instance.momentumScrolling._timeout=setTimeout(function(){t.instance.touchApplied||(t.instance.momentumScrolling.ongoing=!1,t.instance.getSetting("onAfterMomentumScroll"))},200)})}n.addEventListener(window,"resize",function(){"none"!==t.instance.getSetting("stretchH")&&t.instance.draw()}),this.destroy=function(){clearTimeout(this.dblClickTimeout[0]),clearTimeout(this.dblClickTimeout[1]),n.destroy()}}Object.defineProperties(n,{WalkontableEvent:{get:function(){return o}},__esModule:{value:!0}});var r,i,s=(r=e("helpers/dom/element"),r&&r.__esModule&&r||{"default":r}),a=s.closest,l=s.hasClass,u=s.isChildOf,c=(i=e("eventManager"),i&&i.__esModule&&i||{"default":i}).eventManager;o.prototype.parentCell=function(e){var t={},n=this.instance.wtTable.TABLE,o=a(e,["TD","TH"],n);return o&&u(o,n)?(t.coords=this.instance.wtTable.getCoords(o),t.TD=o):l(e,"wtBorder")&&l(e,"current")?(t.coords=this.instance.selections.current.cellRange.highlight,t.TD=this.instance.wtTable.getCell(t.coords)):l(e,"wtBorder")&&l(e,"area")&&this.instance.selections.area.cellRange&&(t.coords=this.instance.selections.area.cellRange.to,t.TD=this.instance.wtTable.getCell(t.coords)),t},window.WalkontableEvent=o},{eventManager:41,"helpers/dom/element":45}],9:[function(e,t,n){"use strict";Object.defineProperties(n,{WalkontableColumnFilter:{get:function(){return o}},__esModule:{value:!0}});var o=function(e,t,n){this.offset=e,this.total=t,this.countTH=n};$traceurRuntime.createClass(o,{offsetted:function(e){return e+this.offset},unOffsetted:function(e){return e-this.offset},renderedToSource:function(e){return this.offsetted(e)},sourceToRendered:function(e){return this.unOffsetted(e)},offsettedTH:function(e){return e-this.countTH},unOffsettedTH:function(e){return e+this.countTH},visibleRowHeadedColumnToSourceColumn:function(e){return this.renderedToSource(this.offsettedTH(e))},sourceColumnToVisibleRowHeadedColumn:function(e){return this.unOffsettedTH(this.sourceToRendered(e))}},{}),window.WalkontableColumnFilter=o; -},{}],10:[function(e,t,n){"use strict";Object.defineProperties(n,{WalkontableRowFilter:{get:function(){return o}},__esModule:{value:!0}});var o=function(e,t,n){this.offset=e,this.total=t,this.countTH=n};$traceurRuntime.createClass(o,{offsetted:function(e){return e+this.offset},unOffsetted:function(e){return e-this.offset},renderedToSource:function(e){return this.offsetted(e)},sourceToRendered:function(e){return this.unOffsetted(e)},offsettedTH:function(e){return e-this.countTH},unOffsettedTH:function(e){return e+this.countTH},visibleColHeadedRowToSourceRow:function(e){return this.renderedToSource(this.offsettedTH(e))},sourceRowToVisibleColHeadedRow:function(e){return this.unOffsettedTH(this.sourceToRendered(e))}},{}),window.WalkontableRowFilter=o},{}],11:[function(e,t,n){"use strict";Object.defineProperties(n,{WalkontableOverlay:{get:function(){return h}},__esModule:{value:!0}});var o,r,i,s=(o=e("helpers/dom/element"),o&&o.__esModule&&o||{"default":o}),a=s.getScrollableElement,l=s.getTrimmingContainer,u=(r=e("helpers/object"),r&&r.__esModule&&r||{"default":r}).defineGetter,c=(i=e("eventManager"),i&&i.__esModule&&i||{"default":i}).eventManager,d={},h=function(e){u(this,"wot",e,{writable:!1}),this.instance=this.wot,this.type="",this.TABLE=this.wot.wtTable.TABLE,this.hider=this.wot.wtTable.hider,this.spreader=this.wot.wtTable.spreader,this.holder=this.wot.wtTable.holder,this.wtRootElement=this.wot.wtTable.wtRootElement,this.trimmingContainer=l(this.hider.parentNode.parentNode),this.mainTableScrollableElement=a(this.wot.wtTable.TABLE),this.needFullRender=this.shouldBeRendered(),this.areElementSizesAdjusted=!1},f=h;$traceurRuntime.createClass(h,{shouldBeRendered:function(){return!0},makeClone:function(e){if(-1===f.CLONE_TYPES.indexOf(e))throw new Error('Clone type "'+e+'" is not supported.');var t=document.createElement("DIV"),n=document.createElement("TABLE");return t.className="ht_clone_"+e+" handsontable",t.style.position="absolute",t.style.top=0,t.style.left=0,t.style.overflow="hidden",n.className=this.wot.wtTable.TABLE.className,t.appendChild(n),this.type=e,this.wot.wtTable.wtRootElement.parentNode.appendChild(t),new Walkontable({cloneSource:this.wot,cloneOverlay:this,table:n})},refresh:function(){var e=void 0!==arguments[0]?arguments[0]:!1,t=this.shouldBeRendered();this.clone&&(this.needFullRender||t)&&this.clone.draw(e),this.needFullRender=t},destroy:function(){c(this.clone).destroy()}},{get CLONE_TOP(){return"top"},get CLONE_BOTTOM(){return"bottom"},get CLONE_LEFT(){return"left"},get CLONE_TOP_LEFT_CORNER(){return"top_left_corner"},get CLONE_BOTTOM_LEFT_CORNER(){return"bottom_left_corner"},get CLONE_DEBUG(){return"debug"},get CLONE_TYPES(){return[f.CLONE_TOP,f.CLONE_BOTTOM,f.CLONE_LEFT,f.CLONE_TOP_LEFT_CORNER,f.CLONE_BOTTOM_LEFT_CORNER,f.CLONE_DEBUG]},registerOverlay:function(e,t){if(-1===f.CLONE_TYPES.indexOf(e))throw new Error("Unsupported overlay ("+e+").");d[e]=t},createOverlay:function(e,t){return new d[e](t)},isOverlayTypeOf:function(e,t){return e&&d[t]?e instanceof d[t]:!1}}),window.WalkontableOverlay=h},{eventManager:41,"helpers/dom/element":45,"helpers/object":50}],12:[function(e,t,n){"use strict";Object.defineProperties(n,{WalkontableDebugOverlay:{get:function(){return a}},__esModule:{value:!0}});var o,r,i=(o=e("helpers/dom/element"),o&&o.__esModule&&o||{"default":o}).addClass,s=(r=e("_base"),r&&r.__esModule&&r||{"default":r}).WalkontableOverlay,a=function(e){$traceurRuntime.superConstructor(l).call(this,e),this.clone=this.makeClone(s.CLONE_DEBUG),this.clone.wtTable.holder.style.opacity=.4,this.clone.wtTable.holder.style.textShadow="0 0 2px #ff0000",i(this.clone.wtTable.holder.parentNode,"wtDebugVisible")},l=a;$traceurRuntime.createClass(a,{},{},s),window.WalkontableDebugOverlay=a,s.registerOverlay(s.CLONE_DEBUG,a)},{_base:11,"helpers/dom/element":45}],13:[function(e,t,n){"use strict";Object.defineProperties(n,{WalkontableLeftOverlay:{get:function(){return g}},__esModule:{value:!0}});var o,r,i=(o=e("helpers/dom/element"),o&&o.__esModule&&o||{"default":o}),s=i.addClass,a=i.getScrollbarWidth,l=i.getScrollLeft,u=i.getWindowScrollTop,c=i.hasClass,d=i.outerWidth,h=i.removeClass,f=i.setOverlayPosition,p=(r=e("_base"),r&&r.__esModule&&r||{"default":r}).WalkontableOverlay,g=function(e){$traceurRuntime.superConstructor(m).call(this,e),this.clone=this.makeClone(p.CLONE_LEFT)},m=g;$traceurRuntime.createClass(g,{shouldBeRendered:function(){return this.wot.getSetting("fixedColumnsLeft")||this.wot.getSetting("rowHeaders").length?!0:!1},resetFixedPosition:function(){if(this.needFullRender&&this.wot.wtTable.holder.parentNode){var e=this.clone.wtTable.holder.parentNode,t=0;if(this.trimmingContainer===window){var n,o,r=this.wot.wtTable.hider.getBoundingClientRect(),i=Math.ceil(r.left),s=Math.ceil(r.right);o=this.wot.wtTable.hider.style.top,o=""===o?0:o,n=0>i&&s-e.offsetWidth>0?-i:0,t=n,n+="px",f(e,n,o)}else t=this.getScrollPosition();this.adjustHeaderBordersPosition(t),this.adjustElementsSize()}},setScrollPosition:function(e){this.mainTableScrollableElement===window?window.scrollTo(e,u()):this.mainTableScrollableElement.scrollLeft=e},onScroll:function(){this.wot.getSetting("onScrollHorizontally")},sumCellSizes:function(e,t){for(var n=0,o=this.wot.wtSettings.defaultColumnWidth;t>e;)n+=this.wot.wtTable.getStretchedColumnWidth(e)||o,e++;return n},adjustElementsSize:function(){var e=void 0!==arguments[0]?arguments[0]:!1;(this.needFullRender||e)&&(this.adjustRootElementSize(),this.adjustRootChildrenSize(),e||(this.areElementSizesAdjusted=!0))},adjustRootElementSize:function(){var e,t=this.wot.wtTable.holder,n=t.clientHeight===t.offsetHeight?0:a(),o=this.clone.wtTable.holder.parentNode,r=o.style;this.trimmingContainer!==window&&(r.height=this.wot.wtViewport.getWorkspaceHeight()-n+"px"),this.clone.wtTable.holder.style.height=r.height,e=d(this.clone.wtTable.TABLE),r.width=(0===e?e:e+4)+"px"},adjustRootChildrenSize:function(){var e=a();this.clone.wtTable.hider.style.height=this.hider.style.height,this.clone.wtTable.holder.style.height=this.clone.wtTable.holder.parentNode.style.height,0===e&&(e=30),this.clone.wtTable.holder.style.width=parseInt(this.clone.wtTable.holder.parentNode.style.width,10)+e+"px"},applyToDOM:function(){var e=this.wot.getSetting("totalColumns");if(this.areElementSizesAdjusted||this.adjustElementsSize(),"number"==typeof this.wot.wtViewport.columnsRenderCalculator.startPosition)this.spreader.style.left=this.wot.wtViewport.columnsRenderCalculator.startPosition+"px";else{if(0!==e)throw new Error("Incorrect value of the columnsRenderCalculator");this.spreader.style.left="0"}this.spreader.style.right="",this.needFullRender&&this.syncOverlayOffset()},syncOverlayOffset:function(){"number"==typeof this.wot.wtViewport.rowsRenderCalculator.startPosition?this.clone.wtTable.spreader.style.top=this.wot.wtViewport.rowsRenderCalculator.startPosition+"px":this.clone.wtTable.spreader.style.top=""},scrollTo:function(e,t){var n=this.getTableParentOffset(),o=this.wot.cloneSource?this.wot.cloneSource:this.wot,r=o.wtTable.holder,i=0;t&&r.offsetWidth!==r.clientWidth&&(i=a()),t?(n+=this.sumCellSizes(0,e+1),n-=this.wot.wtViewport.getViewportWidth()):n+=this.sumCellSizes(this.wot.getSetting("fixedColumnsLeft"),e),n+=i,this.setScrollPosition(n)},getTableParentOffset:function(){return this.trimmingContainer===window?this.wot.wtTable.holderOffset.left:0},getScrollPosition:function(){return l(this.mainTableScrollableElement)},adjustHeaderBordersPosition:function(e){var t=this.wot.wtTable.holder.parentNode,n=this.wot.getSetting("rowHeaders"),o=this.wot.getSetting("fixedColumnsLeft");if(o&&!n.length)s(t,"innerBorderLeft");else if(!o&&n.length){var r=c(t,"innerBorderLeft");e?s(t,"innerBorderLeft"):h(t,"innerBorderLeft"),(!r&&e||r&&!e)&&this.wot.wtOverlays.adjustElementsSize()}}},{},p),window.WalkontableLeftOverlay=g,p.registerOverlay(p.CLONE_LEFT,g)},{_base:11,"helpers/dom/element":45}],14:[function(e,t,n){"use strict";Object.defineProperties(n,{WalkontableTopOverlay:{get:function(){return g}},__esModule:{value:!0}});var o,r,i=(o=e("helpers/dom/element"),o&&o.__esModule&&o||{"default":o}),s=i.addClass,a=i.getScrollbarWidth,l=i.getScrollTop,u=i.getWindowScrollLeft,c=i.hasClass,d=i.outerHeight,h=i.removeClass,f=i.setOverlayPosition,p=(r=e("_base"),r&&r.__esModule&&r||{"default":r}).WalkontableOverlay,g=function(e){$traceurRuntime.superConstructor(m).call(this,e),this.clone=this.makeClone(p.CLONE_TOP)},m=g;$traceurRuntime.createClass(g,{shouldBeRendered:function(){return this.wot.getSetting("fixedRowsTop")||this.wot.getSetting("columnHeaders").length?!0:!1},resetFixedPosition:function(){if(this.needFullRender&&this.wot.wtTable.holder.parentNode){var e=this.clone.wtTable.holder.parentNode,t=0;if(this.wot.wtOverlays.leftOverlay.trimmingContainer===window){var n,o,r=this.wot.wtTable.hider.getBoundingClientRect(),i=Math.ceil(r.top),s=Math.ceil(r.bottom);n=this.wot.wtTable.hider.style.left,n=""===n?0:n,o=0>i&&s-e.offsetHeight>0?-i:0,t=o,o+="px",f(e,n,o)}else t=this.getScrollPosition();this.adjustHeaderBordersPosition(t),this.adjustElementsSize()}},setScrollPosition:function(e){this.mainTableScrollableElement===window?window.scrollTo(u(),e):this.mainTableScrollableElement.scrollTop=e},onScroll:function(){this.wot.getSetting("onScrollVertically")},sumCellSizes:function(e,t){for(var n=0,o=this.wot.wtSettings.settings.defaultRowHeight;t>e;){var r=this.wot.wtTable.getRowHeight(e);n+=void 0===r?o:r,e++}return n},adjustElementsSize:function(){var e=void 0!==arguments[0]?arguments[0]:!1;(this.needFullRender||e)&&(this.adjustRootElementSize(),this.adjustRootChildrenSize(),e||(this.areElementSizesAdjusted=!0))},adjustRootElementSize:function(){var e,t=this.wot.wtTable.holder,n=t.clientWidth===t.offsetWidth?0:a(),o=this.clone.wtTable.holder.parentNode,r=o.style;this.trimmingContainer!==window&&(r.width=this.wot.wtViewport.getWorkspaceWidth()-n+"px"),this.clone.wtTable.holder.style.width=r.width,e=d(this.clone.wtTable.TABLE),r.height=(0===e?e:e+4)+"px"},adjustRootChildrenSize:function(){var e=a();this.clone.wtTable.hider.style.width=this.hider.style.width,this.clone.wtTable.holder.style.width=this.clone.wtTable.holder.parentNode.style.width,0===e&&(e=30),this.clone.wtTable.holder.style.height=parseInt(this.clone.wtTable.holder.parentNode.style.height,10)+e+"px"},applyToDOM:function(){var e=this.wot.getSetting("totalRows");if(this.areElementSizesAdjusted||this.adjustElementsSize(),"number"==typeof this.wot.wtViewport.rowsRenderCalculator.startPosition)this.spreader.style.top=this.wot.wtViewport.rowsRenderCalculator.startPosition+"px";else{if(0!==e)throw new Error("Incorrect value of the rowsRenderCalculator");this.spreader.style.top="0"}this.spreader.style.bottom="",this.needFullRender&&this.syncOverlayOffset()},syncOverlayOffset:function(){"number"==typeof this.wot.wtViewport.columnsRenderCalculator.startPosition?this.clone.wtTable.spreader.style.left=this.wot.wtViewport.columnsRenderCalculator.startPosition+"px":this.clone.wtTable.spreader.style.left=""},scrollTo:function(e,t){var n=this.getTableParentOffset(),o=this.wot.cloneSource?this.wot.cloneSource:this.wot,r=o.wtTable.holder,i=0;if(t&&r.offsetHeight!==r.clientHeight&&(i=a()),t){var s=this.wot.getSetting("fixedRowsBottom"),l=(this.wot.getSetting("fixedRowsTop"),this.wot.getSetting("totalRows"));n+=this.sumCellSizes(0,e+1),n-=this.wot.wtViewport.getViewportHeight()-this.sumCellSizes(l-s,l),n+=1}else n+=this.sumCellSizes(this.wot.getSetting("fixedRowsTop"),e);n+=i,this.setScrollPosition(n)},getTableParentOffset:function(){return this.mainTableScrollableElement===window?this.wot.wtTable.holderOffset.top:0},getScrollPosition:function(){return l(this.mainTableScrollableElement)},adjustHeaderBordersPosition:function(e){if(0===this.wot.getSetting("fixedRowsTop")&&this.wot.getSetting("columnHeaders").length>0){var t=this.wot.wtTable.holder.parentNode,n=c(t,"innerBorderTop");e?s(t,"innerBorderTop"):h(t,"innerBorderTop"),(!n&&e||n&&!e)&&this.wot.wtOverlays.adjustElementsSize()}if(0===this.wot.getSetting("rowHeaders").length){var o=this.clone.wtTable.THEAD.querySelectorAll("th:nth-of-type(2)");if(o)for(var r=0;rc&&h-e.offsetWidth>0?-c+"px":"0",r=0>u&&d-e.offsetHeight>0?-u+"px":"0",l(e,o,r)}e.style.height=(0===t?t:t+4)+"px",e.style.width=(0===n?n:n+4)+"px"}}},{},u),window.WalkontableTopLeftCornerOverlay=c,u.registerOverlay(u.CLONE_TOP_LEFT_CORNER,c)},{_base:11,"helpers/dom/element":45}],16:[function(e,t,n){"use strict";Object.defineProperties(n,{WalkontableOverlays:{get:function(){return f}},__esModule:{value:!0}});var o,r,i,s=(o=e("helpers/dom/element"),o&&o.__esModule&&o||{"default":o}),a=s.getScrollableElement,l=s.getScrollbarWidth,u=s.getScrollLeft,c=s.getScrollTop,d=(r=e("helpers/unicode"),r&&r.__esModule&&r||{"default":r}).isKey,h=(i=e("eventManager"),i&&i.__esModule&&i||{"default":i}).EventManager,f=function(e){this.wot=e,this.instance=this.wot,this.eventManager=new h(this.wot),this.wot.update("scrollbarWidth",l()),this.wot.update("scrollbarHeight",l()),this.mainTableScrollableElement=a(this.wot.wtTable.TABLE),this.topOverlay=WalkontableOverlay.createOverlay(WalkontableOverlay.CLONE_TOP,this.wot),"undefined"==typeof WalkontableBottomOverlay?this.bottomOverlay={needFullRender:!1}:this.bottomOverlay=WalkontableOverlay.createOverlay(WalkontableOverlay.CLONE_BOTTOM,this.wot),this.leftOverlay=WalkontableOverlay.createOverlay(WalkontableOverlay.CLONE_LEFT,this.wot),this.topOverlay.needFullRender&&this.leftOverlay.needFullRender&&(this.topLeftCornerOverlay=WalkontableOverlay.createOverlay(WalkontableOverlay.CLONE_TOP_LEFT_CORNER,this.wot)),this.bottomOverlay.needFullRender&&this.leftOverlay.needFullRender&&"undefined"!=typeof WalkontableBottomLeftCornerOverlay?this.bottomLeftCornerOverlay=WalkontableOverlay.createOverlay(WalkontableOverlay.CLONE_BOTTOM_LEFT_CORNER,this.wot):this.bottomLeftCornerOverlay={needFullRender:!1},this.wot.getSetting("debug")&&(this.debug=WalkontableOverlay.createOverlay(WalkontableOverlay.CLONE_DEBUG,this.wot)),this.destroyed=!1,this.keyPressed=!1,this.spreaderLastSize={width:null,height:null},this.overlayScrollPositions={master:{top:0,left:0},top:{top:null,left:0},bottom:{top:null,left:0},left:{top:0,left:null}},this.registerListeners()};$traceurRuntime.createClass(f,{refreshAll:function(){if(this.wot.drawn){if(!this.wot.wtTable.holder.parentNode)return void this.destroy();this.wot.draw(!0),this.topOverlay.onScroll(),this.leftOverlay.onScroll()}},registerListeners:function(){var e=this;this.eventManager.addEventListener(document.documentElement,"keydown",function(t){return e.onKeyDown(t)}),this.eventManager.addEventListener(document.documentElement,"keyup",function(){return e.onKeyUp()}),this.eventManager.addEventListener(document,"visibilitychange",function(){return e.onKeyUp()}),this.eventManager.addEventListener(this.mainTableScrollableElement,"scroll",function(t){return e.onTableScroll(t)}),this.topOverlay.needFullRender&&(this.eventManager.addEventListener(this.topOverlay.clone.wtTable.holder,"scroll",function(t){return e.onTableScroll(t)}),this.eventManager.addEventListener(this.topOverlay.clone.wtTable.holder,"wheel",function(t){return e.onTableScroll(t)})),this.bottomOverlay.needFullRender&&(this.eventManager.addEventListener(this.bottomOverlay.clone.wtTable.holder,"scroll",function(t){return e.onTableScroll(t)}),this.eventManager.addEventListener(this.bottomOverlay.clone.wtTable.holder,"wheel",function(t){return e.onTableScroll(t)})),this.leftOverlay.needFullRender&&(this.eventManager.addEventListener(this.leftOverlay.clone.wtTable.holder,"scroll",function(t){return e.onTableScroll(t)}),this.eventManager.addEventListener(this.leftOverlay.clone.wtTable.holder,"wheel",function(t){return e.onTableScroll(t)})),this.topOverlay.trimmingContainer!==window&&this.leftOverlay.trimmingContainer!==window&&this.eventManager.addEventListener(window,"wheel",function(t){var n,o=t.wheelDeltaY||t.deltaY,r=t.wheelDeltaX||t.deltaX;e.topOverlay.clone.wtTable.holder.contains(t.realTarget)?n="top":e.bottomOverlay.clone&&e.bottomOverlay.clone.wtTable.holder.contains(t.realTarget)?n="bottom":e.leftOverlay.clone.wtTable.holder.contains(t.realTarget)&&(n="left"),"top"==n&&0!==o?t.preventDefault():"left"==n&&0!==r?t.preventDefault():"bottom"==n&&0!==o&&t.preventDefault()})},onTableScroll:function(e){Handsontable.mobileBrowser||(!this.keyPressed||this.mainTableScrollableElement===window||e.target.contains(this.mainTableScrollableElement))&&("scroll"===e.type?this.syncScrollPositions(e):this.translateMouseWheelToScroll(e))},onKeyDown:function(e){this.keyPressed=d(e.keyCode,"ARROW_UP|ARROW_RIGHT|ARROW_DOWN|ARROW_LEFT")},onKeyUp:function(){this.keyPressed=!1},translateMouseWheelToScroll:function(e){for(var t,n=this.topOverlay.clone.wtTable.holder,o=this.bottomOverlay.clone?this.bottomOverlay.clone.wtTable.holder:null,r=this.leftOverlay.clone.wtTable.holder,i={type:"wheel"},s=e.target,a=e.wheelDeltaY||-1*e.deltaY,l=e.wheelDeltaX||-1*e.deltaX;s!=document&&null!=s;){if(s.className.indexOf("wtHolder")>-1){t=s;break}s=s.parentNode}return i.target=t,t==n?this.syncScrollPositions(i,-.2*a):t==o?this.syncScrollPositions(i,-.2*a):t==r&&this.syncScrollPositions(i,-.2*l),!1},syncScrollPositions:function(e){var t=void 0!==arguments[1]?arguments[1]:null;if(!this.destroyed){if(0===arguments.length)return void this.syncScrollWithMaster();var n,o,r,i=this.mainTableScrollableElement,s=e.target,a=0,l=!1;this.topOverlay.needFullRender&&(n=this.topOverlay.clone.wtTable.holder),this.bottomOverlay.needFullRender&&(r=this.bottomOverlay.clone.wtTable.holder),this.leftOverlay.needFullRender&&(o=this.leftOverlay.clone.wtTable.holder),s===document&&(s=window),s===i?(a=u(s),this.overlayScrollPositions.master.left!==a&&(this.overlayScrollPositions.master.left=a,l=!0,n&&(n.scrollLeft=a),r&&(r.scrollLeft=a)),a=c(s),this.overlayScrollPositions.master.top!==a&&(this.overlayScrollPositions.master.top=a,l=!0,o&&(o.scrollTop=a))):s===r?(a=u(s),this.overlayScrollPositions.bottom.left!==a&&(this.overlayScrollPositions.bottom.left=a,l=!0,i.scrollLeft=a),null!==t&&(l=!0,i.scrollTop+=t)):s===n?(a=u(s),this.overlayScrollPositions.top.left!==a&&(this.overlayScrollPositions.top.left=a,l=!0,i.scrollLeft=a),null!==t&&(l=!0,i.scrollTop+=t)):s===o&&(a=c(s),this.overlayScrollPositions.left.top!==a&&(this.overlayScrollPositions.left.top=a,l=!0,i.scrollTop=a),null!==t&&(l=!0,i.scrollLeft+=t)),!this.keyPressed&&l&&"scroll"===e.type&&this.refreshAll()}},syncScrollWithMaster:function(){var e=this.topOverlay.mainTableScrollableElement;this.topOverlay.needFullRender&&(this.topOverlay.clone.wtTable.holder.scrollLeft=e.scrollLeft),this.leftOverlay.needFullRender&&(this.leftOverlay.clone.wtTable.holder.scrollTop=e.scrollTop)},destroy:function(){this.eventManager.destroy(),this.topOverlay.destroy(),this.bottomOverlay.clone&&this.bottomOverlay.destroy(),this.leftOverlay.destroy(),this.topLeftCornerOverlay&&this.topLeftCornerOverlay.destroy(),this.bottomLeftCornerOverlay&&this.bottomLeftCornerOverlay.clone&&this.bottomLeftCornerOverlay.destroy(),this.debug&&this.debug.destroy(),this.destroyed=!0},refresh:function(){var e=void 0!==arguments[0]?arguments[0]:!1;if(this.topOverlay.areElementSizesAdjusted&&this.leftOverlay.areElementSizesAdjusted){var t=this.wot.wtTable.wtRootElement.parentNode||this.wot.wtTable.wtRootElement,n=t.clientWidth,o=t.clientHeight;(n!==this.spreaderLastSize.width||o!==this.spreaderLastSize.height)&&(this.spreaderLastSize.width=n,this.spreaderLastSize.height=o,this.adjustElementsSize())}this.bottomOverlay.clone&&this.bottomOverlay.refresh(e),this.leftOverlay.refresh(e),this.topOverlay.refresh(e),this.topLeftCornerOverlay&&this.topLeftCornerOverlay.refresh(e),this.bottomLeftCornerOverlay&&this.bottomLeftCornerOverlay.clone&&this.bottomLeftCornerOverlay.refresh(e),this.debug&&this.debug.refresh(e)},adjustElementsSize:function(){var e=void 0!==arguments[0]?arguments[0]:!1,t=this.wot.getSetting("totalColumns"),n=this.wot.getSetting("totalRows"),o=this.wot.wtViewport.getRowHeaderWidth(),r=this.wot.wtViewport.getColumnHeaderHeight(),i=this.wot.wtTable.hider.style;i.width=o+this.leftOverlay.sumCellSizes(0,t)+"px",i.height=r+this.topOverlay.sumCellSizes(0,n)+1+"px",this.topOverlay.adjustElementsSize(e),this.leftOverlay.adjustElementsSize(e),this.bottomOverlay.clone&&this.bottomOverlay.adjustElementsSize(e)},applyToDOM:function(){this.topOverlay.areElementSizesAdjusted&&this.leftOverlay.areElementSizesAdjusted||this.adjustElementsSize(),this.topOverlay.applyToDOM(),this.bottomOverlay.clone&&this.bottomOverlay.applyToDOM(),this.leftOverlay.applyToDOM()}},{}),window.WalkontableOverlays=f},{eventManager:41,"helpers/dom/element":45,"helpers/unicode":53}],17:[function(e,t,n){"use strict";Object.defineProperties(n,{WalkontableScroll:{get:function(){return o}},__esModule:{value:!0}});var o=function(e){this.wot=e,this.instance=e};$traceurRuntime.createClass(o,{scrollViewport:function(e){if(this.wot.drawn){var t=this.wot.getSetting("totalRows"),n=this.wot.getSetting("totalColumns"),o=this.instance.getSetting("fixedRowsTop"),r=this.instance.getSetting("fixedRowsBottom"),i=this.instance.getSetting("fixedColumnsLeft");if(e.row<0||e.row>t-1)throw new Error("row "+e.row+" does not exist");if(e.col<0||e.col>n-1)throw new Error("column "+e.col+" does not exist");e.row>this.instance.wtTable.getLastVisibleRow()&&e.row=o&&e.rowthis.instance.wtTable.getLastVisibleColumn()?this.wot.wtOverlays.leftOverlay.scrollTo(e.col,!0):e.col>=i&&e.colu;u++)o=e.wtTable.columnFilter.renderedToSource(u),o>=l[1]&&o<=l[3]&&(r=e.wtTable.getColumnHeader(o),r&&this.settings.highlightColumnClassName&&a(r,this.settings.highlightColumnClassName));for(var c=0;i>c;c++){n=e.wtTable.rowFilter.renderedToSource(c),n>=l[0]&&n<=l[2]&&(r=e.wtTable.getRowHeader(n),r&&this.settings.highlightRowClassName&&a(r,this.settings.highlightRowClassName));for(var d=0;s>d;d++)o=e.wtTable.columnFilter.renderedToSource(d),n>=l[0]&&n<=l[2]&&o>=l[1]&&o<=l[3]?this.settings.className&&this.addClassAtCoords(e,n,o,this.settings.className):n>=l[0]&&n<=l[2]?this.settings.highlightRowClassName&&this.addClassAtCoords(e,n,o,this.settings.highlightRowClassName):o>=l[1]&&o<=l[3]&&this.settings.highlightColumnClassName&&this.addClassAtCoords(e,n,o,this.settings.highlightColumnClassName)}if(e.getSetting("onBeforeDrawBorders",l,this.settings.className),this.settings.border){var h=this.getBorder(e);h&&h.appear(l)}}}},{}),window.WalkontableSelection=d},{border:2,"cell/coords":5,"cell/range":6,"helpers/dom/element":45}],19:[function(e,t,n){"use strict";Object.defineProperties(n,{WalkontableSettings:{get:function(){return i}},__esModule:{value:!0}});var o,r=(o=e("helpers/dom/element"),o&&o.__esModule&&o||{"default":o}).fastInnerText,i=function(e,t){var n=this;this.wot=e,this.instance=e,this.defaults={table:void 0,debug:!1,externalRowCalculator:!1,stretchH:"none",currentRowClassName:null,currentColumnClassName:null,data:void 0,fixedColumnsLeft:0,fixedRowsTop:0,fixedRowsBottom:0,minSpareRows:0,rowHeaders:function(){return[]},columnHeaders:function(){return[]},totalRows:void 0,totalColumns:void 0,cellRenderer:function(e,t,o){var i=n.getSetting("data",e,t);r(o,void 0===i||null===i?"":i)},columnWidth:function(e){},rowHeight:function(e){},defaultRowHeight:23,defaultColumnWidth:50,selections:null,hideBorderOnMouseDownOver:!1,viewportRowCalculatorOverride:null,viewportColumnCalculatorOverride:null,onCellMouseDown:null,onCellMouseOver:null,onCellDblClick:null,onCellCornerMouseDown:null,onCellCornerDblClick:null,beforeDraw:null,onDraw:null,onBeforeDrawBorders:null,onScrollVertically:null,onScrollHorizontally:null,onBeforeTouchScroll:null,onAfterMomentumScroll:null,scrollbarWidth:10,scrollbarHeight:10,renderAllRows:!1,groups:!1},this.settings={};for(var o in this.defaults)if(this.defaults.hasOwnProperty(o))if(void 0!==t[o])this.settings[o]=t[o];else{if(void 0===this.defaults[o])throw new Error('A required setting "'+o+'" was not provided');this.settings[o]=this.defaults[o]}};$traceurRuntime.createClass(i,{update:function(e,t){if(void 0===t)for(var n in e)e.hasOwnProperty(n)&&(this.settings[n]=e[n]);else this.settings[e]=t;return this.wot},getSetting:function(e,t,n,o,r){return"function"==typeof this.settings[e]?this.settings[e](t,n,o,r):void 0!==t&&Array.isArray(this.settings[e])?this.settings[e][t]:this.settings[e]},has:function(e){return!!this.settings[e]}},{}),window.WalkontableSettings=i},{"helpers/dom/element":45}],20:[function(e,t,n){"use strict";Object.defineProperties(n,{WalkontableTable:{get:function(){return C}},__esModule:{value:!0}});var o,r,i,s,a,l,u=(o=e("helpers/dom/element"),o&&o.__esModule&&o||{"default":o}),c=u.getStyle,d=u.getTrimmingContainer,h=u.hasClass,f=u.index,p=u.offset,g=u.removeClass,m=u.removeTextNodes,v=(u.overlayContainsElement,(r=e("cell/coords"),r&&r.__esModule&&r||{"default":r}).WalkontableCellCoords),w=((i=e("cell/range"),i&&i.__esModule&&i||{"default":i}).WalkontableCellRange,(s=e("filter/column"),s&&s.__esModule&&s||{"default":s}).WalkontableColumnFilter),y=(a=e("filter/row"),a&&a.__esModule&&a||{"default":a}).WalkontableRowFilter,b=(l=e("tableRenderer"),l&&l.__esModule&&l||{"default":l}).WalkontableTableRenderer,C=function(e,t){this.wot=e,this.instance=this.wot,this.TABLE=t,this.TBODY=null,this.THEAD=null,this.COLGROUP=null,this.tableOffset=0,this.holderOffset=0,m(this.TABLE),this.spreader=this.createSpreader(this.TABLE),this.hider=this.createHider(this.spreader),this.holder=this.createHolder(this.hider),this.wtRootElement=this.holder.parentNode,this.alignOverlaysWithTrimmingContainer(),this.fixTableDomTree(),this.colgroupChildrenLength=this.COLGROUP.childNodes.length,this.theadChildrenLength=this.THEAD.firstChild?this.THEAD.firstChild.childNodes.length:0,this.tbodyChildrenLength=this.TBODY.childNodes.length,this.rowFilter=null,this.columnFilter=null};$traceurRuntime.createClass(C,{fixTableDomTree:function(){this.TBODY=this.TABLE.querySelector("tbody"),this.TBODY||(this.TBODY=document.createElement("tbody"),this.TABLE.appendChild(this.TBODY)),this.THEAD=this.TABLE.querySelector("thead"),this.THEAD||(this.THEAD=document.createElement("thead"),this.TABLE.insertBefore(this.THEAD,this.TBODY)),this.COLGROUP=this.TABLE.querySelector("colgroup"),this.COLGROUP||(this.COLGROUP=document.createElement("colgroup"),this.TABLE.insertBefore(this.COLGROUP,this.THEAD)),this.wot.getSetting("columnHeaders").length&&!this.THEAD.childNodes.length&&this.THEAD.appendChild(document.createElement("TR"))},createSpreader:function(e){var t,n=e.parentNode;return n&&1===n.nodeType&&h(n,"wtHolder")||(t=document.createElement("div"),t.className="wtSpreader",n&&n.insertBefore(t,e),t.appendChild(e)),t.style.position="relative",t},createHider:function(e){var t,n=e.parentNode;return n&&1===n.nodeType&&h(n,"wtHolder")||(t=document.createElement("div"),t.className="wtHider",n&&n.insertBefore(t,e),t.appendChild(e)),t},createHolder:function(e){var t,n=e.parentNode;return n&&1===n.nodeType&&h(n,"wtHolder")||(t=document.createElement("div"),t.style.position="relative",t.className="wtHolder",n&&n.insertBefore(t,e),this.isWorkingOnClone()||(t.parentNode.className+="ht_master handsontable"),t.appendChild(e)),t},alignOverlaysWithTrimmingContainer:function(){var e=d(this.wtRootElement);this.isWorkingOnClone()||(this.holder.parentNode.style.position="relative",e===window?(this.holder.style.overflow="visible",this.wtRootElement.style.overflow="visible"):(this.holder.style.width=c(e,"width"),this.holder.style.height=c(e,"height"),this.holder.style.overflow=""))},isWorkingOnClone:function(){return!!this.wot.cloneSource},draw:function(e){var t=this.instance.getSetting("totalRows");if(this.isWorkingOnClone()||(this.holderOffset=p(this.holder),e=this.wot.wtViewport.createRenderCalculators(e)),e)this.isWorkingOnClone()||this.wot.wtViewport.createVisibleCalculators(),this.wot.wtOverlays&&this.wot.wtOverlays.refresh(!0);else{this.isWorkingOnClone()?this.tableOffset=this.wot.cloneSource.wtTable.tableOffset:this.tableOffset=p(this.TABLE);var n;n=WalkontableOverlay.isOverlayTypeOf(this.wot.cloneOverlay,WalkontableOverlay.CLONE_DEBUG)||WalkontableOverlay.isOverlayTypeOf(this.wot.cloneOverlay,WalkontableOverlay.CLONE_TOP)||WalkontableOverlay.isOverlayTypeOf(this.wot.cloneOverlay,WalkontableOverlay.CLONE_TOP_LEFT_CORNER)?0:WalkontableOverlay.isOverlayTypeOf(this.instance.cloneOverlay,WalkontableOverlay.CLONE_BOTTOM)||WalkontableOverlay.isOverlayTypeOf(this.instance.cloneOverlay,WalkontableOverlay.CLONE_BOTTOM_LEFT_CORNER)?t-this.wot.getSetting("fixedRowsBottom"):this.wot.wtViewport.rowsRenderCalculator.startRow;var o;o=WalkontableOverlay.isOverlayTypeOf(this.wot.cloneOverlay,WalkontableOverlay.CLONE_DEBUG)||WalkontableOverlay.isOverlayTypeOf(this.wot.cloneOverlay,WalkontableOverlay.CLONE_LEFT)||WalkontableOverlay.isOverlayTypeOf(this.wot.cloneOverlay,WalkontableOverlay.CLONE_TOP_LEFT_CORNER)||WalkontableOverlay.isOverlayTypeOf(this.wot.cloneOverlay,WalkontableOverlay.CLONE_BOTTOM_LEFT_CORNER)?0:this.wot.wtViewport.columnsRenderCalculator.startColumn, -this.rowFilter=new y(n,t,this.wot.getSetting("columnHeaders").length),this.columnFilter=new w(o,this.wot.getSetting("totalColumns"),this.wot.getSetting("rowHeaders").length),this._doDraw(),this.alignOverlaysWithTrimmingContainer()}return this.refreshSelections(e),this.isWorkingOnClone()||(this.wot.wtOverlays.topOverlay.resetFixedPosition(),this.wot.wtOverlays.bottomOverlay.clone&&this.wot.wtOverlays.bottomOverlay.resetFixedPosition(),this.wot.wtOverlays.leftOverlay.resetFixedPosition(),this.wot.wtOverlays.topLeftCornerOverlay&&this.wot.wtOverlays.topLeftCornerOverlay.resetFixedPosition(),this.instance.wtOverlays.bottomLeftCornerOverlay&&this.instance.wtOverlays.bottomLeftCornerOverlay.clone&&this.wot.wtOverlays.bottomLeftCornerOverlay.resetFixedPosition()),this.wot.drawn=!0,this},_doDraw:function(){var e=new b(this);e.render()},removeClassFromCells:function(e){for(var t=this.TABLE.querySelectorAll("."+e),n=0,o=t.length;o>n;n++)g(t[n],e)},refreshSelections:function(e){if(this.wot.selections){var t=this.wot.selections.length;if(e)for(var n=0;t>n;n++)this.wot.selections[n].settings.className&&this.removeClassFromCells(this.wot.selections[n].settings.className),this.wot.selections[n].settings.highlightRowClassName&&this.removeClassFromCells(this.wot.selections[n].settings.highlightRowClassName),this.wot.selections[n].settings.highlightColumnClassName&&this.removeClassFromCells(this.wot.selections[n].settings.highlightColumnClassName);for(var o=0;t>o;o++)this.wot.selections[o].draw(this.wot,e)}},getCell:function(e){if(this.isRowBeforeRenderedRows(e.row))return-1;if(this.isRowAfterRenderedRows(e.row))return-2;var t=this.TBODY.childNodes[this.rowFilter.sourceToRendered(e.row)];return t?t.childNodes[this.columnFilter.sourceColumnToVisibleRowHeadedColumn(e.col)]:void 0},getColumnHeader:function(e){var t=void 0!==arguments[1]?arguments[1]:0,n=this.THEAD.childNodes[t];return n?n.childNodes[this.columnFilter.sourceColumnToVisibleRowHeadedColumn(e)]:void 0},getRowHeader:function(e){if(0===this.columnFilter.sourceColumnToVisibleRowHeadedColumn(0))return null;var t=this.TBODY.childNodes[this.rowFilter.sourceToRendered(e)];return t?t.childNodes[0]:void 0},getCoords:function(e){var t=e.parentNode,n=f(t);n=t.parentNode===this.THEAD?this.rowFilter.visibleColHeadedRowToSourceRow(n):this.rowFilter.renderedToSource(n);var o=this.columnFilter.visibleRowHeadedColumnToSourceColumn(e.cellIndex);return new v(n,o)},getTrForRow:function(e){return this.TBODY.childNodes[this.rowFilter.sourceToRendered(e)]},getFirstRenderedRow:function(){return this.wot.wtViewport.rowsRenderCalculator.startRow},getFirstVisibleRow:function(){return this.wot.wtViewport.rowsVisibleCalculator.startRow},getFirstRenderedColumn:function(){return this.wot.wtViewport.columnsRenderCalculator.startColumn},getFirstVisibleColumn:function(){return this.wot.wtViewport.columnsVisibleCalculator.startColumn},getLastRenderedRow:function(){return this.wot.wtViewport.rowsRenderCalculator.endRow},getLastVisibleRow:function(){return this.wot.wtViewport.rowsVisibleCalculator.endRow},getLastRenderedColumn:function(){return this.wot.wtViewport.columnsRenderCalculator.endColumn},getLastVisibleColumn:function(){return this.wot.wtViewport.columnsVisibleCalculator.endColumn},isRowBeforeRenderedRows:function(e){return this.rowFilter.sourceToRendered(e)<0&&e>=0},isRowAfterViewport:function(e){return this.rowFilter.sourceToRendered(e)>this.getLastVisibleRow()},isRowAfterRenderedRows:function(e){return this.rowFilter.sourceToRendered(e)>this.getLastRenderedRow()},isColumnBeforeViewport:function(e){return this.columnFilter.sourceToRendered(e)<0&&e>=0},isColumnAfterViewport:function(e){return this.columnFilter.sourceToRendered(e)>this.getLastVisibleColumn()},isLastRowFullyVisible:function(){return this.getLastVisibleRow()===this.getLastRenderedRow()},isLastColumnFullyVisible:function(){return this.getLastVisibleColumn()===this.getLastRenderedColumn()},getRenderedColumnsCount:function(){return WalkontableOverlay.isOverlayTypeOf(this.wot.cloneOverlay,WalkontableOverlay.CLONE_DEBUG)?this.wot.getSetting("totalColumns"):WalkontableOverlay.isOverlayTypeOf(this.wot.cloneOverlay,WalkontableOverlay.CLONE_LEFT)||WalkontableOverlay.isOverlayTypeOf(this.wot.cloneOverlay,WalkontableOverlay.CLONE_TOP_LEFT_CORNER)||WalkontableOverlay.isOverlayTypeOf(this.wot.cloneOverlay,WalkontableOverlay.CLONE_BOTTOM_LEFT_CORNER)?this.wot.getSetting("fixedColumnsLeft"):this.wot.wtViewport.columnsRenderCalculator.count},getRenderedRowsCount:function(){return WalkontableOverlay.isOverlayTypeOf(this.wot.cloneOverlay,WalkontableOverlay.CLONE_DEBUG)?this.wot.getSetting("totalRows"):WalkontableOverlay.isOverlayTypeOf(this.wot.cloneOverlay,WalkontableOverlay.CLONE_TOP)||WalkontableOverlay.isOverlayTypeOf(this.wot.cloneOverlay,WalkontableOverlay.CLONE_TOP_LEFT_CORNER)?this.wot.getSetting("fixedRowsTop"):WalkontableOverlay.isOverlayTypeOf(this.wot.cloneOverlay,WalkontableOverlay.CLONE_BOTTOM)||WalkontableOverlay.isOverlayTypeOf(this.wot.cloneOverlay,WalkontableOverlay.CLONE_BOTTOM_LEFT_CORNER)?this.instance.getSetting("fixedRowsBottom"):this.wot.wtViewport.rowsRenderCalculator.count},getVisibleRowsCount:function(){return this.wot.wtViewport.rowsVisibleCalculator.count},allRowsInViewport:function(){return this.wot.getSetting("totalRows")==this.getVisibleRowsCount()},getRowHeight:function(e){var t=this.wot.wtSettings.settings.rowHeight(e),n=this.wot.wtViewport.oversizedRows[e];return void 0!==n&&(t=void 0===t?n:Math.max(t,n)),t},getColumnHeaderHeight:function(e){var t=this.wot.wtSettings.settings.defaultRowHeight,n=this.wot.wtViewport.oversizedColumnHeaders[e];return void 0!==n&&(t=t?Math.max(t,n):n),t},getVisibleColumnsCount:function(){return this.wot.wtViewport.columnsVisibleCalculator.count},allColumnsInViewport:function(){return this.wot.getSetting("totalColumns")==this.getVisibleColumnsCount()},getColumnWidth:function(e){var t=this.wot.wtSettings.settings.columnWidth;return"function"==typeof t?t=t(e):"object"==typeof t&&(t=t[e]),t||this.wot.wtSettings.settings.defaultColumnWidth},getStretchedColumnWidth:function(e){var t=this.getColumnWidth(e),n=-1===[void 0,null].indexOf(t)?t:this.instance.wtSettings.settings.defaultColumnWidth,o=this.wot.wtViewport.columnsRenderCalculator;if(o){var r=o.getStretchedColumnWidth(e,n);r&&(n=r)}return n}},{}),window.WalkontableTable=C},{"cell/coords":5,"cell/range":6,"filter/column":9,"filter/row":10,"helpers/dom/element":45,tableRenderer:21}],21:[function(e,t,n){"use strict";function o(e,t){var n=document.createElement("TH");return t.insertBefore(n,e),t.removeChild(e),n}function r(e,t){var n=document.createElement("TD");return t.insertBefore(n,e),t.removeChild(e),n}Object.defineProperties(n,{WalkontableTableRenderer:{get:function(){return h}},__esModule:{value:!0}});var i,s=(i=e("helpers/dom/element"),i&&i.__esModule&&i||{"default":i}),a=s.addClass,l=s.empty,u=s.getScrollbarWidth,c=s.hasClass,d=s.innerHeight,h=function(e){this.wtTable=e,this.wot=e.instance,this.instance=e.instance,this.rowFilter=e.rowFilter,this.columnFilter=e.columnFilter,this.TABLE=e.TABLE,this.THEAD=e.THEAD,this.TBODY=e.TBODY,this.COLGROUP=e.COLGROUP,this.rowHeaders=[],this.rowHeaderCount=0,this.columnHeaders=[],this.columnHeaderCount=0,this.fixedRowsTop=0,this.fixedRowsBottom=0};$traceurRuntime.createClass(h,{render:function(){this.wtTable.isWorkingOnClone()||this.wot.getSetting("beforeDraw",!0),this.rowHeaders=this.wot.getSetting("rowHeaders"),this.rowHeaderCount=this.rowHeaders.length,this.fixedRowsTop=this.wot.getSetting("fixedRowsTop"),this.fixedRowsBottom=this.wot.getSetting("fixedRowsBottom"),this.columnHeaders=this.wot.getSetting("columnHeaders"),this.columnHeaderCount=this.columnHeaders.length;var e,t=this.wtTable.getRenderedColumnsCount(),n=this.wtTable.getRenderedRowsCount(),o=this.wot.getSetting("totalColumns"),r=this.wot.getSetting("totalRows"),i=!1;if((WalkontableOverlay.isOverlayTypeOf(this.wot.cloneOverlay,WalkontableOverlay.CLONE_BOTTOM)||WalkontableOverlay.isOverlayTypeOf(this.wot.cloneOverlay,WalkontableOverlay.CLONE_BOTTOM_LEFT_CORNER))&&(this.columnHeaders=[],this.columnHeaderCount=0),o>0&&(this.adjustAvailableNodes(),i=!0,this.renderColumnHeaders(),this.renderRows(r,n,t),this.wtTable.isWorkingOnClone()||(e=this.wot.wtViewport.getWorkspaceWidth(),this.wot.wtViewport.containerWidth=null),this.adjustColumnHeaderHeights(),this.adjustColumnWidths(t),this.markOversizedColumns()),i||this.adjustAvailableNodes(),this.removeRedundantRows(n),this.wtTable.isWorkingOnClone()){if(WalkontableOverlay.isOverlayTypeOf(this.wot.cloneOverlay,WalkontableOverlay.CLONE_BOTTOM)){var s=this.wot.cloneOverlay.instance;this.wot.cloneOverlay.markOversizedFixedBottomRows(),s.wtOverlays.adjustElementsSize()}}else{if(this.markOversizedRows(),this.wot.wtViewport.createVisibleCalculators(),this.wot.wtOverlays.refresh(!1),this.wot.wtOverlays.applyToDOM(),e!==this.wot.wtViewport.getWorkspaceWidth()){this.wot.wtViewport.containerWidth=null;for(var a=this.wtTable.getFirstRenderedColumn(),l=this.wtTable.getLastRenderedColumn(),u=a;l>u;u++){var c=this.wtTable.getStretchedColumnWidth(u),d=this.columnFilter.sourceToRendered(u);this.COLGROUP.childNodes[d+this.rowHeaderCount].style.width=c+"px"}}this.wot.getSetting("onDraw",!0)}},removeRedundantRows:function(e){for(;this.wtTable.tbodyChildrenLength>e;)this.TBODY.removeChild(this.TBODY.lastChild),this.wtTable.tbodyChildrenLength--},renderRows:function(e,t,n){for(var o,r,i=0,s=this.rowFilter.renderedToSource(i),a=this.wtTable.isWorkingOnClone();e>s&&s>=0&&(i>1e3&&console.error("Security brake: Too much TRs. Please define height for your table, which will enforce scrollbars."),void 0===t||i!==t);){if(r=this.getOrCreateTrForRow(i,r),this.renderRowHeaders(s,r),this.adjustColumns(r,n+this.rowHeaderCount),o=this.renderCells(s,r,n),(!a||WalkontableOverlay.isOverlayTypeOf(this.wot.cloneOverlay,WalkontableOverlay.CLONE_BOTTOM))&&this.resetOversizedRow(s),r.firstChild){var l=this.wot.wtTable.getRowHeight(s);l?(l--,r.firstChild.style.height=l+"px"):r.firstChild.style.height=""}i++,s=this.rowFilter.renderedToSource(i)}},resetOversizedRow:function(e){this.wot.getSetting("externalRowCalculator")||this.wot.wtViewport.oversizedRows&&this.wot.wtViewport.oversizedRows[e]&&(this.wot.wtViewport.oversizedRows[e]=void 0)},markOversizedRows:function(){if(!this.wot.getSetting("externalRowCalculator")){var e,t,n,o,r,i=this.instance.wtTable.TBODY.childNodes.length,s=i*this.instance.wtSettings.settings.defaultRowHeight,a=d(this.instance.wtTable.TBODY)-1;this.instance.getSetting("totalRows");if(s!==a||this.instance.getSetting("fixedRowsBottom"))for(;i;)i--,n=this.instance.wtTable.rowFilter.renderedToSource(i),e=this.instance.wtTable.getRowHeight(n),o=this.instance.wtTable.getTrForRow(n),r=o.querySelector("th"),t=r?d(r):d(o)-1,(!e&&this.instance.wtSettings.settings.defaultRowHeighte)&&(this.instance.wtViewport.oversizedRows[n]=++t)}},markOversizedColumns:function(){var e=this.wot.getOverlayName();if(this.columnHeaderCount&&!this.wot.wtViewport.isMarkedOversizedColumn[e]&&!this.wtTable.isWorkingOnClone()){for(var t=this.wtTable.getRenderedColumnsCount(),n=0;no;o++)this.markIfOversizedColumnHeader(o);this.wot.wtViewport.isMarkedOversizedColumn[e]=!0}},adjustColumnHeaderHeights:function(){for(var e=this.wot.getSetting("columnHeaders"),t=this.wot.wtTable.THEAD.childNodes,n=this.wot.wtViewport.oversizedColumnHeaders,o=0,r=e.length;r>o;o++)if(n[o]){if(0===t[o].childNodes.length)return;t[o].childNodes[0].style.height=n[o]+"px"}},markIfOversizedColumnHeader:function(e){for(var t,n,o,r=this.wot.wtTable.columnFilter.renderedToSource(e),i=this.columnHeaderCount,s=this.wot.wtSettings.settings.defaultRowHeight;i;)i--,t=this.wot.wtTable.getColumnHeaderHeight(i),n=this.wot.wtTable.getColumnHeader(r,i),n&&(o=d(n),(!t&&o>s||o>t)&&(this.wot.wtViewport.oversizedColumnHeaders[i]=o))},renderCells:function(e,t,n){for(var o,i,s=0;n>s;s++)i=this.columnFilter.renderedToSource(s),o=0===s?t.childNodes[this.columnFilter.sourceColumnToVisibleRowHeadedColumn(i)]:o.nextSibling,"TH"==o.nodeName&&(o=r(o,t)),c(o,"hide")||(o.className=""),o.removeAttribute("style"),this.wot.wtSettings.settings.cellRenderer(e,i,o);return o},adjustColumnWidths:function(e){var t=0,n=this.wot.cloneSource?this.wot.cloneSource:this.wot,o=n.wtTable.holder;o.offsetHeightr;r++){var i=this.wtTable.getStretchedColumnWidth(this.columnFilter.renderedToSource(r));this.COLGROUP.childNodes[r+this.rowHeaderCount].style.width=i+"px"}},appendToTbody:function(e){this.TBODY.appendChild(e),this.wtTable.tbodyChildrenLength++},getOrCreateTrForRow:function(e,t){var n;return e>=this.wtTable.tbodyChildrenLength?(n=this.createRow(),this.appendToTbody(n)):n=0===e?this.TBODY.firstChild:t.nextSibling,n.className&&n.removeAttribute("class"),n},createRow:function(){for(var e=document.createElement("TR"),t=0;to;o++){var r=this.columnFilter.renderedToSource(o);this.renderColumnHeader(t,r,n.childNodes[o+this.rowHeaderCount])}},adjustColGroups:function(){for(var e=this.wtTable.getRenderedColumnsCount();this.wtTable.colgroupChildrenLengthe+this.rowHeaderCount;)this.COLGROUP.removeChild(this.COLGROUP.lastChild),this.wtTable.colgroupChildrenLength--;this.rowHeaderCount&&a(this.COLGROUP.childNodes[0],"rowHeader")},adjustThead:function(){var e=this.wtTable.getRenderedColumnsCount(),t=this.THEAD.firstChild;if(this.columnHeaders.length){for(var n=0,o=this.columnHeaders.length;o>n;n++){for(t=this.THEAD.childNodes[n],t||(t=document.createElement("TR"),this.THEAD.appendChild(t)),this.theadChildrenLength=t.childNodes.length;this.theadChildrenLengthe+this.rowHeaderCount;)t.removeChild(t.lastChild),this.theadChildrenLength--}var r=this.THEAD.childNodes.length;if(r>this.columnHeaders.length)for(var i=this.columnHeaders.length;r>i;i++)this.THEAD.removeChild(this.THEAD.lastChild)}else t&&l(t)},getTrForColumnHeaders:function(e){return this.THEAD.childNodes[e]},renderColumnHeader:function(e,t,n){return n.className="",n.removeAttribute("style"),this.columnHeaders[e](t,n,e)},adjustColumns:function(e,t){for(var n=e.childNodes.length;t>n;){var o=document.createElement("TD");e.appendChild(o),n++}for(;n>t;)e.removeChild(e.lastChild),n--},removeRedundantColumns:function(e){for(;this.wtTable.tbodyChildrenLength>e;)this.TBODY.removeChild(this.TBODY.lastChild),this.wtTable.tbodyChildrenLength--}},{}),window.WalkontableTableRenderer=h},{"helpers/dom/element":45}],22:[function(e,t,n){"use strict";Object.defineProperties(n,{WalkontableViewport:{get:function(){return v}},__esModule:{value:!0}});var o,r,i,s,a=(o=e("helpers/dom/element"),o&&o.__esModule&&o||{"default":o}),l=a.getScrollbarWidth,u=a.getScrollTop,c=a.getStyle,d=a.offset,h=a.outerHeight,f=a.outerWidth,p=(r=e("eventManager"),r&&r.__esModule&&r||{"default":r}).EventManager,g=(i=e("calculator/viewportColumns"),i&&i.__esModule&&i||{"default":i}).WalkontableViewportColumnsCalculator,m=(s=e("calculator/viewportRows"),s&&s.__esModule&&s||{"default":s}).WalkontableViewportRowsCalculator,v=function(e){var t=this;this.wot=e,this.instance=this.wot,this.oversizedRows=[],this.oversizedColumnHeaders=[],this.isMarkedOversizedColumn={},this.clientHeight=0,this.containerWidth=NaN,this.rowHeaderWidth=NaN,this.rowsVisibleCalculator=null,this.columnsVisibleCalculator=null,this.eventManager=new p(this.wot),this.eventManager.addEventListener(window,"resize",function(){t.clientHeight=t.getWorkspaceHeight()})};$traceurRuntime.createClass(v,{getWorkspaceHeight:function(){var e,t=this.instance.wtOverlays.topOverlay.trimmingContainer,n=0;return t===window?n=document.documentElement.clientHeight:(e=h(t),n=e>0&&t.clientHeight>0?t.clientHeight:1/0),n},getWorkspaceWidth:function(){var e,t,n=this.instance.getSetting("totalColumns"),o=this.instance.wtOverlays.leftOverlay.trimmingContainer,r=this.instance.getSetting("stretchH"),i=document.documentElement.offsetWidth;return e=Handsontable.freezeOverlays?Math.min(i-this.getWorkspaceOffset().left,i):Math.min(this.getContainerFillWidth(),i-this.getWorkspaceOffset().left,i),o===window&&n>0&&this.sumColumnWidths(0,n-1)>e?document.documentElement.clientWidth:o!==window&&(t=c(this.instance.wtOverlays.leftOverlay.trimmingContainer,"overflow"),"scroll"==t||"hidden"==t||"auto"==t)?Math.max(e,o.clientWidth):"none"!==r&&r?e:Math.max(e,f(this.instance.wtTable.TABLE))},hasVerticalScroll:function(){return this.getWorkspaceActualHeight()>this.getWorkspaceHeight()},hasHorizontalScroll:function(){return this.getWorkspaceActualWidth()>this.getWorkspaceWidth()},sumColumnWidths:function(e,t){for(var n=0;t>e;)n+=this.wot.wtTable.getColumnWidth(e),e++;return n},getContainerFillWidth:function(){if(this.containerWidth)return this.containerWidth;var e,t,n=this.instance.wtTable.holder;return t=document.createElement("div"),t.style.width="100%",t.style.height="1px",n.appendChild(t),e=t.offsetWidth,this.containerWidth=e,n.removeChild(t),e},getWorkspaceOffset:function(){return d(this.wot.wtTable.TABLE)},getWorkspaceActualHeight:function(){return h(this.wot.wtTable.TABLE)},getWorkspaceActualWidth:function(){return f(this.wot.wtTable.TABLE)||f(this.wot.wtTable.TBODY)||f(this.wot.wtTable.THEAD)},getColumnHeaderHeight:function(){return isNaN(this.columnHeaderHeight)&&(this.columnHeaderHeight=h(this.wot.wtTable.THEAD)),this.columnHeaderHeight},getViewportHeight:function(){var e,t=this.getWorkspaceHeight();return t===1/0?t:(e=this.getColumnHeaderHeight(),e>0&&(t-=e),t)},getRowHeaderWidth:function(){if(this.wot.cloneSource)return this.wot.cloneSource.wtViewport.getRowHeaderWidth();if(isNaN(this.rowHeaderWidth)){var e=this.instance.getSetting("rowHeaders");if(e.length){var t=this.instance.wtTable.TABLE.querySelector("TH");this.rowHeaderWidth=0;for(var n=0,o=e.length;o>n;n++)t?(this.rowHeaderWidth+=f(t),t=t.nextSibling):this.rowHeaderWidth+=50}else this.rowHeaderWidth=0}return this.rowHeaderWidth},getViewportWidth:function(){var e,t=this.getWorkspaceWidth();return t===1/0?t:(e=this.getRowHeaderWidth(),e>0?t-e:t)},createRowsCalculator:function(){var e,t,n,o,r,i,s,a=void 0!==arguments[0]?arguments[0]:!1,c=this;return this.rowHeaderWidth=NaN,e=this.wot.wtSettings.settings.renderAllRows?1/0:this.getViewportHeight(),t=u(this.wot.wtOverlays.mainTableScrollableElement)-this.wot.wtOverlays.topOverlay.getTableParentOffset(),0>t&&(t=0),n=this.wot.getSetting("fixedRowsTop"),r=this.wot.getSetting("fixedRowsBottom"),s=this.wot.getSetting("totalRows"),n&&(i=this.wot.wtOverlays.topOverlay.sumCellSizes(0,n),t+=i,e-=i),r&&this.wot.wtOverlays.bottomOverlay.clone&&(i=this.wot.wtOverlays.bottomOverlay.sumCellSizes(s-r,s),e-=i),o=this.wot.wtTable.holder.clientHeight===this.wot.wtTable.holder.offsetHeight?0:l(),new m(e,t,this.wot.getSetting("totalRows"),function(e){return c.wot.wtTable.getRowHeight(e)},a?null:this.wot.wtSettings.settings.viewportRowCalculatorOverride,a,o)},createColumnsCalculator:function(){var e,t,n=void 0!==arguments[0]?arguments[0]:!1,o=this,r=this.getViewportWidth();if(this.columnHeaderHeight=NaN,e=this.wot.wtOverlays.leftOverlay.getScrollPosition()-this.wot.wtOverlays.leftOverlay.getTableParentOffset(),0>e&&(e=0),t=this.wot.getSetting("fixedColumnsLeft")){var i=this.wot.wtOverlays.leftOverlay.sumCellSizes(0,t);e+=i,r-=i}return this.wot.wtTable.holder.clientWidth!==this.wot.wtTable.holder.offsetWidth&&(r-=l()),new g(r,e,this.wot.getSetting("totalColumns"),function(e){return o.wot.wtTable.getColumnWidth(e)},n?null:this.wot.wtSettings.settings.viewportColumnCalculatorOverride,n,this.wot.getSetting("stretchH"))},createRenderCalculators:function(){var e=void 0!==arguments[0]?arguments[0]:!1;if(e){var t=this.createRowsCalculator(!0),n=this.createColumnsCalculator(!0);this.areAllProposedVisibleRowsAlreadyRendered(t)&&this.areAllProposedVisibleColumnsAlreadyRendered(n)||(e=!1)}return e||(this.rowsRenderCalculator=this.createRowsCalculator(),this.columnsRenderCalculator=this.createColumnsCalculator()),this.rowsVisibleCalculator=null,this.columnsVisibleCalculator=null,e},createVisibleCalculators:function(){this.rowsVisibleCalculator=this.createRowsCalculator(!0),this.columnsVisibleCalculator=this.createColumnsCalculator(!0)},areAllProposedVisibleRowsAlreadyRendered:function(e){return this.rowsVisibleCalculator?e.startRow0?!1:e.endRow>this.rowsRenderCalculator.endRow||e.endRow===this.rowsRenderCalculator.endRow&&e.endRow0?!1:e.endColumn>this.columnsRenderCalculator.endColumn||e.endColumn===this.columnsRenderCalculator.endColumn&&e.endColumn=0;s--)if(null===e[s])e.splice(s,1);else{var a=e[s][0],l=d.propToCol(e[s][1]),u=m.runHooks("modifyCol",l),c=m.getCellMeta(a,u);if("numeric"===c.type&&"string"==typeof e[s][3]&&e[s][3].length>0&&(/^-?[\d\s]*(\.|\,)?\d*$/.test(e[s][3])||c.format)){var h=e[s][3].length;"undefined"==typeof c.language?R.language("en"):e[s][3].indexOf(".")===h-3&&-1===e[s][3].indexOf(",")?R.language("en"):R.language(c.language),R.validate(e[s][3])&&(e[s][3]=R().unformat(e[s][3]))}m.getCellValidator(c)&&(i.addValidatorToQueue(),m.validateCell(e[s][3],c,function(t,n){return function(o){if("boolean"!=typeof o)throw new Error("Validation error: result is not boolean");o===!1&&n.allowInvalid===!1&&(e.splice(t,1),n.valid=!0,--t),i.removeValidatorFormQueue()}}(s,c),t))}i.checkIfQueueIsEmpty()}function r(e,t){var n=e.length-1;if(!(0>n)){for(;n>=0;n--)if(null!==e[n]){if(null!=e[n][2]||null!=e[n][3]){if(c.settings.allowInsertRow)for(;e[n][0]>m.countRows()-1;)d.createRow();if("array"===m.dataType&&c.settings.allowInsertColumn)for(;d.propToCol(e[n][1])>m.countCols()-1;)d.createCol();d.set(e[n][0],e[n][1],e[n][3])}}else e.splice(n,1);m.forceFullRender=!0,f.adjustRowsAndCols(),Handsontable.hooks.run(m,"beforeChangeRender",e,t), -p.refreshBorders(null,!0),m.view.wt.wtOverlays.adjustElementsSize(),Handsontable.hooks.run(m,"afterChange",e,t||"edit")}}function i(e,t,n){return"object"==typeof e?e:[[e,t,n]]}function s(e){if(e.hasOwnProperty("type")){var t,n={};if("object"==typeof e.type)t=e.type;else if("string"==typeof e.type&&(t=Handsontable.cellTypes[e.type],void 0===t))throw new Error('You declared cell type "'+e.type+'" as a string that is not mapped to a known object. Cell type must be an object or a string mapped to an object in Handsontable.cellTypes');for(var o in t)t.hasOwnProperty(o)&&!e.hasOwnProperty(o)&&(n[o]=t[o]);return n}}function a(e){return Handsontable.hooks.run(m,"modifyRow",e)}function l(e){return Handsontable.hooks.run(m,"modifyCol",e)}function u(){throw new Error("This method cannot be called because this Handsontable instance has been destroyed")}var c,d,h,f,p,g,m=this,v=function(){},w=D(m);A(v.prototype,Z.prototype),A(v.prototype,t),A(v.prototype,s(t)),this.rootElement=e,this.isHotTableEnv=T(this.rootElement),Handsontable.eventManager.isHotTableEnv=this.isHotTableEnv,this.container=document.createElement("DIV"),this.renderCall=!1,e.insertBefore(this.container,e.firstChild),this.guid="ht_"+B(),this.rootElement.id&&"ht_"!==this.rootElement.id.substring(0,3)||(this.rootElement.id=this.guid),c={cellSettings:[],columnSettings:[],columnsSettingConflicts:["data","width"],settings:new v,selRange:null,isPopulated:null,scrollable:null,firstRun:!0},f={alter:function(e,t,n,o,r){var i;switch(n=n||1,e){case"insert_row":if(m.getSettings().maxRows===m.countSourceRows())return;i=d.createRow(t,n),i&&(p.isSelected()&&c.selRange.from.row>=t?(c.selRange.from.row=c.selRange.from.row+i,p.transformEnd(i,0)):p.refreshBorders());break;case"insert_col":if(i=d.createCol(t,n)){if(Array.isArray(m.getSettings().colHeaders)){var s=[t,0];s.length+=i,Array.prototype.splice.apply(m.getSettings().colHeaders,s)}p.isSelected()&&c.selRange.from.col>=t?(c.selRange.from.col=c.selRange.from.col+i,p.transformEnd(0,i)):p.refreshBorders()}break;case"remove_row":d.removeRow(t,n),c.cellSettings.splice(t,n);var a=m.countRows(),l=m.getSettings().fixedRowsTop;l>=t+1&&(m.getSettings().fixedRowsTop-=Math.min(n,l-t));var u=m.getSettings().fixedRowsBottom;u&&t+1>=a-u&&(m.getSettings().fixedRowsBottom-=Math.min(n,u-t)),f.adjustRowsAndCols(),p.refreshBorders();break;case"remove_col":d.removeCol(t,n);for(var h=0,g=d.getAll().length;g>h;h++)h in c.cellSettings&&c.cellSettings[h].splice(t,n);var v=m.getSettings().fixedColumnsLeft;v>=t+1&&(m.getSettings().fixedColumnsLeft-=Math.min(n,v-t)),Array.isArray(m.getSettings().colHeaders)&&("undefined"==typeof t&&(t=-1),m.getSettings().colHeaders.splice(t,n)),f.adjustRowsAndCols(),p.refreshBorders();break;default:throw new Error('There is no such action "'+e+'"')}r||f.adjustRowsAndCols()},adjustRowsAndCols:function(){if(c.settings.minRows){var e=m.countRows();if(et;t++)d.createRow(m.countRows(),1,!0)}if(c.settings.minSpareRows){var o=m.countEmptyRows(!0);if(oi-1?(l=i-1,a=!0,h>l&&(h=l)):h>i-1&&(h=i-1,a=!0,l>h&&(l=h)),u>s-1?(u=s-1,a=!0,f>u&&(f=u)):f>s-1&&(f=s-1,a=!0,u>f&&(u=f)),a&&m.selectCell(l,u,h,f)}m.view&&m.view.wt.wtOverlays.adjustElementsSize()},populateFromArray:function(e,t,n,o,r,i,s){var a,l,u,d,h=[],f={};if(l=t.length,0===l)return!1;var p,g,v,w;({row:null===n?null:n.row,col:null===n?null:n.col});switch(r){case"shift_down":for(p=n?n.col-e.col+1:0,g=n?n.row-e.row+1:0,t=U(t),u=0,d=t.length,v=Math.max(d,p);v>u;u++)if(d>u){for(a=0,l=t[u].length;g-l>a;a++)t[u].push(t[u][a%l]);t[u].unshift(e.col+u,e.row,0),m.spliceCol.apply(m,t[u])}else t[u%d][0]=e.col+u,m.spliceCol.apply(m,t[u%d]);break;case"shift_right":for(p=n?n.col-e.col+1:0,g=n?n.row-e.row+1:0,a=0,l=t.length,w=Math.max(l,g);w>a;a++)if(l>a){for(u=0,d=t[a].length;p-d>u;u++)t[a].push(t[a][u%d]);t[a].unshift(e.row+a,e.col,0),m.spliceRow.apply(m,t[a])}else t[a%l][0]=e.row+a,m.spliceRow.apply(m,t[a%l]);break;case"overwrite":default:f.row=e.row,f.col=e.col;var y,b={row:n&&e?n.row-e.row+1:1,col:n&&e?n.col-e.col+1:1},C=0,R=0,_=!0,S=function(e){var n=void 0!==arguments[1]?arguments[1]:null,o=t[e%t.length];return null!==n?o[n%o.length]:o},E=t.length,T=n?n.row-e.row+1:0;for(l=n?T:Math.max(E,T),a=0;l>a&&!(n&&f.row>n.row&&T>E||!c.settings.allowInsertRow&&f.row>m.countRows()-1||f.row>=c.settings.maxRows);a++){var O=a-C,M=S(O).length,k=n?n.col-e.col+1:0;if(d=n?k:Math.max(M,k),f.col=e.col,y=m.getCellMeta(f.row,f.col),"paste"!==o&&"autofill"!==o||!y.skipRowOnPaste){for(R=0,u=0;d>u&&!(n&&f.col>n.col&&k>M||!c.settings.allowInsertColumn&&f.col>m.countCols()-1||f.col>=c.settings.maxCols);u++)if(y=m.getCellMeta(f.row,f.col),"paste"!==o&&"autofill"!==o||!y.skipColumnOnPaste)if(y.readOnly)f.col++;else{var H=u-R,D=S(O,H),x=m.getDataAtCell(f.row,f.col),A={row:O,col:H};if("autofill"===o){var W=m.runHooks("beforeAutofillInsidePopulate",A,i,t,s,{},b);W&&(D="undefined"==typeof W.value?D:W.value)}if(null!==D&&"object"==typeof D)if(null===x||"object"!=typeof x)_=!1;else{var I=P(x[0]||x),j=P(D[0]||D);N(I,j)?D=L(D):_=!1}else null!==x&&"object"==typeof x&&(_=!1);_&&h.push([f.row,f.col,D]),_=!0,f.col++}else R++,f.col++,d++;f.row++}else C++,f.row++,l++}m.setDataAtCell(h,null,null,o||"populateFromArray")}}},this.selection=p={inProgress:!1,selectedHeader:{cols:!1,rows:!1},setSelectedHeaders:function(e,t){m.selection.selectedHeader.rows=e,m.selection.selectedHeader.cols=t},begin:function(){m.selection.inProgress=!0},finish:function(){var e=m.getSelected();Handsontable.hooks.run(m,"afterSelectionEnd",e[0],e[1],e[2],e[3]),Handsontable.hooks.run(m,"afterSelectionEndByProp",e[0],m.colToProp(e[1]),e[2],m.colToProp(e[3])),m.selection.inProgress=!1},isInProgress:function(){return m.selection.inProgress},setRangeStart:function(e,t){Handsontable.hooks.run(m,"beforeSetRangeStart",e),c.selRange=new X(e,e,e),p.setRangeEnd(e,null,t)},setRangeEnd:function(e,t,n){if(null!==c.selRange){var o,r=!1,i=!0,s=m.view.wt.wtTable.getFirstVisibleRow(),a=m.view.wt.wtTable.getFirstVisibleColumn(),l={row:null,col:null};Handsontable.hooks.run(m,"beforeSetRangeEnd",e),m.selection.begin(),l.row=e.row<0?s:e.row,l.col=e.col<0?a:e.col,c.selRange.to=new K(l.row,l.col),c.settings.multiSelect||(c.selRange.from=e),m.view.wt.selections.current.clear(),o=m.getCellMeta(c.selRange.highlight.row,c.selRange.highlight.col).disableVisualSelection,"string"==typeof o&&(o=[o]),(o===!1||Array.isArray(o)&&-1===o.indexOf("current"))&&m.view.wt.selections.current.add(c.selRange.highlight),m.view.wt.selections.area.clear(),(o===!1||Array.isArray(o)&&-1===o.indexOf("area"))&&p.isMultiple()&&(m.view.wt.selections.area.add(c.selRange.from),m.view.wt.selections.area.add(c.selRange.to)),(c.settings.currentRowClassName||c.settings.currentColClassName)&&(m.view.wt.selections.highlight.clear(),m.view.wt.selections.highlight.add(c.selRange.from),m.view.wt.selections.highlight.add(c.selRange.to)),Handsontable.hooks.run(m,"afterSelection",c.selRange.from.row,c.selRange.from.col,c.selRange.to.row,c.selRange.to.col),Handsontable.hooks.run(m,"afterSelectionByProp",c.selRange.from.row,d.colToProp(c.selRange.from.col),c.selRange.to.row,d.colToProp(c.selRange.to.col)),(0===c.selRange.from.row&&c.selRange.to.row===m.countRows()-1&&m.countRows()>1||0===c.selRange.from.col&&c.selRange.to.col===m.countCols()-1&&m.countCols()>1)&&(r=!0),(e.row<0||e.col<0)&&(i=!1),t!==!1&&!r&&i&&(c.selRange.from&&!p.isMultiple()?m.view.scrollViewport(c.selRange.from):m.view.scrollViewport(e)),p.refreshBorders(null,n)}},refreshBorders:function(e,t){t||g.destroyEditor(e),m.view.render(),p.isSelected()&&!t&&g.prepareEditor()},isMultiple:function(){var e=!(c.selRange.to.col===c.selRange.from.col&&c.selRange.to.row===c.selRange.from.row),t=Handsontable.hooks.run(m,"afterIsMultipleSelection",e);return e?t:void 0},transformStart:function(e,t,n,o){var r,i,s,a,l=new K(e,t),u=0,d=0;m.runHooks("modifyTransformStart",l),r=m.countRows(),i=m.countCols(),a=m.getSettings().fixedRowsBottom,c.selRange.highlight.row+e>r-1?n&&c.settings.minSpareRows>0&&!(a&&c.selRange.highlight.row>=r-a-1)?(m.alter("insert_row",r),r=m.countRows()):c.settings.autoWrapCol&&(l.row=1-r,l.col=c.selRange.highlight.col+l.col==i-1?1-i:1):c.settings.autoWrapCol&&c.selRange.highlight.row+l.row<0&&c.selRange.highlight.col+l.col>=0&&(l.row=r-1,l.col=c.selRange.highlight.col+l.col==0?i-1:-1),c.selRange.highlight.col+l.col>i-1?n&&c.settings.minSpareCols>0?(m.alter("insert_col",i),i=m.countCols()):c.settings.autoWrapRow&&(l.row=c.selRange.highlight.row+l.row==r-1?1-r:1,l.col=1-i):c.settings.autoWrapRow&&c.selRange.highlight.col+l.col<0&&c.selRange.highlight.row+l.row>=0&&(l.row=c.selRange.highlight.row+l.row==0?r-1:-1,l.col=i-1),s=new K(c.selRange.highlight.row+l.row,c.selRange.highlight.col+l.col),s.row<0?(u=-1,s.row=0):s.row>0&&s.row>=r&&(u=1,s.row=r-1),s.col<0?(d=-1,s.col=0):s.col>0&&s.col>=i&&(d=1,s.col=i-1),m.runHooks("afterModifyTransformStart",s,u,d),p.setRangeStart(s,o)},transformEnd:function(e,t){var n,o,r,i=new K(e,t),s=0,a=0;m.runHooks("modifyTransformEnd",i),n=m.countRows(),o=m.countCols(),r=new K(c.selRange.to.row+i.row,c.selRange.to.col+i.col),r.row<0?(s=-1,r.row=0):r.row>0&&r.row>=n&&(s=1,r.row=n-1),r.col<0?(a=-1,r.col=0):r.col>0&&r.col>=o&&(a=1,r.col=o-1),m.runHooks("afterModifyTransformEnd",r,s,a),p.setRangeEnd(r,!0)},isSelected:function(){return null!==c.selRange},inInSelection:function(e){return p.isSelected()?c.selRange.includes(e):!1},deselect:function(){p.isSelected()&&(m.selection.inProgress=!1,c.selRange=null,m.view.wt.selections.current.clear(),m.view.wt.selections.area.clear(),(c.settings.currentRowClassName||c.settings.currentColClassName)&&m.view.wt.selections.highlight.clear(),g.destroyEditor(),p.refreshBorders(),Handsontable.hooks.run(m,"afterDeselect"))},selectAll:function(){c.settings.multiSelect&&(p.setRangeStart(new K(0,0)),p.setRangeEnd(new K(m.countRows()-1,m.countCols()-1),!1))},empty:function(){if(p.isSelected()){var e,t,n=c.selRange.getTopLeftCorner(),o=c.selRange.getBottomRightCorner(),r=[];for(e=n.row;e<=o.row;e++)for(t=n.col;t<=o.col;t++)m.getCellMeta(e,t).readOnly||r.push([e,t,""]);m.setDataAtCell(r)}}},this.init=function(){h=new z(m,c.settings.data),Handsontable.hooks.run(m,"beforeInit"),Handsontable.mobileBrowser&&S(m.rootElement,"mobile"),this.updateSettings(c.settings,!0),this.view=new V(this),g=new H(m,c,p,d),this.forceFullRender=!0,Handsontable.hooks.run(m,"init"),this.view.render(),"object"==typeof c.firstRun&&(Handsontable.hooks.run(m,"afterChange",c.firstRun[0],c.firstRun[1]),c.firstRun=!1),Handsontable.hooks.run(m,"afterInit")},this.validateCell=function(e,t,n,o){function r(e){var o=t.physicalCol,r=t.physicalRow,i=m.getCell(r,o,!0);i&&m.view.wt.wtSettings.settings.cellRenderer(r,o,i),n(e)}var i=m.getCellValidator(t);"[object RegExp]"===Object.prototype.toString.call(i)&&(i=function(e){return function(t,n){n(e.test(t))}}(i)),"function"==typeof i?(e=Handsontable.hooks.run(m,"beforeValidate",e,t.row,t.prop,o),m._registerTimeout(setTimeout(function(){i.call(t,e,function(n){n=Handsontable.hooks.run(m,"afterValidate",n,e,t.row,t.prop,o),t.valid=n,r(n),Handsontable.hooks.run(m,"postAfterValidate",n,e,t.row,t.prop,o)})},0))):(t.valid=!0,r(t.valid))},this.setDataAtCell=function(e,t,n,s){var a,l,u,c=i(e,t,n),h=[];for(a=0,l=c.length;l>a;a++){if("object"!=typeof c[a])throw new Error("Method `setDataAtCell` accepts row number or changes array of arrays as its first parameter");if("number"!=typeof c[a][1])throw new Error("Method `setDataAtCell` accepts row and column number as its parameters. If you want to use object property name, use method `setDataAtRowProp`");u=d.colToProp(c[a][1]),h.push([c[a][0],u,d.get(c[a][0],u),c[a][2]])}s||"object"!=typeof e||(s=t),o(h,s,function(){r(h,s)})},this.setDataAtRowProp=function(e,t,n,s){var a,l,u=i(e,t,n),c=[];for(a=0,l=u.length;l>a;a++)c.push([u[a][0],u[a][1],d.get(u[a][0],u[a][1]),u[a][2]]);s||"object"!=typeof e||(s=t),o(c,s,function(){r(c,s)})},this.listen=function(){Handsontable.activeGuid=m.guid},this.unlisten=function(){Handsontable.activeGuid=null},this.isListening=function(){return Handsontable.activeGuid===m.guid},this.destroyEditor=function(e){p.refreshBorders(e)},this.populateFromArray=function(e,t,n,o,r,i,s,a,l){var u;if("object"!=typeof n||"object"!=typeof n[0])throw new Error("populateFromArray parameter `input` must be an array of arrays");return u="number"==typeof o?new K(o,r):null,f.populateFromArray(new K(e,t),n,u,i,s,a,l)},this.spliceCol=function(e,t,n){return d.spliceCol.apply(d,arguments)},this.spliceRow=function(e,t,n){return d.spliceRow.apply(d,arguments)},this.getSelected=function(){return p.isSelected()?[c.selRange.from.row,c.selRange.from.col,c.selRange.to.row,c.selRange.to.col]:void 0},this.getSelectedRange=function(){return p.isSelected()?c.selRange:void 0},this.render=function(){m.view&&(m.renderCall=!0,m.forceFullRender=!0,p.refreshBorders(null,!0))},this.loadData=function(e){function t(){c.cellSettings.length=0}if("object"==typeof e&&null!==e)e.push&&e.splice||(e=[e]);else{if(null!==e)throw new Error("loadData only accepts array of objects or array of arrays ("+typeof e+" given)");e=[];for(var n,o=0,r=c.settings.startRows;r>o;o++){n=[];for(var i=0,s=c.settings.startCols;s>i;i++)n.push(null);e.push(n)}}c.isPopulated=!1,v.prototype.data=e,Array.isArray(c.settings.dataSchema)||Array.isArray(e[0])?m.dataType="array":"function"==typeof c.settings.dataSchema?m.dataType="function":m.dataType="object",d=new k(m,c,v),h.data=e,h.dataType=m.dataType,h.colToProp=d.colToProp.bind(d),h.propToCol=d.propToCol.bind(d),t(),f.adjustRowsAndCols(),Handsontable.hooks.run(m,"afterLoadData",c.firstRun),c.firstRun?c.firstRun=[null,"loadData"]:(Handsontable.hooks.run(m,"afterChange",null,"loadData"),m.render()),c.isPopulated=!0},this.getData=function(e,t,n,o){return"undefined"==typeof e?d.getAll():d.getRange(new K(e,t),new K(n,o),d.DESTINATION_RENDERER)},this.getCopyableText=function(e,t,n,o){return d.getCopyableText(new K(e,t),new K(n,o))},this.getCopyableData=function(e,t){return d.getCopyable(e,d.colToProp(t))},this.getSchema=function(){return d.getSchema()},this.updateSettings=function(e,t){var n,o;if("undefined"!=typeof e.rows)throw new Error('"rows" setting is no longer supported. do you mean startRows, minRows or maxRows?');if("undefined"!=typeof e.cols)throw new Error('"cols" setting is no longer supported. do you mean startCols, minCols or maxCols?');for(n in e)"data"!==n&&(Handsontable.hooks.getRegistered().indexOf(n)>-1?("function"==typeof e[n]||Array.isArray(e[n]))&&m.addHook(n,e[n]):!t&&e.hasOwnProperty(n)&&(v.prototype[n]=e[n]));if(void 0===e.data&&void 0===c.settings.data?m.loadData(null):void 0!==e.data?m.loadData(e.data):void 0!==e.columns&&d.createMap(),o=m.countCols(),c.cellSettings.length=0,o>0){var r,i;for(n=0;o>n;n++)c.columnSettings[n]=M(v,c.columnsSettingConflicts),r=c.columnSettings[n].prototype,v.prototype.columns&&(i=v.prototype.columns[n],A(r,i),A(r,s(i)))}if("undefined"!=typeof e.cell)for(n in e.cell)if(e.cell.hasOwnProperty(n)){var a=e.cell[n];m.setCellMetaObject(a.row,a.col,a)}if(Handsontable.hooks.run(m,"afterCellMetaReset"),"undefined"!=typeof e.className&&(v.prototype.className&&O(m.rootElement,v.prototype.className),e.className&&S(m.rootElement,e.className)),"undefined"!=typeof e.height){var l=e.height;"function"==typeof l&&(l=l()),m.rootElement.style.height=l+"px"}if("undefined"!=typeof e.width){var u=e.width;"function"==typeof u&&(u=u()),m.rootElement.style.width=u+"px"}l&&(m.rootElement.style.overflow="hidden"),t||Handsontable.hooks.run(m,"afterUpdateSettings"),f.adjustRowsAndCols(),m.view&&!c.firstRun&&(m.forceFullRender=!0,p.refreshBorders(null,!0))},this.getValue=function(){var e=m.getSelected();if(v.prototype.getValue){if("function"==typeof v.prototype.getValue)return v.prototype.getValue.call(m);if(e)return m.getData()[e[0]][v.prototype.getValue]}else if(e)return m.getDataAtCell(e[0],e[1])},this.getSettings=function(){return c.settings},this.clear=function(){p.selectAll(),p.empty()},this.alter=function(e,t,n,o,r){f.alter(e,t,n,o,r)},this.getCell=function(e,t,n){return m.view.getCellAtCoords(new K(e,t),n)},this.getCoords=function(e){return this.view.wt.wtTable.getCoords.call(this.view.wt.wtTable,e)},this.colToProp=function(e){return d.colToProp(e)},this.propToCol=function(e){return d.propToCol(e)},this.getDataAtCell=function(e,t){return d.get(e,d.colToProp(t))},this.getDataAtRowProp=function(e,t){return d.get(e,t)},this.getDataAtCol=function(e){var t=[];return t.concat.apply(t,d.getRange(new K(0,e),new K(c.settings.data.length-1,e),d.DESTINATION_RENDERER))},this.getDataAtProp=function(e){var t,n=[];return t=d.getRange(new K(0,d.propToCol(e)),new K(c.settings.data.length-1,d.propToCol(e)),d.DESTINATION_RENDERER),n.concat.apply(n,t)},this.getSourceData=function(e,t,n,o){var r;return r=void 0===e?h.getData():h.getByRange(new K(e,t),new K(n,o))},this.getSourceDataAtCol=function(e){return h.getAtColumn(e)},this.getSourceDataAtRow=function(e){return h.getAtRow(e)},this.getSourceDataAtCell=function(e,t){return h.getAtCell(e,t)},this.getDataAtRow=function(e){var t=d.getRange(new K(e,0),new K(e,this.countCols()-1),d.DESTINATION_RENDERER);return t[0]},this.getDataType=function(e,t,n,o){var r=this,i=null,s=null;void 0===e&&(e=0,n=this.countRows(),t=0,o=this.countCols()),void 0===n&&(n=e),void 0===o&&(o=t);var a="mixed";return F(Math.min(e,n),Math.max(e,n),function(e){var n=!0;return F(Math.min(t,o),Math.max(t,o),function(t){var o=r.getCellMeta(e,t);return s=o.type,i?n=i===s:i=s,n}),a=n?s:"mixed",n}),a},this.removeCellMeta=function(e,t,n){var o=m.getCellMeta(e,t);void 0!=o[n]&&delete c.cellSettings[e][t][n]},this.setCellMetaObject=function(e,t,n){if("object"==typeof n)for(var o in n)if(n.hasOwnProperty(o)){var r=n[o];this.setCellMeta(e,t,o,r)}},this.setCellMeta=function(e,t,n,o){c.cellSettings[e]||(c.cellSettings[e]=[]),c.cellSettings[e][t]||(c.cellSettings[e][t]=new c.columnSettings[t]),c.cellSettings[e][t][n]=o,Handsontable.hooks.run(m,"afterSetCellMeta",e,t,n,o)},this.getCellsMeta=function(){return W(c.cellSettings)},this.getCellMeta=function(e,t){var n,o=d.colToProp(t),r=e,i=t;if(e=a(e),t=l(t),c.columnSettings[t]||(c.columnSettings[t]=M(v,c.columnsSettingConflicts)),c.cellSettings[e]||(c.cellSettings[e]=[]),c.cellSettings[e][t]||(c.cellSettings[e][t]=new c.columnSettings[t]),n=c.cellSettings[e][t],n.row=e,n.col=t,n.physicalRow=r,n.physicalCol=i,n.prop=o,n.instance=m,Handsontable.hooks.run(m,"beforeGetCellMeta",e,t,n),A(n,s(n)),n.cells){var u=n.cells.call(n,e,t,o);u&&(A(n,u),A(n,s(u)))}return Handsontable.hooks.run(m,"afterGetCellMeta",e,t,n),n},this.isColumnModificationAllowed=function(){return!("object"===m.dataType||m.getSettings().columns)};var y=G("renderer");this.getCellRenderer=function(e,t){var n=y.call(this,e,t);return j(n)},this.getCellEditor=G("editor"),this.getCellValidator=G("validator"),this.validateCells=function(e){var t=new n;t.onQueueEmpty=e;for(var o=m.countRows()-1;o>=0;){for(var r=m.countCols()-1;r>=0;)t.addValidatorToQueue(),m.validateCell(m.getDataAtCell(o,r),m.getCellMeta(o,r),function(e){if("boolean"!=typeof e)throw new Error("Validation error: result is not boolean");e===!1&&(t.valid=!1),t.removeValidatorFormQueue()},"validateCells"),r--;o--}t.checkIfQueueIsEmpty()},this.getRowHeader=function(e){var t=c.settings.rowHeaders;return void 0!==e&&(e=Handsontable.hooks.run(m,"modifyRowHeader",e)),void 0===e?(t=[],F(m.countRows()-1,function(e){t.push(m.getRowHeader(e))})):Array.isArray(t)&&void 0!==t[e]?t=t[e]:"function"==typeof t?t=t(e):t&&"string"!=typeof t&&"number"!=typeof t&&(t=e+1),t},this.hasRowHeaders=function(){return!!c.settings.rowHeaders},this.hasColHeaders=function(){if(void 0!==c.settings.colHeaders&&null!==c.settings.colHeaders)return!!c.settings.colHeaders;for(var e=0,t=m.countCols();t>e;e++)if(m.getColHeader(e))return!0;return!1},this.getColHeader=function(e){if(e=Handsontable.hooks.run(m,"modifyColHeader",e),void 0===e){for(var t=[],n=0,o=m.countCols();o>n;n++)t.push(m.getColHeader(n));return t}var r=e;return e=Handsontable.hooks.run(m,"modifyCol",e),c.settings.columns&&c.settings.columns[e]&&c.settings.columns[e].title?c.settings.columns[e].title:Array.isArray(c.settings.colHeaders)&&void 0!==c.settings.colHeaders[e]?c.settings.colHeaders[e]:"function"==typeof c.settings.colHeaders?c.settings.colHeaders(e):c.settings.colHeaders&&"string"!=typeof c.settings.colHeaders&&"number"!=typeof c.settings.colHeaders?$(r):c.settings.colHeaders},this._getColWidthFromSettings=function(e){var t=m.getCellMeta(0,e),n=t.width;if((void 0===n||n===c.settings.width)&&(n=t.colWidths),void 0!==n&&null!==n){switch(typeof n){case"object":n=n[e];break;case"function":n=n(e)}"string"==typeof n&&(n=parseInt(n,10))}return n},this.getColWidth=function(e){var t=m._getColWidthFromSettings(e);return t=Handsontable.hooks.run(m,"modifyColWidth",t,e),void 0===t&&(t=q.DEFAULT_WIDTH),t},this._getRowHeightFromSettings=function(e){var t=c.settings.rowHeights;if(void 0!==t&&null!==t){switch(typeof t){case"object":t=t[e];break;case"function":t=t(e)}"string"==typeof t&&(t=parseInt(t,10))}return t},this.getRowHeight=function(e){var t=m._getRowHeightFromSettings(e);return t=Handsontable.hooks.run(m,"modifyRowHeight",t,e)},this.countSourceRows=function(){return m.getSourceData()?m.getSourceData().length:0},this.countRows=function(){return d.getLength()},this.countCols=function(){return"object"===m.dataType||"function"===m.dataType?c.settings.columns&&c.settings.columns.length?c.settings.columns.length:d.colToPropCache.length:"array"===m.dataType?c.settings.columns&&c.settings.columns.length?c.settings.columns.length:c.settings.data&&c.settings.data[0]&&c.settings.data[0].length?c.settings.data[0].length:0:void 0},this.getColspanOffset=function(e,t){var n=0;if(m.colspanArray){for(var o=0;e>o;o++)n+=m.colspanArray[t][o]-1||0;return n}for(var n=0,r=m.view.wt.wtTable.THEAD.childNodes.length-t-1,i=m.view.wt.wtTable.THEAD.querySelector("tr:nth-child("+parseInt(r+1,10)+")"),s=m.view.wt.wtSettings.settings.rowHeaders().length,o=s;s+e>o;o++)i.childNodes[o].hasAttribute("colspan")&&(n+=parseInt(i.childNodes[o].getAttribute("colspan"),10)-1);return n},this.getHeaderColspan=function(e,t){var n=m.view.wt.wtTable.THEAD.childNodes.length-t-1,o=m.view.wt.wtSettings.settings.rowHeaders().length,r=m.view.wt.wtTable.THEAD.querySelector("tr:nth-child("+parseInt(n+1,10)+")"),i=o+e-m.view.wt.wtViewport.columnsRenderCalculator.startColumn;return r.childNodes[i].hasAttribute("colspan")?parseInt(r.childNodes[i].getAttribute("colspan"),10):0},this.rowOffset=function(){return m.view.wt.wtTable.getFirstRenderedRow()},this.colOffset=function(){return m.view.wt.wtTable.getFirstRenderedColumn()},this.countRenderedRows=function(){return m.view.wt.drawn?m.view.wt.wtTable.getRenderedRowsCount():-1},this.countVisibleRows=function(){return m.view.wt.drawn?m.view.wt.wtTable.getVisibleRowsCount():-1},this.countRenderedCols=function(){return m.view.wt.drawn?m.view.wt.wtTable.getRenderedColumnsCount():-1},this.countVisibleCols=function(){return m.view.wt.drawn?m.view.wt.wtTable.getVisibleColumnsCount():-1},this.countEmptyRows=function(e){for(var t,n=m.countRows()-1,o=0;n>=0;){if(t=Handsontable.hooks.run(this,"modifyRow",n),m.isEmptyRow(t))o++;else if(e)break;n--}return o},this.countEmptyCols=function(e){if(m.countRows()<1)return 0;for(var t=m.countCols()-1,n=0;t>=0;){if(m.isEmptyCol(t))n++;else if(e)break;t--}return n},this.isEmptyRow=function(e){return c.settings.isEmptyRow.call(m,e)},this.isEmptyCol=function(e){return c.settings.isEmptyCol.call(m,e)},this.selectCell=function(e,t,n,o,r,i){var s;if(i="undefined"==typeof i||i===!0,"number"!=typeof e||0>e||e>=m.countRows())return!1;if("number"!=typeof t||0>t||t>=m.countCols())return!1;if("undefined"!=typeof n){if("number"!=typeof n||0>n||n>=m.countRows())return!1;if("number"!=typeof o||0>o||o>=m.countCols())return!1}return s=new K(e,t),c.selRange=new X(s,s,s),i&&m.listen(),"undefined"==typeof n?p.setRangeEnd(c.selRange.from,r):p.setRangeEnd(new K(n,o),r),m.selection.finish(),!0},this.selectCellByProp=function(e,t,n,o,r){return arguments[1]=d.propToCol(arguments[1]),"undefined"!=typeof arguments[3]&&(arguments[3]=d.propToCol(arguments[3])),m.selectCell.apply(m,arguments)},this.deselectCell=function(){p.deselect()},this.destroy=function(){m._clearTimeouts(),m.view&&m.view.destroy(),h&&h.destroy(),h=null,E(m.rootElement),w.destroy(),Handsontable.hooks.run(m,"afterDestroy"),Handsontable.hooks.destroy(m);for(var e in m)m.hasOwnProperty(e)&&("function"==typeof m[e]?m[e]=u:"guid"!==e&&(m[e]=null));c=null,d=null,f=null,p=null,g=null,m=null,v=null},this.getActiveEditor=function(){return g.getActiveEditor()},this.getPlugin=function(e){return I(this,e)},this.getInstance=function(){return m},this.addHook=function(e,t){Handsontable.hooks.add(e,t,m)},this.addHookOnce=function(e,t){Handsontable.hooks.once(e,t,m)},this.removeHook=function(e,t){Handsontable.hooks.remove(e,t,m)},this.runHooks=function(e,t,n,o,r,i,s){return Handsontable.hooks.run(m,e,t,n,o,r,i,s)},this.timeouts=[],this._registerTimeout=function(e){this.timeouts.push(e)},this._clearTimeouts=function(){for(var e=0,t=this.timeouts.length;t>e;e++)clearTimeout(this.timeouts[e])},this.version=Handsontable.version,Handsontable.hooks.run(m,"construct")};var Z=function(){};Z.prototype={data:void 0,dataSchema:void 0,width:void 0,height:void 0,startRows:5,startCols:5,rowHeaders:null,colHeaders:null,colWidths:void 0,rowHeights:void 0,columns:void 0,cells:void 0,cell:[],comments:!1,customBorders:!1,minRows:0,minCols:0,maxRows:1/0,maxCols:1/0,minSpareRows:0,minSpareCols:0,allowInsertRow:!0,allowInsertColumn:!0,allowRemoveRow:!0,allowRemoveColumn:!0,multiSelect:!0,fillHandle:!0,fixedRowsTop:0,fixedRowsBottom:0,fixedColumnsLeft:0,outsideClickDeselects:!0,enterBeginsEditing:!0,enterMoves:{row:1,col:0},tabMoves:{row:0,col:1},autoWrapRow:!1,autoWrapCol:!1,copyRowsLimit:1e3,copyColsLimit:1e3,pasteMode:"overwrite",persistentState:!1,currentRowClassName:void 0,currentColClassName:void 0,className:void 0,tableClassName:void 0,stretchH:"none",isEmptyRow:function(e){var t,n,o,r;for(t=0,n=this.countCols();n>t;t++)if(o=this.getDataAtCell(e,t),""!==o&&null!==o&&"undefined"!=typeof o)return"object"==typeof o?(r=this.getCellMeta(e,t),N(this.getSchema()[r.prop],o)):!1;return!0},isEmptyCol:function(e){var t,n,o;for(t=0,n=this.countRows();n>t;t++)if(o=this.getDataAtCell(t,e),""!==o&&null!==o&&"undefined"!=typeof o)return!1;return!0},observeDOMVisibility:!0,allowInvalid:!0,invalidCellClassName:"htInvalid",placeholder:!1,placeholderCellClassName:"htPlaceholder",readOnlyCellClassName:"htDimmed",renderer:void 0,commentedCellClassName:"htCommentCell",fragmentSelection:!1,readOnly:!1,skipColumnOnPaste:!1,search:!1,type:"text",copyable:!0,editor:void 0,autoComplete:void 0,visibleRows:10,trimDropdown:!0,debug:!1,wordWrap:!0,noWordWrapClassName:"htNoWrap",contextMenu:void 0,contextMenuCopyPaste:void 0,copyPaste:void 0,undo:void 0,columnSorting:void 0,manualColumnMove:void 0,manualColumnResize:void 0,manualRowMove:void 0,manualRowResize:void 0,mergeCells:!1,viewportRowRenderingOffset:"auto",viewportColumnRenderingOffset:"auto",validator:void 0,disableVisualSelection:!1,sortIndicator:!1,manualColumnFreeze:void 0,trimWhitespace:!0,settings:void 0,source:void 0,title:void 0,checkedTemplate:void 0,uncheckedTemplate:void 0,label:void 0,format:void 0,language:void 0,selectOptions:void 0,autoColumnSize:void 0,autoRowSize:void 0,dateFormat:void 0,correctFormat:!1,defaultDate:void 0,strict:void 0,renderAllRows:void 0},Handsontable.DefaultSettings=Z},{"3rdparty/walkontable/src/calculator/viewportColumns":3,"3rdparty/walkontable/src/cell/coords":5,"3rdparty/walkontable/src/cell/range":6,"3rdparty/walkontable/src/selection":18,dataMap:26,dataSource:27,editorManager:28,eventManager:41,"helpers/array":42,"helpers/data":44,"helpers/dom/element":45,"helpers/number":49,"helpers/object":50,"helpers/setting":51,"helpers/string":52,numeral:"numeral",plugins:57,renderers:88,tableView:97}],26:[function(e,t,n){"use strict";function o(e,t,n){this.instance=e,this.priv=t,this.GridSettings=n,this.dataSource=this.instance.getSettings().data,this.dataSource[0]?this.duckSchema=this.recursiveDuckSchema(this.dataSource[0]):this.duckSchema={},this.createMap()}Object.defineProperties(n,{DataMap:{get:function(){return o}},__esModule:{value:!0}});var r,i,s,a,l,u,c,d=(r=e("SheetClip"),r&&r.__esModule&&r||{"default":r})["default"],h=(i=e("helpers/data"),i&&i.__esModule&&i||{"default":i}).cellMethodLookupFactory,f=(s=e("helpers/setting"),s&&s.__esModule&&s||{"default":s}).columnFactory,p=(a=e("helpers/object"),a&&a.__esModule&&a||{"default":a}),g=p.duckSchema,m=p.deepExtend,v=(l=e("helpers/array"),l&&l.__esModule&&l||{"default":l}),w=v.extendArray,y=v.to2dArray,b=(u=e("helpers/number"),u&&u.__esModule&&u||{"default":u}).rangeEach,C=(c=e("multiMap"),c&&c.__esModule&&c||{"default":c}).MultiMap;o.prototype.DESTINATION_RENDERER=1,o.prototype.DESTINATION_CLIPBOARD_GENERATOR=2,o.prototype.recursiveDuckSchema=function(e){return g(e)},o.prototype.recursiveDuckColumns=function(e,t,n){var o,r;if("undefined"==typeof t&&(t=0,n=""),"object"==typeof e&&!Array.isArray(e))for(r in e)e.hasOwnProperty(r)&&(null===e[r]?(o=n+r,this.colToPropCache.push(o),this.propToColCache.set(o,t),t++):t=this.recursiveDuckColumns(e[r],t,r+"."));return t},o.prototype.createMap=function(){var e,t,n=this.getSchema();if("undefined"==typeof n)throw new Error("trying to create `columns` definition but you didnt' provide `schema` nor `data`");this.colToPropCache=[],this.propToColCache=new C;var o=this.instance.getSettings().columns;if(o)for(e=0,t=o.length;t>e;e++)"undefined"!=typeof o[e].data&&(this.colToPropCache[e]=o[e].data,this.propToColCache.set(o[e].data,e));else this.recursiveDuckColumns(n)},o.prototype.colToProp=function(e){return e=Handsontable.hooks.run(this.instance,"modifyCol",e),this.colToPropCache&&"undefined"!=typeof this.colToPropCache[e]?this.colToPropCache[e]:e},o.prototype.propToCol=function(e){var t;return t="undefined"==typeof this.propToColCache.get(e)?e:this.propToColCache.get(e),t=Handsontable.hooks.run(this.instance,"modifyCol",t)},o.prototype.getSchema=function(){var e=this.instance.getSettings().dataSchema;return e?"function"==typeof e?e():e:this.duckSchema},o.prototype.createRow=function(e,t,n){var o,r,i=this.instance.countCols(),s=0;t||(t=1),("number"!=typeof e||e>=this.instance.countSourceRows())&&(e=this.instance.countSourceRows()),r=e;for(var a=this.instance.getSettings().maxRows;t>s&&this.instance.countSourceRows()l;l++)o.push(null)}else"function"===this.instance.dataType?o=this.instance.getSettings().dataSchema(e):(o={},m(o,this.getSchema()));e===this.instance.countSourceRows()?this.dataSource.push(o):this.dataSource.splice(e,0,o),s++,r++}return Handsontable.hooks.run(this.instance,"afterCreateRow",e,s,n),this.instance.forceFullRender=!0,s},o.prototype.createCol=function(e,t,n){if(!this.instance.isColumnModificationAllowed())throw new Error("Cannot create new column. When data source in an object, you can only have as much columns as defined in first data row, data schema or in the 'columns' setting.If you want to be able to add new columns, you have to use array datasource."); -var o,r,i=this.instance.countSourceRows(),s=this.dataSource,a=0;t||(t=1),r=e;for(var l=this.instance.getSettings().maxCols;t>a&&this.instance.countCols()=this.instance.countCols()){for(var u=0;i>u;u++)"undefined"==typeof s[u]&&(s[u]=[]),s[u].push(null);this.priv.columnSettings.push(o)}else{for(var u=0;i>u;u++)s[u].splice(r,0,null);this.priv.columnSettings.splice(r,0,o)}a++,r++}return Handsontable.hooks.run(this.instance,"afterCreateCol",e,a,n),this.instance.forceFullRender=!0,a},o.prototype.removeRow=function(e,t){t||(t=1),"number"!=typeof e&&(e=-t),e=(this.instance.countSourceRows()+e)%this.instance.countSourceRows();var n=this.physicalRowsToLogical(e,t),o=Handsontable.hooks.run(this.instance,"beforeRemoveRow",e,t,n);if(o!==!1){var r=this.dataSource,i=r.filter(function(e,t){return-1==n.indexOf(t)});r.length=0,Array.prototype.push.apply(r,i),Handsontable.hooks.run(this.instance,"afterRemoveRow",e,t,n),this.instance.forceFullRender=!0}},o.prototype.removeCol=function(e,t){if("object"===this.instance.dataType||this.instance.getSettings().columns)throw new Error("cannot remove column with object data source or columns option specified");t||(t=1),"number"!=typeof e&&(e=-t),e=(this.instance.countCols()+e)%this.instance.countCols();var n=Handsontable.hooks.run(this.instance,"beforeRemoveCol",e,t);if(n!==!1){for(var o=this.dataSource,r=0,i=this.instance.countSourceRows();i>r;r++)o[r].splice(e,t);this.priv.columnSettings.splice(e,t),Handsontable.hooks.run(this.instance,"afterRemoveCol",e,t),this.instance.forceFullRender=!0}},o.prototype.spliceCol=function(e,t,n){var o=4<=arguments.length?[].slice.call(arguments,3):[],r=this.instance.getDataAtCol(e),i=r.slice(t,t+n),s=r.slice(t+n);w(o,s);for(var a=0;n>a;)o.push(null),a++;return y(o),this.instance.populateFromArray(t,e,o,null,null,"spliceCol"),i},o.prototype.spliceRow=function(e,t,n){var o=4<=arguments.length?[].slice.call(arguments,3):[],r=this.instance.getSourceDataAtRow(e),i=r.slice(t,t+n),s=r.slice(t+n);w(o,s);for(var a=0;n>a;)o.push(null),a++;return this.instance.populateFromArray(e,t,[o],null,null,"spliceRow"),i},o.prototype.get=function(e,t){if(e=Handsontable.hooks.run(this.instance,"modifyRow",e),"string"==typeof t&&t.indexOf(".")>-1){var n=t.split("."),o=this.dataSource[e];if(!o)return null;for(var r=0,i=n.length;i>r;r++)if(o=o[n[r]],"undefined"==typeof o)return null;return o}return"function"==typeof t?t(this.dataSource.slice(e,e+1)[0]):this.dataSource[e]&&this.dataSource[e].hasOwnProperty&&this.dataSource[e].hasOwnProperty(t)?this.dataSource[e][t]:null};var R=h("copyable",!1);o.prototype.getCopyable=function(e,t){return R.call(this.instance,e,this.propToCol(t))?this.get(e,t):""},o.prototype.set=function(e,t,n,o){if(e=Handsontable.hooks.run(this.instance,"modifyRow",e,o||"datamapGet"),"string"==typeof t&&t.indexOf(".")>-1){for(var r=t.split("."),i=this.dataSource[e],s=0,a=r.length-1;a>s;s++)"undefined"==typeof i[r[s]]&&(i[r[s]]={}),i=i[r[s]];i[r[s]]=n}else"function"==typeof t?t(this.dataSource.slice(e,e+1)[0],n):this.dataSource[e][t]=n},o.prototype.physicalRowsToLogical=function(e,t){for(var n,o=this.instance.countSourceRows(),r=(o+e)%o,i=[],s=t;o>r&&s;)n=Handsontable.hooks.run(this.instance,"modifyRow",r),i.push(n),s--,r++;return i},o.prototype.clear=function(){for(var e=0;e=o;o++){a=[];var c=Handsontable.hooks.run(this.instance,"modifyRow",o);for(i=Math.min(e.col,t.col);s>=i;i++){if(null===c)break;a.push(u.call(this,o,this.colToProp(i)))}null!==c&&l.push(a)}return l},o.prototype.getText=function(e,t){return d.stringify(this.getRange(e,t,this.DESTINATION_RENDERER))},o.prototype.getCopyableText=function(e,t){return d.stringify(this.getRange(e,t,this.DESTINATION_CLIPBOARD_GENERATOR))},Handsontable.DataMap=o},{SheetClip:"SheetClip","helpers/array":42,"helpers/data":44,"helpers/number":49,"helpers/object":50,"helpers/setting":51,multiMap:55}],27:[function(e,t,n){"use strict";Object.defineProperties(n,{DataSource:{get:function(){return f}},__esModule:{value:!0}});var o,r,i,s,a,l=((o=e("helpers/data"),o&&o.__esModule&&o||{"default":o}).cellMethodLookupFactory,(r=e("helpers/setting"),r&&r.__esModule&&r||{"default":r}).columnFactory,i=e("helpers/object"),i&&i.__esModule&&i||{"default":i}),u=(l.duckSchema,l.deepExtend,l.getProperty),c=(s=e("helpers/array"),s&&s.__esModule&&s||{"default":s}),d=(c.extendArray,c.arrayEach),h=(a=e("helpers/number"),a&&a.__esModule&&a||{"default":a}).rangeEach,f=function(e,t){this.hot=e,this.data=t,this.dataType="array",this.colToProp=function(){},this.propToCol=function(){}};$traceurRuntime.createClass(f,{getData:function(){return this.data},getAtColumn:function(e){var t=this,n=[];return d(this.data,function(o){var r=t.colToProp(e);o="string"==typeof r?u(o,r):o[r],n.push(o)}),n},getAtRow:function(e){return this.data[e]},getAtCell:function(e,t){return this.data[e][this.colToProp(t)]},getByRange:function(e,t){var n=this,o=Math.min(e.row,t.row),r=Math.min(e.col,t.col),i=Math.max(e.row,t.row),s=Math.max(e.col,t.col),a=[];return h(o,i,function(e){var t,o=n.getAtRow(e);"array"===n.dataType?t=o.slice(r,s):"object"===n.dataType&&(t={},h(r,s,function(e){var r=n.colToProp(e);t[r]=o[r]})),a.push(t)}),a},destroy:function(){this.data=null,this.hot=null}},{})},{"helpers/array":42,"helpers/data":44,"helpers/number":49,"helpers/object":50,"helpers/setting":51}],28:[function(e,t,n){"use strict";function o(e,t,n){function o(e){var o="function"==typeof t.settings.enterMoves?t.settings.enterMoves(event):t.settings.enterMoves;e?n.transformStart(-o.row,-o.col):n.transformStart(o.row,o.col,!0)}function r(e){e?n.transformEnd(-1,0):n.transformStart(-1,0)}function i(e){e?n.transformEnd(1,0):n.transformStart(1,0)}function s(e){e?n.transformEnd(0,1):n.transformStart(0,1)}function a(e){e?n.transformEnd(0,-1):n.transformStart(0,-1)}function l(l){var c,p;if(e.isListening()&&(Handsontable.hooks.run(e,"beforeKeyDown",l),!C&&!v(l)&&(t.lastKeyCode=l.keyCode,n.isSelected()))){if(c=(l.ctrlKey||l.metaKey)&&!l.altKey,y&&!y.isWaiting()&&!(h(l.keyCode)||f(l.keyCode)||c||b.isEditorOpened()))return void b.openEditor("",l);switch(p=l.shiftKey?n.setRangeEnd:n.setRangeStart,l.keyCode){case d.A:!b.isEditorOpened()&&c&&(n.selectAll(),l.preventDefault(),g(l));break;case d.ARROW_UP:b.isEditorOpened()&&!y.isWaiting()&&b.closeEditorAndSaveChanges(c),r(l.shiftKey),l.preventDefault(),g(l);break;case d.ARROW_DOWN:b.isEditorOpened()&&!y.isWaiting()&&b.closeEditorAndSaveChanges(c),i(l.shiftKey),l.preventDefault(),g(l);break;case d.ARROW_RIGHT:b.isEditorOpened()&&!y.isWaiting()&&b.closeEditorAndSaveChanges(c),s(l.shiftKey),l.preventDefault(),g(l);break;case d.ARROW_LEFT:b.isEditorOpened()&&!y.isWaiting()&&b.closeEditorAndSaveChanges(c),a(l.shiftKey),l.preventDefault(),g(l);break;case d.TAB:var w="function"==typeof t.settings.tabMoves?t.settings.tabMoves(l):t.settings.tabMoves;l.shiftKey?n.transformStart(-w.row,-w.col):n.transformStart(w.row,w.col,!0),l.preventDefault(),g(l);break;case d.BACKSPACE:case d.DELETE:n.empty(l),b.prepareEditor(),l.preventDefault();break;case d.F2:b.openEditor(null,l),y&&y.enableFullEditMode(),l.preventDefault();break;case d.ENTER:b.isEditorOpened()?(y&&y.state!==Handsontable.EditorState.WAITING&&b.closeEditorAndSaveChanges(c),o(l.shiftKey)):e.getSettings().enterBeginsEditing?(b.openEditor(null,l),y&&y.enableFullEditMode()):o(l.shiftKey),l.preventDefault(),m(l);break;case d.ESCAPE:b.isEditorOpened()&&b.closeEditorAndRestoreOriginalValue(c),l.preventDefault();break;case d.HOME:p(l.ctrlKey||l.metaKey?new u(0,t.selRange.from.col):new u(t.selRange.from.row,0)),l.preventDefault(),g(l);break;case d.END:p(l.ctrlKey||l.metaKey?new u(e.countRows()-1,t.selRange.from.col):new u(t.selRange.from.row,e.countCols()-1)),l.preventDefault(),g(l);break;case d.PAGE_UP:n.transformStart(-e.countVisibleRows(),0),l.preventDefault(),g(l);break;case d.PAGE_DOWN:n.transformStart(e.countVisibleRows(),0),l.preventDefault(),g(l)}}}function c(){function t(e,t,n){"TD"==n.nodeName&&(b.openEditor(),y&&y.enableFullEditMode())}e.addHook("afterDocumentKeyDown",l),p.addEventListener(document.documentElement,"keydown",function(t){e.runHooks("afterDocumentKeyDown",t)}),e.view.wt.update("onCellDblClick",t),e.addHook("afterDestroy",function(){C=!0})}var p,y,b=this,C=!1;p=w(e),this.destroyEditor=function(e){this.closeEditor(e)},this.getActiveEditor=function(){return y},this.prepareEditor=function(){var n,o,r,i,s,a,l;return y&&y.isWaiting()?void this.closeEditor(!1,!1,function(e){e&&b.prepareEditor()}):(n=t.selRange.highlight.row,o=t.selRange.highlight.col,r=e.colToProp(o),i=e.getCell(n,o),s=e.getDataAtCell(n,o),a=e.getCellMeta(n,o),l=e.getCellEditor(a),void(l?(y=Handsontable.editors.getEditor(l,e),y.prepare(n,o,r,i,s,a)):y=void 0))},this.isEditorOpened=function(){return y&&y.isOpened()},this.openEditor=function(e,t){y&&!y.cellProperties.readOnly?y.beginEditing(e,t):y&&y.cellProperties.readOnly&&t&&t.keyCode===d.ENTER&&o()},this.closeEditor=function(e,t,n){y?y.finishEditing(e,t,n):n&&n(!1)},this.closeEditorAndSaveChanges=function(e){return this.closeEditor(!1,e)},this.closeEditorAndRestoreOriginalValue=function(e){return this.closeEditor(!0,e)},c()}Object.defineProperties(n,{EditorManager:{get:function(){return o}},__esModule:{value:!0}});var r,i,s,a,l,u=(r=e("3rdparty/walkontable/src/cell/coords"),r&&r.__esModule&&r||{"default":r}).WalkontableCellCoords,c=(i=e("helpers/unicode"),i&&i.__esModule&&i||{"default":i}),d=c.KEY_CODES,h=c.isMetaKey,f=c.isCtrlKey,p=(s=e("helpers/dom/event"),s&&s.__esModule&&s||{"default":s}),g=p.stopPropagation,m=p.stopImmediatePropagation,v=p.isImmediatePropagationStopped,w=((a=e("editors"),a&&a.__esModule&&a||{"default":a}).getEditor,(l=e("eventManager"),l&&l.__esModule&&l||{"default":l}).eventManager);Handsontable.EditorManager=o},{"3rdparty/walkontable/src/cell/coords":5,editors:29,eventManager:41,"helpers/dom/event":46,"helpers/unicode":53}],29:[function(e,t,n){"use strict";function o(e){var t,n;n={},t=e,this.getConstructor=function(){return e},this.getInstance=function(e){return e.guid in n||(n[e.guid]=new t(e)),n[e.guid]}}function r(e,t){var n=new o(t);"string"==typeof e&&(c[e]=n,Handsontable.editors[u(e)+"Editor"]=t),d.set(t,n)}function i(e,t){var n;if("function"==typeof e)d.get(e)||r(null,e),n=d.get(e);else{if("string"!=typeof e)throw Error('Only strings and functions can be passed as "editor" parameter ');n=c[e]}if(!n)throw Error('No editor registered under name "'+e+'"');return n.getInstance(t)}function s(e){var t;if("string"!=typeof e)throw Error('Only strings and functions can be passed as "editor" parameter ');if(t=c[e],!t)throw Error('No editor registered under name "'+e+'"');return t.getConstructor()}function a(e){return c[e]?!0:!1}Object.defineProperties(n,{registerEditor:{get:function(){return r}},getEditor:{get:function(){return i}},hasEditor:{get:function(){return a}},getEditorConstructor:{get:function(){return s}},__esModule:{value:!0}});var l,u=(l=e("helpers/string"),l&&l.__esModule&&l||{"default":l}).toUpperCaseFirst,c={},d=new WeakMap;Handsontable.editors=Handsontable.editors||{},Handsontable.editors.registerEditor=r,Handsontable.editors.getEditor=i},{"helpers/string":52}],30:[function(e,t,n){"use strict";function o(e){this.instance=e,this.state=Handsontable.EditorState.VIRGIN,this._opened=!1,this._fullEditMode=!1,this._closeCallback=null,this.init()}Object.defineProperties(n,{BaseEditor:{get:function(){return o}},__esModule:{value:!0}});var r,i,s=(r=e("helpers/mixed"),r&&r.__esModule&&r||{"default":r}).stringify,a=(i=e("3rdparty/walkontable/src/cell/coords"),i&&i.__esModule&&i||{"default":i}).WalkontableCellCoords;Handsontable.editors=Handsontable.editors||{},Handsontable.editors.BaseEditor=o,Handsontable.EditorState={VIRGIN:"STATE_VIRGIN",EDITING:"STATE_EDITING",WAITING:"STATE_WAITING",FINISHED:"STATE_FINISHED"},o.prototype._fireCallbacks=function(e){this._closeCallback&&(this._closeCallback(e),this._closeCallback=null)},o.prototype.init=function(){},o.prototype.getValue=function(){throw Error("Editor getValue() method unimplemented")},o.prototype.setValue=function(e){throw Error("Editor setValue() method unimplemented")},o.prototype.open=function(){throw Error("Editor open() method unimplemented")},o.prototype.close=function(){throw Error("Editor close() method unimplemented")},o.prototype.prepare=function(e,t,n,o,r,i){this.TD=o,this.row=e,this.col=t,this.prop=n,this.originalValue=r,this.cellProperties=i,this.instance.view.isMouseDown()&&document.activeElement&&document.activeElement!==document.body?document.activeElement.blur():document.activeElement||document.body.focus(),this.state=Handsontable.EditorState.VIRGIN},o.prototype.extend=function(){function e(){n.apply(this,arguments)}function t(e,t){function n(){}return n.prototype=t.prototype,e.prototype=new n,e.prototype.constructor=e,e}var n=this.constructor;return t(e,n)},o.prototype.saveValue=function(e,t){var n,o;t?(n=this.instance.getSelected(),n[0]>n[2]&&(o=n[0],n[0]=n[2],n[2]=o),n[1]>n[3]&&(o=n[1],n[1]=n[3],n[3]=o),this.instance.populateFromArray(n[0],n[1],e,n[2],n[3],"edit")):this.instance.populateFromArray(this.row,this.col,e,null,null,"edit")},o.prototype.beginEditing=function(e,t){this.state==Handsontable.EditorState.VIRGIN&&(this.instance.view.scrollViewport(new a(this.row,this.col)),this.instance.view.render(),this.state=Handsontable.EditorState.EDITING,e="string"==typeof e?e:this.originalValue,this.setValue(s(e)),this.open(t),this._opened=!0,this.focus(),this.instance.view.render())},o.prototype.finishEditing=function(e,t,n){var o,r=this;if(n){var i=this._closeCallback;this._closeCallback=function(e){i&&i(e),n(e)}}if(!this.isWaiting()){if(this.state==Handsontable.EditorState.VIRGIN)return void this.instance._registerTimeout(setTimeout(function(){r._fireCallbacks(!0)},0));if(this.state==Handsontable.EditorState.EDITING){if(e)return this.cancelChanges(),void this.instance.view.render();o=this.instance.getSettings().trimWhitespace?[["string"==typeof this.getValue()?String.prototype.trim.call(this.getValue()||""):this.getValue()]]:[[this.getValue()]],this.state=Handsontable.EditorState.WAITING,this.saveValue(o,t),this.instance.getCellValidator(this.cellProperties)?this.instance.addHookOnce("postAfterValidate",function(e){r.state=Handsontable.EditorState.FINISHED,r.discardEditor(e)}):(this.state=Handsontable.EditorState.FINISHED,this.discardEditor(!0))}}},o.prototype.cancelChanges=function(){this.state=Handsontable.EditorState.FINISHED,this.discardEditor()},o.prototype.discardEditor=function(e){this.state===Handsontable.EditorState.FINISHED&&(e===!1&&this.cellProperties.allowInvalid!==!0?(this.instance.selectCell(this.row,this.col),this.focus(),this.state=Handsontable.EditorState.EDITING,this._fireCallbacks(!1)):(this.close(),this._opened=!1,this._fullEditMode=!1,this.state=Handsontable.EditorState.VIRGIN,this._fireCallbacks(!0)))},o.prototype.enableFullEditMode=function(){this._fullEditMode=!0},o.prototype.isInFullEditMode=function(){return this._fullEditMode},o.prototype.isOpened=function(){return this._opened},o.prototype.isWaiting=function(){return this.state===Handsontable.EditorState.WAITING},o.prototype.checkEditorSection=function(){var e=this.instance.countRows(),t="";return this.row=e-this.instance.getSettings().fixedRowsBottom?t=this.col"+a+"")))},autoColumnSize:!0,modifyColWidth:function(e,t){var o=this.getPlugin("autoColumnSize").widths;return o[t]&&(e=o[t]),n?e:e+15}}),this.htEditor.view.wt.wtTable.holder.parentNode.style["padding-right"]=w()+2+"px",T&&(T=!1),t.instance._registerTimeout(setTimeout(function(){t.queryChoices(t.TEXTAREA.value)},0))},E.prototype.close=function(){S.prototype.close.apply(this,arguments)},E.prototype.queryChoices=function(e){if(this.query=e,"function"==typeof this.cellProperties.source){var t=this;this.cellProperties.source(e,function(e){t.updateChoicesList(e)})}else if(Array.isArray(this.cellProperties.source)){var n;if(e&&this.cellProperties.filter!==!1){var o=this.cellProperties.filteringCaseSensitive===!0,r=e.toLowerCase();n=this.cellProperties.source.filter(function(t){return o?-1!=t.indexOf(e):-1!=t.toLowerCase().indexOf(r)})}else n=this.cellProperties.source;this.updateChoicesList(n)}else this.updateChoicesList([])},E.prototype.updateChoicesList=function(e){var t,n=v(this.TEXTAREA),o=y(this.TEXTAREA),r=E.sortByRelevance(this.getValue(),e,this.cellProperties.filteringCaseSensitive);if(0==this.cellProperties.filter)t=r[0];else{for(var i=[],s=0,a=r.length;a>s;s++)i.push(e[r[s]]);t=0,e=i}this.choices=e,this.htEditor.loadData(p([e])),this.updateDropdownHeight(),this.cellProperties.strict===!0&&this.highlightBestMatchingChoice(t),this.instance.listen(),this.TEXTAREA.focus(),C(this.TEXTAREA,n,n==o?void 0:o)},E.prototype.updateDropdownHeight=function(){var e=this.htEditor.getColWidth(0)+w()+2,t=void 0===this.cellProperties.trimDropdown?!0:this.cellProperties.trimDropdown;this.htEditor.updateSettings({height:this.getDropdownHeight(),width:t?void 0:e}),this.htEditor.view.wt.wtTable.alignOverlaysWithTrimmingContainer()},E.prototype.finishEditing=function(e){e||this.instance.removeHook("beforeKeyDown",o),S.prototype.finishEditing.apply(this,arguments)},E.prototype.highlightBestMatchingChoice=function(e){"number"==typeof e?this.htEditor.selectCell(e,0):this.htEditor.deselectCell()},E.sortByRelevance=function(e,t,n){var o,r,i,s,a,l=[],u=e.length,c=[];if(0===u){for(s=0,a=t.length;a>s;s++)c.push(s);return c}for(s=0,a=t.length;a>s;s++)o=f(t[s]),r=n?o.indexOf(e):o.toLowerCase().indexOf(e.toLowerCase()),-1!=r&&(i=o.length-r-u,l.push({baseIndex:s,index:r,charsLeft:i,value:o}));for(l.sort(function(e,t){return-1===t.index?-1:-1===e.index?1:e.indext.charsLeft?1:0:void 0}),s=0,a=l.length;a>s;s++)c.push(l[s].baseIndex);return c},E.prototype.getDropdownHeight=function(){var e=this.htEditor.getInstance().getRowHeight(0)||23,t=this.cellProperties.visibleRows;return this.choices.length>=t?t*e:this.choices.length*e+8},E.prototype.allowKeyEventPropagation=function(e){var t={row:this.htEditor.getSelectedRange()?this.htEditor.getSelectedRange().from.row:-1},n=!1;return e===d.ARROW_DOWN&&t.row-1&&(n=!0),n},_("autocomplete",E)},{editors:29,handsontableEditor:35,"helpers/array":42,"helpers/dom/element":45,"helpers/mixed":48,"helpers/unicode":53}],32:[function(e,t,n){"use strict";Object.defineProperties(n,{CheckboxEditor:{get:function(){return u}},__esModule:{value:!0}});var o,r,i,s=(o=e("editors"),o&&o.__esModule&&o||{"default":o}).registerEditor,a=(r=e("_baseEditor"),r&&r.__esModule&&r||{"default":r}).BaseEditor,l=(i=e("helpers/dom/element"),i&&i.__esModule&&i||{"default":i}).hasClass,u=function(){$traceurRuntime.superConstructor(c).apply(this,arguments)},c=u;$traceurRuntime.createClass(u,{beginEditing:function(){var e=this.TD.querySelector('input[type="checkbox"]');l(e,"htBadValue")||e.click()},finishEditing:function(){},init:function(){},open:function(){},close:function(){},getValue:function(){},setValue:function(){},focus:function(){}},{},a),s("checkbox",u)},{_baseEditor:30,editors:29,"helpers/dom/element":45}],33:[function(e,t,n){"use strict";Object.defineProperties(n,{DateEditor:{get:function(){return S}},__esModule:{value:!0}});var o,r,i,s,a,l,u,c,d,h=(o=e("helpers/dom/element"),o&&o.__esModule&&o||{"default":o}),f=h.addClass,p=h.outerHeight,g=(r=e("helpers/object"),r&&r.__esModule&&r||{"default":r}).deepExtend,m=(i=e("eventManager"),i&&i.__esModule&&i||{"default":i}).EventManager,v=(s=e("editors"),s&&s.__esModule&&s||{"default":s}),w=(v.getEditor,v.registerEditor),y=(a=e("helpers/unicode"),a&&a.__esModule&&a||{"default":a}).isMetaKey,b=(l=e("helpers/dom/event"),l&&l.__esModule&&l||{"default":l}).stopPropagation,C=(u=e("textEditor"),u&&u.__esModule&&u||{"default":u}).TextEditor,R=(c=e("moment"),c&&c.__esModule&&c||{"default":c})["default"],_=(d=e("pikaday"),d&&d.__esModule&&d||{"default":d})["default"];Handsontable.editors=Handsontable.editors||{},Handsontable.editors.DateEditor=S;var S=function(e){this.$datePicker=null,this.datePicker=null,this.datePickerStyle=null,this.defaultDateFormat="DD/MM/YYYY",this.isCellEdited=!1,this.parentDestroyed=!1,$traceurRuntime.superConstructor(E).call(this,e)},E=S;$traceurRuntime.createClass(S,{init:function(){var e=this;if("function"!=typeof R)throw new Error("You need to include moment.js to your project.");if("function"!=typeof _)throw new Error("You need to include Pikaday to your project.");$traceurRuntime.superGet(this,E.prototype,"init").call(this),this.instance.addHook("afterDestroy",function(){e.parentDestroyed=!0,e.destroyElements()})},createElements:function(){$traceurRuntime.superGet(this,E.prototype,"createElements").call(this),this.datePicker=document.createElement("DIV"),this.datePickerStyle=this.datePicker.style,this.datePickerStyle.position="absolute",this.datePickerStyle.top=0,this.datePickerStyle.left=0,this.datePickerStyle.zIndex=9999,f(this.datePicker,"htDatepickerHolder"),document.body.appendChild(this.datePicker),this.$datePicker=new _(this.getDatePickerConfig());var e=new m(this);e.addEventListener(this.datePicker,"mousedown",function(e){return b(e)}),this.hideDatepicker()},destroyElements:function(){this.$datePicker.destroy()},prepare:function(e,t,n,o,r,i){this._opened=!1,$traceurRuntime.superGet(this,E.prototype,"prepare").call(this,e,t,n,o,r,i)},open:function(){var e=void 0!==arguments[0]?arguments[0]:null;$traceurRuntime.superGet(this,E.prototype,"open").call(this),this.showDatepicker(e)},close:function(){var e=this;this._opened=!1,this.instance._registerTimeout(setTimeout(function(){e.instance.selection.refreshBorders()},0)),$traceurRuntime.superGet(this,E.prototype,"close").call(this)},finishEditing:function(){var e=void 0!==arguments[0]?arguments[0]:!1,t=void 0!==arguments[1]?arguments[1]:!1;if(e){var n=this.originalValue;void 0!==n&&this.setValue(n)}this.hideDatepicker(),$traceurRuntime.superGet(this,E.prototype,"finishEditing").call(this,e,t)},showDatepicker:function(e){this.$datePicker.config(this.getDatePickerConfig());var t,n=this.TD.getBoundingClientRect(),o=this.cellProperties.dateFormat||this.defaultDateFormat,r=this.$datePicker.config(),i=this.instance.view.isMouseDown(),s=e?y(e.keyCode):!1;this.datePickerStyle.top=window.pageYOffset+n.top+p(this.TD)+"px",this.datePickerStyle.left=window.pageXOffset+n.left+"px",this.$datePicker._onInputFocus=function(){},r.format=o,this.originalValue?(t=this.originalValue,R(t,o,!0).isValid()&&this.$datePicker.setMoment(R(t,o),!0),s||i||this.setValue("")):this.cellProperties.defaultDate?(t=this.cellProperties.defaultDate,r.defaultDate=t,R(t,o,!0).isValid()&&this.$datePicker.setMoment(R(t,o),!0),s||i||this.setValue("")):this.$datePicker.gotoToday(),this.datePickerStyle.display="block",this.$datePicker.show()},hideDatepicker:function(){this.datePickerStyle.display="none",this.$datePicker.hide()},getDatePickerConfig:function(){var e=this,t=this.TEXTAREA,n={};this.cellProperties&&this.cellProperties.datePickerConfig&&g(n,this.cellProperties.datePickerConfig);var o=n.onSelect,r=n.onClose;return n.field=t,n.trigger=t,n.container=this.datePicker,n.bound=!1,n.format=n.format||this.defaultDateFormat,n.reposition=n.reposition||!1,n.onSelect=function(t){isNaN(t.getTime())||(t=R(t).format(e.cellProperties.dateFormat||e.defaultDateFormat)),e.setValue(t),e.hideDatepicker(),o&&o()},n.onClose=function(){e.parentDestroyed||e.finishEditing(!1),r&&r()},n}},{},C),w("date",S)},{editors:29,eventManager:41,"helpers/dom/element":45,"helpers/dom/event":46,"helpers/object":50,"helpers/unicode":53,moment:"moment",pikaday:"pikaday",textEditor:40}],34:[function(e,t,n){"use strict";Object.defineProperties(n,{DropdownEditor:{get:function(){return l}},__esModule:{value:!0}});var o,r,i=(o=e("editors"),o&&o.__esModule&&o||{"default":o}),s=(i.getEditor,i.registerEditor),a=(r=e("autocompleteEditor"),r&&r.__esModule&&r||{"default":r}).AutocompleteEditor,l=function(){$traceurRuntime.superConstructor(u).apply(this,arguments)},u=l;$traceurRuntime.createClass(l,{prepare:function(e,t,n,o,r,i){$traceurRuntime.superGet(this,u.prototype,"prepare").call(this,e,t,n,o,r,i),this.cellProperties.filter=!1,this.cellProperties.strict=!0}},{},a),Handsontable.hooks.add("beforeValidate",function(e,t,n,o){var r=this.getCellMeta(t,n);r.editor===Handsontable.editors.DropdownEditor&&void 0===r.strict&&(r.filter=!1,r.strict=!0)}),s("dropdown",l)},{autocompleteEditor:31,editors:29}],35:[function(e,t,n){"use strict";Object.defineProperties(n,{HandsontableEditor:{get:function(){return w}},__esModule:{value:!0}});var o,r,i,s,a,l,u=(o=e("helpers/unicode"),o&&o.__esModule&&o||{"default":o}).KEY_CODES,c=(r=e("helpers/object"),r&&r.__esModule&&r||{"default":r}).extend,d=(i=e("helpers/dom/element"),i&&i.__esModule&&i||{"default":i}).setCaretPosition,h=(s=e("helpers/dom/event"),s&&s.__esModule&&s||{"default":s}),f=h.stopImmediatePropagation,p=h.isImmediatePropagationStopped,g=(a=e("editors"),a&&a.__esModule&&a||{"default":a}),m=(g.getEditor,g.registerEditor),v=(l=e("textEditor"),l&&l.__esModule&&l||{"default":l}).TextEditor,w=v.prototype.extend();w.prototype.createElements=function(){v.prototype.createElements.apply(this,arguments);var e=document.createElement("DIV");e.className="handsontableEditor",this.TEXTAREA_PARENT.appendChild(e),this.htContainer=e,this.assignHooks()},w.prototype.prepare=function(e,t,n,o,r,i){v.prototype.prepare.apply(this,arguments);var s=this,a={startRows:0,startCols:0,minRows:0,minCols:0,className:"listbox",copyPaste:!1,autoColumnSize:!1,autoRowSize:!1,readOnly:!0,fillHandle:!1,afterOnCellMouseDown:function(){var e=this.getValue();void 0!==e&&s.setValue(e),s.instance.destroyEditor()}};this.cellProperties.handsontable&&c(a,i.handsontable),this.htOptions=a};var y=function(e){if(!p(e)){var t,n=this.getActiveEditor(),o=n.htEditor.getInstance();if(e.keyCode==u.ARROW_DOWN)if(o.getSelected()){var r=o.getSelected()[0],i=o.countRows()-1;t=Math.min(i,r+1)}else t=0;else if(e.keyCode==u.ARROW_UP&&o.getSelected()){var r=o.getSelected()[0];t=r-1}void 0!==t&&(0>t?o.deselectCell():o.selectCell(t,0),o.getData().length&&(e.preventDefault(),f(e),n.instance.listen(),n.TEXTAREA.focus()))}};w.prototype.open=function(){this.instance.addHook("beforeKeyDown",y),v.prototype.open.apply(this,arguments),this.htEditor&&this.htEditor.destroy(),this.htEditor=new Handsontable(this.htContainer,this.htOptions),this.cellProperties.strict?(this.htEditor.selectCell(0,0),this.TEXTAREA.style.visibility="hidden"):(this.htEditor.deselectCell(),this.TEXTAREA.style.visibility="visible"),d(this.TEXTAREA,0,this.TEXTAREA.value.length)},w.prototype.close=function(){this.instance.removeHook("beforeKeyDown",y),this.instance.listen(),v.prototype.close.apply(this,arguments)},w.prototype.focus=function(){this.instance.listen(),v.prototype.focus.apply(this,arguments)},w.prototype.beginEditing=function(e){var t=this.instance.getSettings().onBeginEditing;t&&t()===!1||v.prototype.beginEditing.apply(this,arguments)},w.prototype.finishEditing=function(e,t){if(this.htEditor&&this.htEditor.isListening()&&this.instance.listen(),this.htEditor&&this.htEditor.getSelected()){var n=this.htEditor.getInstance().getValue();void 0!==n&&this.setValue(n)}return v.prototype.finishEditing.apply(this,arguments)},w.prototype.assignHooks=function(){var e=this;this.instance.addHook("afterDestroy",function(){e.htEditor&&e.htEditor.destroy()})},m("handsontable",w)},{editors:29,"helpers/dom/element":45,"helpers/dom/event":46,"helpers/object":50,"helpers/unicode":53,textEditor:40}],36:[function(e,t,n){"use strict";Object.defineProperties(n,{MobileTextEditor:{get:function(){return M}},__esModule:{value:!0}});var o,r,i,s,a,l,u=(o=e("helpers/unicode"),o&&o.__esModule&&o||{"default":o}).KEY_CODES,c=(r=e("helpers/dom/event"),r&&r.__esModule&&r||{"default":r}),d=c.stopImmediatePropagation,h=c.isImmediatePropagationStopped,f=(i=e("helpers/dom/element"),i&&i.__esModule&&i||{"default":i}),p=f.addClass,g=f.getScrollLeft,m=f.getScrollTop,v=f.hasClass,w=f.isChildOf,y=f.offset,b=f.outerHeight,C=f.outerWidth,R=f.removeClass,_=f.setCaretPosition,S=(s=e("editors"),s&&s.__esModule&&s||{"default":s}),E=(S.getEditor,S.registerEditor),T=(a=e("_baseEditor"),a&&a.__esModule&&a||{"default":a}).BaseEditor,O=(l=e("eventManager"),l&&l.__esModule&&l||{"default":l}).eventManager,M=T.prototype.extend(),k={},H=function(){this.controls={},this.controls.leftButton=document.createElement("DIV"),this.controls.leftButton.className="leftButton", -this.controls.rightButton=document.createElement("DIV"),this.controls.rightButton.className="rightButton",this.controls.upButton=document.createElement("DIV"),this.controls.upButton.className="upButton",this.controls.downButton=document.createElement("DIV"),this.controls.downButton.className="downButton";for(var e in this.controls)this.controls.hasOwnProperty(e)&&this.positionControls.appendChild(this.controls[e])};M.prototype.valueChanged=function(){return this.initValue!=this.getValue()},M.prototype.init=function(){var e=this;this.eventManager=O(this.instance),this.createElements(),this.bindEvents(),this.instance.addHook("afterDestroy",function(){e.destroy()})},M.prototype.getValue=function(){return this.TEXTAREA.value},M.prototype.setValue=function(e){this.initValue=e,this.TEXTAREA.value=e},M.prototype.createElements=function(){this.editorContainer=document.createElement("DIV"),this.editorContainer.className="htMobileEditorContainer",this.cellPointer=document.createElement("DIV"),this.cellPointer.className="cellPointer",this.moveHandle=document.createElement("DIV"),this.moveHandle.className="moveHandle",this.inputPane=document.createElement("DIV"),this.inputPane.className="inputs",this.positionControls=document.createElement("DIV"),this.positionControls.className="positionControls",this.TEXTAREA=document.createElement("TEXTAREA"),p(this.TEXTAREA,"handsontableInput"),this.inputPane.appendChild(this.TEXTAREA),this.editorContainer.appendChild(this.cellPointer),this.editorContainer.appendChild(this.moveHandle),this.editorContainer.appendChild(this.inputPane),this.editorContainer.appendChild(this.positionControls),H.call(this),document.body.appendChild(this.editorContainer)},M.prototype.onBeforeKeyDown=function(e){var t=this,n=t.getActiveEditor();if(e.target===n.TEXTAREA&&!h(e))switch(e.keyCode){case u.ENTER:n.close(),e.preventDefault();break;case u.BACKSPACE:d(e)}},M.prototype.open=function(){this.instance.addHook("beforeKeyDown",this.onBeforeKeyDown),p(this.editorContainer,"active"),R(this.cellPointer,"hidden"),this.updateEditorPosition()},M.prototype.focus=function(){this.TEXTAREA.focus(),_(this.TEXTAREA,this.TEXTAREA.value.length)},M.prototype.close=function(){this.TEXTAREA.blur(),this.instance.removeHook("beforeKeyDown",this.onBeforeKeyDown),R(this.editorContainer,"active")},M.prototype.scrollToView=function(){var e=this.instance.getSelectedRange().highlight;this.instance.view.scrollViewport(e)},M.prototype.hideCellPointer=function(){v(this.cellPointer,"hidden")||p(this.cellPointer,"hidden")},M.prototype.updateEditorPosition=function(e,t){if(e&&t)e=parseInt(e,10),t=parseInt(t,10),this.editorContainer.style.top=t+"px",this.editorContainer.style.left=e+"px";else{var n=this.instance.getSelected(),o=this.instance.getCell(n[0],n[1]);if(k.cellPointer||(k.cellPointer={height:b(this.cellPointer),width:C(this.cellPointer)}),k.editorContainer||(k.editorContainer={width:C(this.editorContainer)}),void 0!==o){var r=this.instance.view.wt.wtOverlays.leftOverlay.trimmingContainer==window?0:g(this.instance.view.wt.wtOverlays.leftOverlay.holder),i=this.instance.view.wt.wtOverlays.topOverlay.trimmingContainer==window?0:m(this.instance.view.wt.wtOverlays.topOverlay.holder),s=y(o),a=C(o),l={x:r,y:i};this.editorContainer.style.top=parseInt(s.top+b(o)-l.y+k.cellPointer.height,10)+"px",this.editorContainer.style.left=parseInt(window.innerWidth/2-k.editorContainer.width/2,10)+"px",s.left+a/2>parseInt(this.editorContainer.style.left,10)+k.editorContainer.width?this.editorContainer.style.left=window.innerWidth-k.editorContainer.width+"px":s.left+a/2n;n++)t[e[n]]=e[n];else"object"==typeof e&&(t=e);return t},S.prototype.getValue=function(){return this.select.value},S.prototype.setValue=function(e){this.select.value=e};var E=function(e){var t=this,n=t.getActiveEditor();switch(e.keyCode){case b.ARROW_UP:var o=n.select.selectedIndex-1;o>=0&&(n.select[o].selected=!0),y(e),e.preventDefault();break;case b.ARROW_DOWN:var r=n.select.selectedIndex+1;r<=n.select.length-1&&(n.select[r].selected=!0),y(e),e.preventDefault()}};S.prototype.open=function(){this._opened=!0,this.refreshDimensions(),this.select.style.display="",this.instance.addHook("beforeKeyDown",E)},S.prototype.close=function(){this._opened=!1,this.select.style.display="none",this.instance.removeHook("beforeKeyDown",E)},S.prototype.focus=function(){this.select.focus()},S.prototype.refreshDimensions=function(){if(this.state===Handsontable.EditorState.EDITING){if(this.TD=this.getEditedCell(),!this.TD)return void this.close();var e,t=v(this.TD)+1,n=m(this.TD)+1,o=g(this.TD),r=g(this.instance.rootElement),i=p(this.TD),s=o.top-r.top-1-(i.scrollTop||0),a=o.left-r.left-1-(i.scrollLeft||0),l=this.checkEditorSection(),u=this.instance.getSettings();u.rowHeaders?1:0,u.colHeaders?1:0;switch(l){case"top":e=f(this.instance.view.wt.wtOverlays.topOverlay.clone.wtTable.holder.parentNode);break;case"left":e=f(this.instance.view.wt.wtOverlays.leftOverlay.clone.wtTable.holder.parentNode);break;case"top-left-corner":e=f(this.instance.view.wt.wtOverlays.topLeftCornerOverlay.clone.wtTable.holder.parentNode);break;case"bottom-left-corner":e=f(this.instance.view.wt.wtOverlays.bottomLeftCornerOverlay.clone.wtTable.holder.parentNode);break;case"bottom":e=f(this.instance.view.wt.wtOverlays.bottomOverlay.clone.wtTable.holder.parentNode)}0===this.instance.getSelected()[0]&&(s+=1),0===this.instance.getSelected()[1]&&(a+=1);var c=this.select.style;e&&-1!=e?c[e[0]]=e[1]:w(this.select);var d=h(this.TD);parseInt(d.borderTopWidth,10)>0&&(n-=1),parseInt(d.borderLeftWidth,10)>0&&(t-=1),c.height=n+"px",c.minWidth=t+"px",c.top=s+"px",c.left=a+"px",c.margin="0px"}},S.prototype.getEditedCell=function(){var e,t=this.checkEditorSection();switch(t){case"top":e=this.instance.view.wt.wtOverlays.topOverlay.clone.wtTable.getCell({row:this.row,col:this.col}),this.select.style.zIndex=101;break;case"corner":e=this.instance.view.wt.wtOverlays.topLeftCornerOverlay.clone.wtTable.getCell({row:this.row,col:this.col}),this.select.style.zIndex=103;break;case"left":e=this.instance.view.wt.wtOverlays.leftOverlay.clone.wtTable.getCell({row:this.row,col:this.col}),this.select.style.zIndex=102;break;default:e=this.instance.getCell(this.row,this.col),this.select.style.zIndex=""}return-1!=e&&-2!=e?e:void 0},R("select",S)},{_baseEditor:30,editors:29,"helpers/dom/element":45,"helpers/dom/event":46,"helpers/unicode":53}],40:[function(e,t,n){"use strict";Object.defineProperties(n,{TextEditor:{get:function(){return H}},__esModule:{value:!0}});var o,r,i,s,a,l,u,c=(o=e("helpers/dom/element"),o&&o.__esModule&&o||{"default":o}),d=c.addClass,h=c.getCaretPosition,f=c.getComputedStyle,p=c.getCssTransform,g=c.getScrollableElement,m=c.innerWidth,v=c.offset,w=c.resetCssTransform,y=c.setCaretPosition,b=(r=e("autoResize"),r&&r.__esModule&&r||{"default":r})["default"],C=(i=e("_baseEditor"),i&&i.__esModule&&i||{"default":i}).BaseEditor,R=(s=e("eventManager"),s&&s.__esModule&&s||{"default":s}).eventManager,_=(a=e("editors"),a&&a.__esModule&&a||{"default":a}),S=(_.getEditor,_.registerEditor),E=(l=e("helpers/unicode"),l&&l.__esModule&&l||{"default":l}).KEY_CODES,T=(u=e("helpers/dom/event"),u&&u.__esModule&&u||{"default":u}),O=T.stopPropagation,M=T.stopImmediatePropagation,k=T.isImmediatePropagationStopped,H=C.prototype.extend();H.prototype.init=function(){var e=this;this.createElements(),this.eventManager=R(this),this.bindEvents(),this.autoResize=b(),this.instance.addHook("afterDestroy",function(){e.destroy()})},H.prototype.getValue=function(){return this.TEXTAREA.value},H.prototype.setValue=function(e){this.TEXTAREA.value=e};var D=function(e){var t,n=this,o=n.getActiveEditor();if(t=(e.ctrlKey||e.metaKey)&&!e.altKey,e.target===o.TEXTAREA&&!k(e)){if(17===e.keyCode||224===e.keyCode||91===e.keyCode||93===e.keyCode)return void M(e);switch(e.keyCode){case E.ARROW_RIGHT:o.isInFullEditMode()&&(!o.isWaiting()&&!o.allowKeyEventPropagation||!o.isWaiting()&&o.allowKeyEventPropagation&&!o.allowKeyEventPropagation(e.keyCode))&&M(e);break;case E.ARROW_LEFT:o.isInFullEditMode()&&(!o.isWaiting()&&!o.allowKeyEventPropagation||!o.isWaiting()&&o.allowKeyEventPropagation&&!o.allowKeyEventPropagation(e.keyCode))&&M(e);break;case E.ARROW_UP:case E.ARROW_DOWN:o.isInFullEditMode()&&(!o.isWaiting()&&!o.allowKeyEventPropagation||!o.isWaiting()&&o.allowKeyEventPropagation&&!o.allowKeyEventPropagation(e.keyCode))&&M(e);break;case E.ENTER:var r=o.instance.getSelected(),i=!(r[0]===r[2]&&r[1]===r[3]);if(t&&!i||e.altKey){if(o.isOpened()){var s=h(o.TEXTAREA),a=o.getValue(),l=a.slice(0,s)+"\n"+a.slice(s);o.setValue(l),y(o.TEXTAREA,s+1)}else o.beginEditing(o.originalValue+"\n");M(e)}e.preventDefault();break;case E.A:case E.X:case E.C:case E.V:t&&M(e);break;case E.BACKSPACE:case E.DELETE:case E.HOME:case E.END:M(e)}-1===[E.ARROW_UP,E.ARROW_RIGHT,E.ARROW_DOWN,E.ARROW_LEFT].indexOf(e.keyCode)&&o.autoResize.resize(String.fromCharCode(e.keyCode))}};H.prototype.open=function(){this.refreshDimensions(),this.instance.addHook("beforeKeyDown",D)},H.prototype.close=function(e){this.textareaParentStyle.display="none",this.autoResize.unObserve(),document.activeElement===this.TEXTAREA&&this.instance.listen(),this.instance.removeHook("beforeKeyDown",D)},H.prototype.focus=function(){this.TEXTAREA.focus(),y(this.TEXTAREA,this.TEXTAREA.value.length)},H.prototype.createElements=function(){this.TEXTAREA=document.createElement("TEXTAREA"),d(this.TEXTAREA,"handsontableInput"),this.textareaStyle=this.TEXTAREA.style,this.textareaStyle.width=0,this.textareaStyle.height=0,this.TEXTAREA_PARENT=document.createElement("DIV"),d(this.TEXTAREA_PARENT,"handsontableInputHolder"),this.textareaParentStyle=this.TEXTAREA_PARENT.style,this.textareaParentStyle.top=0,this.textareaParentStyle.left=0,this.textareaParentStyle.display="none",this.TEXTAREA_PARENT.appendChild(this.TEXTAREA),this.instance.rootElement.appendChild(this.TEXTAREA_PARENT);var e=this;this.instance._registerTimeout(setTimeout(function(){e.refreshDimensions()},0))},H.prototype.getEditedCell=function(){var e,t=this.checkEditorSection();switch(t){case"top":e=this.instance.view.wt.wtOverlays.topOverlay.clone.wtTable.getCell({row:this.row,col:this.col}),this.textareaParentStyle.zIndex=101;break;case"top-left-corner":e=this.instance.view.wt.wtOverlays.topLeftCornerOverlay.clone.wtTable.getCell({row:this.row,col:this.col}),this.textareaParentStyle.zIndex=103;break;case"bottom-left-corner":e=this.instance.view.wt.wtOverlays.bottomLeftCornerOverlay.clone.wtTable.getCell({row:this.row,col:this.col}),this.textareaParentStyle.zIndex=103;break;case"left":e=this.instance.view.wt.wtOverlays.leftOverlay.clone.wtTable.getCell({row:this.row,col:this.col}),this.textareaParentStyle.zIndex=102;break;case"bottom":e=this.instance.view.wt.wtOverlays.bottomOverlay.clone.wtTable.getCell({row:this.row,col:this.col}),this.textareaParentStyle.zIndex=102;break;default:e=this.instance.getCell(this.row,this.col),this.textareaParentStyle.zIndex=""}return-1!=e&&-2!=e?e:void 0},H.prototype.refreshDimensions=function(){if(this.state===Handsontable.EditorState.EDITING){if(this.TD=this.getEditedCell(),!this.TD)return void this.close(!0);var e,t=v(this.TD),n=v(this.instance.rootElement),o=g(this.TD),r=this.instance.countRows(),i=t.top-n.top-1-(o.scrollTop||0),s=t.left-n.left-1-(o.scrollLeft||0),a=this.instance.getSettings(),l=(a.rowHeaders?1:0,a.colHeaders?1:0),u=this.checkEditorSection(),c=this.TD.style.backgroundColor;switch(u){case"top":e=p(this.instance.view.wt.wtOverlays.topOverlay.clone.wtTable.holder.parentNode);break;case"left":e=p(this.instance.view.wt.wtOverlays.leftOverlay.clone.wtTable.holder.parentNode);break;case"top-left-corner":e=p(this.instance.view.wt.wtOverlays.topLeftCornerOverlay.clone.wtTable.holder.parentNode);break;case"bottom-left-corner":e=p(this.instance.view.wt.wtOverlays.bottomLeftCornerOverlay.clone.wtTable.holder.parentNode);break;case"bottom":e=p(this.instance.view.wt.wtOverlays.bottomOverlay.clone.wtTable.holder.parentNode)}(l&&0===this.instance.getSelected()[0]||a.fixedRowsBottom&&this.instance.getSelected()[0]===r-a.fixedRowsBottom)&&(i+=1),0===this.instance.getSelected()[1]&&(s+=1),e&&-1!=e?this.textareaParentStyle[e[0]]=e[1]:w(this.textareaParentStyle),this.textareaParentStyle.top=i+"px",this.textareaParentStyle.left=s+"px";var d=this.TD.offsetTop-this.instance.view.wt.wtOverlays.topOverlay.getScrollPosition(),h=this.TD.offsetLeft-this.instance.view.wt.wtOverlays.leftOverlay.getScrollPosition(),y=m(this.TD)-8,b=this.instance.view.maximumVisibleElementWidth(h)-9,C=this.TD.scrollHeight+1,R=Math.max(this.instance.view.maximumVisibleElementHeight(d)-2,23),_=f(this.TD);this.TEXTAREA.style.fontSize=_.fontSize,this.TEXTAREA.style.fontFamily=_.fontFamily,this.TEXTAREA.style.backgroundColor="",this.TEXTAREA.style.backgroundColor=c?c:f(this.TEXTAREA).backgroundColor,this.autoResize.init(this.TEXTAREA,{minHeight:Math.min(C,R),maxHeight:R,minWidth:Math.min(y,b),maxWidth:b},!0),this.textareaParentStyle.display="block"}},H.prototype.bindEvents=function(){var e=this;this.eventManager.addEventListener(this.TEXTAREA,"cut",function(e){O(e)}),this.eventManager.addEventListener(this.TEXTAREA,"paste",function(e){O(e)}),this.instance.addHook("afterScrollVertically",function(){e.refreshDimensions()}),this.instance.addHook("afterColumnResize",function(){e.refreshDimensions(),e.focus()}),this.instance.addHook("afterRowResize",function(){e.refreshDimensions(),e.focus()}),this.instance.addHook("afterDestroy",function(){e.eventManager.destroy()})},H.prototype.destroy=function(){this.eventManager.destroy()},S("text",H)},{_baseEditor:30,autoResize:"autoResize",editors:29,eventManager:41,"helpers/dom/element":45,"helpers/dom/event":46,"helpers/unicode":53}],41:[function(e,t,n){"use strict";function o(e,t){var n,o,r,i,s,a="HOT-TABLE";if(t.isTargetWebComponent=!1,t.realTarget=t.target,!Handsontable.eventManager.isHotTableEnv)return t;for(t=l(t),s=t.path?t.path.length:0;s--;){if(t.path[s].nodeName===a)n=!0;else if(n&&t.path[s].shadowRoot){i=t.path[s];break}0!==s||i||(i=t.path[s])}return i||(i=t.target),t.isTargetWebComponent=!0,c()?t.realTarget=t.srcElement||t.toElement:(e instanceof Handsontable.Core||e instanceof Walkontable)&&(e instanceof Handsontable.Core?o=e.view?e.view.wt.wtTable.TABLE:null:e instanceof Walkontable&&(o=e.wtTable.TABLE.parentNode.parentNode),r=u(t.target,[a],o),r?t.realTarget=o.querySelector(a)||t.target:t.realTarget=t.target),Object.defineProperty(t,"target",{get:function(){return l(i)},enumerable:!0,configurable:!0}),t}function r(e){return new d(e)}Object.defineProperties(n,{EventManager:{get:function(){return d}},eventManager:{get:function(){return r}},__esModule:{value:!0}});var i,s,a=(i=e("helpers/dom/element"),i&&i.__esModule&&i||{"default":i}),l=a.polymerWrap,u=a.closest,c=(s=e("helpers/browser"),s&&s.__esModule&&s||{"default":s}).isWebComponentSupportedNatively,d=function(){var e=void 0!==arguments[0]?arguments[0]:null;this.context=e||this,this.context.eventListeners||(this.context.eventListeners=[])};$traceurRuntime.createClass(d,{addEventListener:function(e,t,n){function r(e){void 0==e.target&&void 0!=e.srcElement&&(e.definePoperty?e.definePoperty("target",{value:e.srcElement}):e.target=e.srcElement),void 0==e.preventDefault&&(e.definePoperty?e.definePoperty("preventDefault",{value:function(){this.returnValue=!1}}):e.preventDefault=function(){this.returnValue=!1}),e=o(s,e),n.call(this,e)}var i=this,s=this.context;return this.context.eventListeners.push({element:e,event:t,callback:n,callbackProxy:r}),window.addEventListener?e.addEventListener(t,r,!1):e.attachEvent("on"+t,r),Handsontable.countEventManagerListeners++,function(){i.removeEventListener(e,t,n)}},removeEventListener:function(e,t,n){for(var o,r=this.context.eventListeners.length;r--;)if(o=this.context.eventListeners[r],o.event==t&&o.element==e){if(n&&n!=o.callback)continue;this.context.eventListeners.splice(r,1),o.element.removeEventListener?o.element.removeEventListener(o.event,o.callbackProxy,!1):o.element.detachEvent("on"+o.event,o.callbackProxy),Handsontable.countEventManagerListeners--}},clearEvents:function(){if(this.context)for(var e=this.context.eventListeners.length;e--;){var t=this.context.eventListeners[e];t&&this.removeEventListener(t.element,t.event,t.callback)}},clear:function(){this.clearEvents()},destroy:function(){this.clearEvents(),this.context=null},fireEvent:function(e,t){var n,o={bubbles:!0,cancelable:"mousemove"!==t,view:window,detail:0,screenX:0,screenY:0,clientX:1,clientY:1,ctrlKey:!1,altKey:!1,shiftKey:!1,metaKey:!1,button:0,relatedTarget:void 0};document.createEvent?(n=document.createEvent("MouseEvents"),n.initMouseEvent(t,o.bubbles,o.cancelable,o.view,o.detail,o.screenX,o.screenY,o.clientX,o.clientY,o.ctrlKey,o.altKey,o.shiftKey,o.metaKey,o.button,o.relatedTarget||document.body.parentNode)):n=document.createEventObject(),e.dispatchEvent?e.dispatchEvent(n):e.fireEvent("on"+t,n)}},{}),window.Handsontable=window.Handsontable||{},Handsontable.countEventManagerListeners=0,Handsontable.eventManager=r},{"helpers/browser":43,"helpers/dom/element":45}],42:[function(e,t,n){"use strict";function o(e){for(var t=0,n=e.length;n>t;)e[t]=[e[t]],t++}function r(e,t){for(var n=0,o=t.length;o>n;)e.push(t[n]),n++}function i(e){var t=[];if(!e||0===e.length||!e[0]||0===e[0].length)return t;for(var n=e.length,o=e[0].length,r=0;n>r;r++)for(var i=0;o>i;i++)t[i]||(t[i]=[]),t[i][r]=e[r][i];return t}function s(e,t,n,o){var r=-1,i=e.length;for(o&&i&&(n=e[++r]);++rt?e:t},Array.isArray(e)?e[0]:void 0)}function h(e){return s(e,function(e,t){return t>e?e:t},Array.isArray(e)?e[0]:void 0)}function f(e){return e.length?c(e)/e.length:0}function p(e){return s(e,function(e,t){return e.concat(Array.isArray(t)?p(t):t)},[])}function g(e){var t=[];return u(e,function(e){-1===t.indexOf(e)&&t.push(e)}),t}Object.defineProperties(n,{to2dArray:{get:function(){return o}},extendArray:{get:function(){return r}},pivot:{get:function(){return i}},arrayReduce:{get:function(){return s}},arrayFilter:{get:function(){return a}},arrayMap:{get:function(){return l}},arrayEach:{get:function(){return u}},arraySum:{get:function(){return c}},arrayMax:{get:function(){return d}},arrayMin:{get:function(){return h}},arrayAvg:{get:function(){return f}},arrayFlatten:{get:function(){return p}},arrayUnique:{get:function(){return g}},__esModule:{value:!0}})},{}],43:[function(e,t,n){"use strict";function o(){return f}function r(){return p}function i(){return g}function s(){return m}function a(e){return e||(e=navigator.userAgent),/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(e)}function l(){return"ontouchstart"in window}function u(){var e=document.createElement("div");return e.createShadowRoot&&e.createShadowRoot.toString().match(/\[native code\]/)?!0:!1}function c(){var e=document.createElement("TABLE");e.style.borderSpacing=0,e.style.borderWidth=0,e.style.padding=0;var t=document.createElement("TBODY");e.appendChild(t),t.appendChild(document.createElement("TR")),t.firstChild.appendChild(document.createElement("TD")),t.firstChild.firstChild.innerHTML="t
t";var n=document.createElement("CAPTION");n.innerHTML="c
c
c
c",n.style.padding=0,n.style.margin=0,e.insertBefore(n,t),document.body.appendChild(e),h=e.offsetHeight<2*e.lastChild.offsetHeight,document.body.removeChild(e)}function d(){return void 0===h&&c(),h}Object.defineProperties(n,{isIE8:{get:function(){return o}},isIE9:{get:function(){return r}},isSafari:{get:function(){return i}},isChrome:{get:function(){return s}},isMobileBrowser:{get:function(){return a}},isTouchSupported:{get:function(){return l}},isWebComponentSupportedNatively:{get:function(){return u}},hasCaptionProblem:{get:function(){return d}},__esModule:{value:!0}});var h,f=!document.createTextNode("test").textContent,p=!!document.documentMode,g=/Safari/.test(navigator.userAgent)&&/Apple Computer/.test(navigator.vendor),m=/Chrome/.test(navigator.userAgent)&&/Google/.test(navigator.vendor)},{}],44:[function(e,t,n){"use strict";function o(e){for(var t,n=e+1,o="";n>0;)t=(n-1)%26,o=String.fromCharCode(65+t)+o,n=parseInt((n-t)/26,10);return o}function r(e,t){e="number"==typeof e?e:100,t="number"==typeof t?t:4;var n,r,i=[];for(n=0;e>n;n++){var s=[];for(r=0;t>r;r++)s.push(o(r)+(n+1));i.push(s)}return i}function i(e,t){e="number"==typeof e?e:100,t="number"==typeof t?t:4;var n,r,i=[];for(n=0;e>n;n++){var s={};for(r=0;t>r;r++)s["prop"+r]=o(r)+(n+1);i.push(s)}return i}function s(e,t){for(var n,o=[],r=0;e>r;r++){n=[];for(var i=0;t>i;i++)n.push("");o.push(n)}return o}function a(e){var t,n,o,r,i=[],s=0;for(t=0,n=e.length;n>t;t++)for(o=0,r=e[t].length;r>o;o++)o==s&&(i.push([]),s++),i[o].push(e[t][o]);return i}function l(e,t){function n(e){var t=Handsontable.cellTypes[e];if("undefined"==typeof t)throw new Error('You declared cell type "'+e+'" as a string that is not mapped to a known object. Cell type must be an object or a string mapped to an object in Handsontable.cellTypes');return t}return t="undefined"==typeof t?!0:t,function(o,r){return function i(o){if(o){if(o.hasOwnProperty(e)&&void 0!==o[e])return o[e];if(o.hasOwnProperty("type")&&o.type){var r;if("string"!=typeof o.type)throw new Error("Cell type must be a string ");if(r=n(o.type),r.hasOwnProperty(e))return r[e];if(t)return}return i(c(o))}}("number"==typeof o?this.getCellMeta(o,r):o)}}Object.defineProperties(n,{spreadsheetColumnLabel:{get:function(){return o}},createSpreadsheetData:{get:function(){return r}},createSpreadsheetObjectData:{get:function(){return i}},createEmptySpreadsheetData:{get:function(){return s}},translateRowsToColumns:{get:function(){return a}},cellMethodLookupFactory:{get:function(){return l}},__esModule:{value:!0}});var u,c=(u=e("object"),u&&u.__esModule&&u||{"default":u}).getPrototypeOf},{object:50}],45:[function(e,t,n){"use strict";function o(e,t,n){for(;null!=e&&e!==n;){if(e.nodeType===Node.ELEMENT_NODE&&(t.indexOf(e.nodeName)>-1||t.indexOf(e)>-1))return e;e=e.host&&e.nodeType===Node.DOCUMENT_FRAGMENT_NODE?e.host:e.parentNode}return null}function r(e,t){var n=e.parentNode,o=[];for("string"==typeof t?o=Array.prototype.slice.call(document.querySelectorAll(t),0):o.push(t);null!=n;){if(o.indexOf(n)>-1)return!0;n=n.parentNode}return!1}function i(e){function t(e){return e.nodeType===Node.ELEMENT_NODE&&e.nodeName===o.toUpperCase()}var n,o="hot-table",r=!1;for(n=s(e);null!=n;){if(t(n)){r=!0;break}if(n.host&&n.nodeType===Node.DOCUMENT_FRAGMENT_NODE){if(r=t(n.host))break;n=n.host}n=n.parentNode}return r}function s(e){return"undefined"!=typeof Polymer&&"function"==typeof wrap?wrap(e):e}function a(e){return"undefined"!=typeof Polymer&&"function"==typeof unwrap?unwrap(e):e}function l(e){var t=0;if(e.previousSibling)for(;e=e.previousSibling;)++t;return t}function u(e,t){var n=document.querySelector(".ht_clone_"+e);return n?n.contains(t):null}function c(e){var t=0,n=[];if(!e||!e.length)return n;for(;e[t];)n.push(e[t]),t++;return n}function d(e,t){return K(e,t)}function h(e,t){return X(e,t)}function f(e,t){return q(e,t)}function p(e,t){if(3===e.nodeType)t.removeChild(e);else if(["TABLE","THEAD","TBODY","TFOOT","TR"].indexOf(e.nodeName)>-1)for(var n=e.childNodes,o=n.length-1;o>=0;o--)p(n[o],e)}function g(e){for(var t;t=e.lastChild;)e.removeChild(t)}function m(e,t){se.test(t)?e.innerHTML=t:v(e,t)}function v(e,t){var n=e.firstChild;n&&3===n.nodeType&&null===n.nextSibling?ae?n.textContent=t:n.data=t:(g(e),e.appendChild(document.createTextNode(t)))}function w(e){for(var t=e;a(t)!==document.documentElement;){if(null===t)return!1;if(t.nodeType===Node.DOCUMENT_FRAGMENT_NODE){if(t.host){if(t.host.impl)return w(t.host.impl);if(t.host)return w(t.host);throw new Error("Lost in Web Components world")}return!1}if("none"===t.style.display)return!1;t=t.parentNode}return!0}function y(e){var t,n,o,r,i;if(r=document.documentElement,te()&&e.firstChild&&"CAPTION"===e.firstChild.nodeName)return i=e.getBoundingClientRect(),{top:i.top+(window.pageYOffset||r.scrollTop)-(r.clientTop||0),left:i.left+(window.pageXOffset||r.scrollLeft)-(r.clientLeft||0)};for(t=e.offsetLeft,n=e.offsetTop,o=e;(e=e.offsetParent)&&e!==document.body;)t+=e.offsetLeft,n+=e.offsetTop,o=e;return o&&"fixed"===o.style.position&&(t+=window.pageXOffset||r.scrollLeft,n+=window.pageYOffset||r.scrollTop),{left:t,top:n}}function b(){var e=window.scrollY;return void 0===e&&(e=document.documentElement.scrollTop),e}function C(){var e=window.scrollX;return void 0===e&&(e=document.documentElement.scrollLeft),e}function R(e){return e===window?b():e.scrollTop}function _(e){return e===window?C():e.scrollLeft}function S(e){for(var t,n,o,r=e.parentNode,i=["auto","scroll"],s="",a="",l="",u="";r&&r.style&&document.body!==r;){if(t=r.style.overflow,n=r.style.overflowX,o=r.style.overflowY,"scroll"==t||"scroll"==n||"scroll"==o)return r;if(window.getComputedStyle&&(s=window.getComputedStyle(r),a=s.getPropertyValue("overflow"),l=s.getPropertyValue("overflow-y"),u=s.getPropertyValue("overflow-x"),"scroll"===a||"scroll"===u||"scroll"===l))return r;if(r.clientHeight<=r.scrollHeight&&(-1!==i.indexOf(o)||-1!==i.indexOf(t)||-1!==i.indexOf(a)||-1!==i.indexOf(l)))return r;if(r.clientWidth<=r.scrollWidth&&(-1!==i.indexOf(n)||-1!==i.indexOf(t)||-1!==i.indexOf(a)||-1!==i.indexOf(u)))return r;r=r.parentNode}return window}function E(e){for(var t=e.parentNode;t&&t.style&&document.body!==t;){if("visible"!==t.style.overflow&&""!==t.style.overflow)return t;if(window.getComputedStyle){var n=window.getComputedStyle(t);if("visible"!==n.getPropertyValue("overflow")&&""!==n.getPropertyValue("overflow"))return t; -}t=t.parentNode}return window}function T(e,t){if(e){if(e!==window){var n,o=e.style[t];return""!==o&&void 0!==o?o:(n=O(e),""!==n[t]&&void 0!==n[t]?n[t]:void 0)}if("width"===t)return window.innerWidth+"px";if("height"===t)return window.innerHeight+"px"}}function O(e){return e.currentStyle||document.defaultView.getComputedStyle(e)}function M(e){return e.offsetWidth}function k(e){return te()&&e.firstChild&&"CAPTION"===e.firstChild.nodeName?e.offsetHeight+e.firstChild.offsetHeight:e.offsetHeight}function H(e){return e.clientHeight||e.innerHeight}function D(e){return e.clientWidth||e.innerWidth}function x(e,t,n){window.addEventListener?e.addEventListener(t,n,!1):e.attachEvent("on"+t,n)}function A(e,t,n){window.removeEventListener?e.removeEventListener(t,n,!1):e.detachEvent("on"+t,n)}function P(e){if(e.selectionStart)return e.selectionStart;if(document.selection){e.focus();var t=document.selection.createRange();if(null==t)return 0;var n=e.createTextRange(),o=n.duplicate();return n.moveToBookmark(t.getBookmark()),o.setEndPoint("EndToStart",n),o.text.length}return 0}function N(e){if(e.selectionEnd)return e.selectionEnd;if(document.selection){var t=document.selection.createRange();if(null==t)return 0;var n=e.createTextRange();return n.text.indexOf(t.text)+t.text.length}}function L(){var e="";return window.getSelection?e=window.getSelection().toString():document.selection&&"Control"!==document.selection.type&&(e=document.selection.createRange().text),e}function W(e,t,n){if(void 0===n&&(n=t),e.setSelectionRange){e.focus();try{e.setSelectionRange(t,n)}catch(o){var r=e.parentNode,i=r.style.display;r.style.display="block",e.setSelectionRange(t,n),r.style.display=i}}else if(e.createTextRange){var s=e.createTextRange();s.collapse(!0),s.moveEnd("character",n),s.moveStart("character",t),s.select()}}function I(){var e=document.createElement("p");e.style.width="100%",e.style.height="200px";var t=document.createElement("div");t.style.position="absolute",t.style.top="0px",t.style.left="0px",t.style.visibility="hidden",t.style.width="200px",t.style.height="150px",t.style.overflow="hidden",t.appendChild(e),(document.body||document.documentElement).appendChild(t);var n=e.offsetWidth;t.style.overflow="scroll";var o=e.offsetWidth;return n==o&&(o=t.clientWidth),(document.body||document.documentElement).removeChild(t),n-o}function j(){return void 0===ie&&(ie=I()),ie}function B(e,t,n){J()||Q()?(e.style.top=n,e.style.left=t):ee()?e.style["-webkit-transform"]="translate3d("+t+","+n+",0)":e.style.transform="translate3d("+t+","+n+",0)"}function F(e){var t;return e.style.transform&&""!==(t=e.style.transform)?["transform",t]:e.style["-webkit-transform"]&&""!==(t=e.style["-webkit-transform"])?["-webkit-transform",t]:-1}function V(e){e.transform&&""!==e.transform?e.transform="":e["-webkit-transform"]&&""!==e["-webkit-transform"]&&(e["-webkit-transform"]="")}function z(e){var t=["INPUT","SELECT","TEXTAREA"];return t.indexOf(e.nodeName)>-1||"true"===e.contentEditable}function Y(e){return z(e)&&-1==e.className.indexOf("handsontableInput")&&-1==e.className.indexOf("copyPaste")}function U(e){return ce.call(window,e)}function G(e){de.call(window,e)}Object.defineProperties(n,{closest:{get:function(){return o}},isChildOf:{get:function(){return r}},isChildOfWebComponentTable:{get:function(){return i}},polymerWrap:{get:function(){return s}},polymerUnwrap:{get:function(){return a}},index:{get:function(){return l}},overlayContainsElement:{get:function(){return u}},hasClass:{get:function(){return d}},addClass:{get:function(){return h}},removeClass:{get:function(){return f}},removeTextNodes:{get:function(){return p}},empty:{get:function(){return g}},HTML_CHARACTERS:{get:function(){return se}},fastInnerHTML:{get:function(){return m}},fastInnerText:{get:function(){return v}},isVisible:{get:function(){return w}},offset:{get:function(){return y}},getWindowScrollTop:{get:function(){return b}},getWindowScrollLeft:{get:function(){return C}},getScrollTop:{get:function(){return R}},getScrollLeft:{get:function(){return _}},getScrollableElement:{get:function(){return S}},getTrimmingContainer:{get:function(){return E}},getStyle:{get:function(){return T}},getComputedStyle:{get:function(){return O}},outerWidth:{get:function(){return M}},outerHeight:{get:function(){return k}},innerHeight:{get:function(){return H}},innerWidth:{get:function(){return D}},addEvent:{get:function(){return x}},removeEvent:{get:function(){return A}},getCaretPosition:{get:function(){return P}},getSelectionEndPosition:{get:function(){return N}},getSelectionText:{get:function(){return L}},setCaretPosition:{get:function(){return W}},getScrollbarWidth:{get:function(){return j}},setOverlayPosition:{get:function(){return B}},getCssTransform:{get:function(){return F}},resetCssTransform:{get:function(){return V}},isInput:{get:function(){return z}},isOutsideInput:{get:function(){return Y}},requestAnimationFrame:{get:function(){return U}},cancelAnimationFrame:{get:function(){return G}},__esModule:{value:!0}});var $,K,X,q,Z=($=e("../browser"),$&&$.__esModule&&$||{"default":$}),J=Z.isIE8,Q=Z.isIE9,ee=Z.isSafari,te=Z.hasCaptionProblem,ne=document.documentElement.classList?!0:!1;if(ne){var oe=function(){var e=document.createElement("div");return e.classList.add("test","test2"),e.classList.contains("test2")}();K=function(e,t){return""===t?!1:e.classList.contains(t)},X=function(e,t){var n=0;if("string"==typeof t&&(t=t.split(" ")),t=c(t),oe)e.classList.add.apply(e.classList,t);else for(;t&&t[n];)e.classList.add(t[n]),n++},q=function(e,t){var n=0;if("string"==typeof t&&(t=t.split(" ")),t=c(t),oe)e.classList.remove.apply(e.classList,t);else for(;t&&t[n];)e.classList.remove(t[n]),n++}}else{var re=function(e){return new RegExp("(\\s|^)"+e+"(\\s|$)")};K=function(e,t){return e.className.match(re(t))?!0:!1},X=function(e,t){var n=0,o=e.className;if("string"==typeof t&&(t=t.split(" ")),""===o)o=t.join(" ");else for(;t&&t[n];)re(t[n]).test(o)||(o+=" "+t[n]),n++;e.className=o},q=function(e,t){var n=0,o=e.className;for("string"==typeof t&&(t=t.split(" "));t&&t[n];)o=o.replace(re(t[n])," ").trim(),n++;e.className!==o&&(e.className=o)}}for(var ie,se=/(<(.*)>|&(.*);)/,ae=document.createTextNode("test").textContent?!0:!1,le=0,ue=["ms","moz","webkit","o"],ce=window.requestAnimationFrame,de=window.cancelAnimationFrame,he=0;he=t&&n(o)!==!1;);}function s(e,t){return t=parseInt(t.toString().replace("%",""),10),t=parseInt(e*t/100)}Object.defineProperties(n,{isNumeric:{get:function(){return o}},rangeEach:{get:function(){return r}},rangeEachReverse:{get:function(){return i}},valueAccordingPercent:{get:function(){return s}},__esModule:{value:!0}})},{}],50:[function(e,t,n){"use strict";function o(e){var t;return Array.isArray(e)?t=[]:(t={},p(e,function(e,n){e&&"object"==typeof e&&!Array.isArray(e)?t[n]=o(e):Array.isArray(e)?e.length&&"object"==typeof e[0]&&!Array.isArray(e[0])?t[n]=[o(e[0])]:t[n]=[]:t[n]=null})),t}function r(e,t){return t.prototype.constructor=t,e.prototype=new t,e.prototype.constructor=e,e}function i(e,t){return p(t,function(t,n){e[n]=t}),e}function s(e,t){p(t,function(n,o){t[o]&&"object"==typeof t[o]?(e[o]||(Array.isArray(t[o])?e[o]=[]:e[o]={}),s(e[o],t[o])):e[o]=t[o]})}function a(e){return"object"==typeof e?JSON.parse(JSON.stringify(e)):e}function l(e){var t={};return p(e,function(e,n){return t[n]=e}),t}function u(e){for(var t=[],n=1;no;o++)n.prototype[t[o]]=void 0;return n}Object.defineProperties(n,{columnFactory:{get:function(){return o}},__esModule:{value:!0}});var r,i=(r=e("object"),r&&r.__esModule&&r||{"default":r}).inherit},{object:50}],52:[function(e,t,n){"use strict";function o(e){return e[0].toUpperCase()+e.substr(1)}function r(e,t){var n=!0;return h(t.length-1,function(o){return e.charAt(o)!==t.charAt(o)?(n=!1,!1):void 0}),n}function i(e,t){var n=!0,o=t.length-1,r=e.length-1;return h(o,function(i){var s=r-i,a=o-i;return e.charAt(s)!==t.charAt(a)?(n=!1,!1):void 0}),n}function s(){for(var e=[],t=0;t=48&&57>=e||e>=96&&111>=e||e>=186&&192>=e||e>=219&&222>=e||e>=226||e>=65&&90>=e}function r(e){var t=[u.ARROW_DOWN,u.ARROW_UP,u.ARROW_LEFT,u.ARROW_RIGHT,u.HOME,u.END,u.DELETE,u.BACKSPACE,u.F1,u.F2,u.F3,u.F4,u.F5,u.F6,u.F7,u.F8,u.F9,u.F10,u.F11,u.F12,u.TAB,u.PAGE_DOWN,u.PAGE_UP,u.ENTER,u.ESCAPE,u.SHIFT,u.CAPS_LOCK,u.ALT];return-1!==t.indexOf(e)}function i(e){return-1!==[u.CONTROL_LEFT,224,u.COMMAND_LEFT,u.COMMAND_RIGHT].indexOf(e)}function s(e,t){var n=t.split("|"),o=!1;return l(n,function(t){return e===u[t]?(o=!0,!1):void 0}),o}Object.defineProperties(n,{KEY_CODES:{get:function(){return u}},isPrintableChar:{get:function(){return o}},isMetaKey:{get:function(){return r}},isCtrlKey:{get:function(){return i}},isKey:{get:function(){return s}},__esModule:{value:!0}});var a,l=(a=e("array"),a&&a.__esModule&&a||{"default":a}).arrayEach,u={MOUSE_LEFT:1,MOUSE_RIGHT:3,MOUSE_MIDDLE:2,BACKSPACE:8,COMMA:188,INSERT:45,DELETE:46,END:35,ENTER:13,ESCAPE:27,CONTROL_LEFT:91,COMMAND_LEFT:17,COMMAND_RIGHT:93,ALT:18,HOME:36,PAGE_DOWN:34,PAGE_UP:33,PERIOD:190,SPACE:32,SHIFT:16,CAPS_LOCK:20,TAB:9,ARROW_RIGHT:39,ARROW_LEFT:37,ARROW_UP:38,ARROW_DOWN:40,F1:112,F2:113,F3:114,F4:115,F5:116,F6:117,F7:118,F8:119,F9:120,F10:121,F11:122,F12:123,A:65,X:88,C:67,V:86}},{array:42}],54:[function(e,t,n){"use strict";Object.defineProperties(n,{localHooks:{get:function(){return l}},__esModule:{value:!0}});var o,r,i=(o=e("helpers/array"),o&&o.__esModule&&o||{"default":o}).arrayEach,s=(r=e("helpers/object"),r&&r.__esModule&&r||{"default":r}).defineGetter,a="localHooks",l={_localHooks:Object.create(null),addLocalHook:function(e,t){this._localHooks[e]||(this._localHooks[e]=[]),this._localHooks[e].push(t)},runLocalHooks:function(e){for(var t=[],n=1;n=0?(t.skip=!0,!0):!1},has:function(e){var t=void 0!==arguments[1]?arguments[1]:null,n=this.getBucket(t);return void 0!==n[e]&&n[e].length?!0:!1},run:function(e,t,n,o,r,i,s,a){var l=this.globalBucket[t],u=-1,c=l?l.length:0;if(c)for(;++u=0},getRegistered:function(){return i}},{}),Handsontable.utils=Handsontable.utils||{},Handsontable.utils.Hooks=l},{"helpers/array":42,"helpers/object":50}],57:[function(e,t,n){"use strict";function o(e,t){e=c(e),Handsontable.plugins[e]=t,Handsontable.hooks.add("construct",function(){var n;d.has(this)||d.set(this,{}),n=d.get(this),n[e]||(n[e]=new t(this))}),Handsontable.hooks.add("afterDestroy",function(){if(d.has(this)){var e=d.get(this);u(e,function(e){return e.destroy()}),d["delete"](this)}})}function r(e,t){if("string"!=typeof t)throw Error('Only strings can be passed as "plugin" parameter');var n=c(t);if(d.has(e)&&d.get(e)[n])return d.get(e)[n]}function i(e){return d.has(e)?Object.keys(d.get(e)):[]}function s(e,t){var n=null;return d.has(e)&&u(d.get(e),function(e,o){e===t&&(n=o)}),n}Object.defineProperties(n,{registerPlugin:{get:function(){return o}},getPlugin:{get:function(){return r}},getRegistredPluginNames:{get:function(){return i}},getPluginName:{get:function(){return s}},__esModule:{value:!0}});var a,l,u=(a=e("helpers/object"),a&&a.__esModule&&a||{"default":a}).objectEach,c=(l=e("helpers/string"),l&&l.__esModule&&l||{"default":l}).toUpperCaseFirst,d=new WeakMap;Handsontable.plugins=Handsontable.plugins||{},Handsontable.plugins.utils=Handsontable.plugins.utils||{},Handsontable.plugins.registerPlugin=o},{"helpers/object":50,"helpers/string":52}],58:[function(e,t,n){"use strict";Object.defineProperties(n,{"default":{get:function(){return m}},__esModule:{value:!0}});var o,r,i,s=(o=e("helpers/object"),o&&o.__esModule&&o||{"default":o}),a=s.defineGetter,l=s.objectEach,u=(r=e("helpers/array"),r&&r.__esModule&&r||{"default":r}).arrayEach,c=(i=e("plugins"),i&&i.__esModule&&i||{"default":i}),d=c.getRegistredPluginNames,h=c.getPluginName,f=new WeakMap,p=null,g=function(e){var t=this;a(this,"hot",e,{writable:!1}),f.set(this,{hooks:{}}),p=null,this.pluginName=null,this.pluginsInitializedCallbacks=[],this.isPluginsReady=!1,this.enabled=!1,this.initialized=!1,this.hot.addHook("afterPluginsInitialized",function(){return t.onAfterPluginsInitialized()}),this.hot.addHook("afterUpdateSettings",function(){return t.onUpdateSettings()}),this.hot.addHook("beforeInit",function(){return t.init()})};$traceurRuntime.createClass(g,{init:function(){this.pluginName=h(this.hot,this),this.isEnabled&&this.isEnabled()&&this.enablePlugin(),p||(p=d(this.hot)),p.indexOf(this.pluginName)>=0&&p.splice(p.indexOf(this.pluginName),1),p.length||this.hot.runHooks("afterPluginsInitialized"),this.initialized=!0},enablePlugin:function(){this.enabled=!0},disablePlugin:function(){this.eventManager&&this.eventManager.clear(),this.clearHooks(),this.enabled=!1},addHook:function(e,t){var n=f.get(this).hooks[e]=f.get(this).hooks[e]||[];this.hot.addHook(e,t),n.push(t),f.get(this).hooks[e]=n},removeHooks:function(e){var t=this;u(f.get(this).hooks[e]||[],function(n){t.hot.removeHook(e,n)})},clearHooks:function(){var e=this,t=f.get(this).hooks;l(t,function(t,n){return e.removeHooks(n)}),t.length=0},callOnPluginsReady:function(e){this.isPluginsReady?e():this.pluginsInitializedCallbacks.push(e)},onAfterPluginsInitialized:function(){u(this.pluginsInitializedCallbacks,function(e){return e()}),this.pluginsInitializedCallbacks.length=0,this.isPluginsReady=!0},onUpdateSettings:function(){this.isEnabled&&(this.enabled&&!this.isEnabled()&&this.disablePlugin(),!this.enabled&&this.isEnabled()&&this.enablePlugin(),this.enabled&&this.isEnabled()&&this.updatePlugin())},updatePlugin:function(){},destroy:function(){var e=this;this.eventManager&&this.eventManager.destroy(),this.clearHooks(),l(this,function(t,n){"hot"!==n&&(e[n]=null)}),delete this.hot}},{});var m=g;Handsontable.plugins.BasePlugin=g},{"helpers/array":42,"helpers/object":50,plugins:57}],59:[function(e,t,n){"use strict";Object.defineProperties(n,{AutoColumnSize:{get:function(){return D}},__esModule:{value:!0}});var o,r,i,s,a,l,u,c,d,h,f=(o=e("_base"),o&&o.__esModule&&o||{"default":o})["default"],p=(r=e("helpers/array"),r&&r.__esModule&&r||{"default":r}),g=p.arrayEach,m=p.arrayFilter,v=(i=e("helpers/dom/element"),i&&i.__esModule&&i||{"default":i}),w=v.cancelAnimationFrame,y=v.requestAnimationFrame,b=v.isVisible,C=(s=e("utils/ghostTable"),s&&s.__esModule&&s||{"default":s}).GhostTable,R=(a=e("helpers/object"),a&&a.__esModule&&a||{"default":a}),_=R.isObject,S=(R.objectEach,l=e("helpers/number"),l&&l.__esModule&&l||{"default":l}),E=S.valueAccordingPercent,T=S.rangeEach,O=(u=e("plugins"),u&&u.__esModule&&u||{"default":u}).registerPlugin,M=(c=e("utils/samplesGenerator"),c&&c.__esModule&&c||{"default":c}).SamplesGenerator,k=(d=e("helpers/string"),d&&d.__esModule&&d||{"default":d}).isPercentValue,H=(h=e("3rdparty/walkontable/src/calculator/viewportColumns"),h&&h.__esModule&&h||{"default":h}).WalkontableViewportColumnsCalculator,D=function(e){var t=this;$traceurRuntime.superConstructor(x).call(this,e),this.widths=[],this.ghostTable=new C(this.hot),this.samplesGenerator=new M(function(e,n){return t.hot.getDataAtCell(e,n)}),this.firstCalculation=!0,this.inProgress=!1,this.addHook("beforeColumnResize",function(e,n,o){return t.onBeforeColumnResize(e,n,o)})},x=D;$traceurRuntime.createClass(D,{isEnabled:function(){return this.hot.getSettings().autoColumnSize!==!1&&!this.hot.getSettings().colWidths},enablePlugin:function(){var e=this;this.enabled||(this.addHook("afterLoadData",function(){return e.onAfterLoadData()}),this.addHook("beforeChange",function(t){return e.onBeforeChange(t)}),this.addHook("beforeRender",function(t){return e.onBeforeRender(t)}),this.addHook("modifyColWidth",function(t,n){return e.getColumnWidth(n,t)}),$traceurRuntime.superGet(this,x.prototype,"enablePlugin").call(this))},disablePlugin:function(){$traceurRuntime.superGet(this,x.prototype,"disablePlugin").call(this)},calculateColumnsWidth:function(){var e=void 0!==arguments[0]?arguments[0]:{from:0,to:this.hot.countCols()-1},t=void 0!==arguments[1]?arguments[1]:{from:0,to:this.hot.countRows()-1},n=void 0!==arguments[2]?arguments[2]:!1,o=this;"number"==typeof e&&(e={from:e,to:e}),"number"==typeof t&&(t={from:t,to:t}),T(e.from,e.to,function(e){if(n||void 0===o.widths[e]&&!o.hot._getColWidthFromSettings(e)){var r=o.samplesGenerator.generateColumnSamples(e,t);r.forEach(function(e,t){return o.ghostTable.addColumn(t,e)})}}),this.ghostTable.columns.length&&(this.ghostTable.getWidths(function(e,t){return o.widths[e]=t}),this.ghostTable.clean())},calculateAllColumnsWidth:function(){var e=void 0!==arguments[0]?arguments[0]:{from:0,to:this.hot.countRows()-1},t=this,n=0,o=this.hot.countCols()-1,r=null;this.inProgress=!0;var i=function(){return t.hot?(t.calculateColumnsWidth({from:n,to:Math.min(n+x.CALCULATION_STEP,o)},e),n=n+x.CALCULATION_STEP+1,void(o>n?r=y(i):(w(r),t.inProgress=!1,t.hot.view.wt.wtOverlays.adjustElementsSize(!0),t.hot.view.wt.wtOverlays.leftOverlay.needFullRender&&t.hot.view.wt.wtOverlays.leftOverlay.clone.draw()))):(w(r),void(t.inProgress=!1))};this.firstCalculation&&this.getSyncCalculationLimit()&&(this.calculateColumnsWidth({from:0,to:this.getSyncCalculationLimit()},e),this.firstCalculation=!1,n=this.getSyncCalculationLimit()+1),o>n?i():this.inProgress=!1},recalculateAllColumnsWidth:function(){this.hot.view&&b(this.hot.view.wt.wtTable.TABLE)&&(this.clearCache(),this.calculateAllColumnsWidth())},getSyncCalculationLimit:function(){var e=x.SYNC_CALCULATION_LIMIT,t=this.hot.countCols()-1;return _(this.hot.getSettings().autoColumnSize)&&(e=this.hot.getSettings().autoColumnSize.syncLimit,k(e)?e=E(t,e):e>>=0),Math.min(e,t)},getColumnWidth:function(e){var t=arguments[1],n=void 0!==arguments[2]?arguments[2]:!0,o=t;return void 0===o&&(o=this.widths[e],n&&"number"==typeof o&&(o=Math.max(o,H.DEFAULT_WIDTH))),o},getFirstVisibleColumn:function(){var e=this.hot.view.wt;return e.wtViewport.columnsVisibleCalculator?e.wtTable.getFirstVisibleColumn():e.wtViewport.columnsRenderCalculator?e.wtTable.getFirstRenderedColumn():-1},getLastVisibleColumn:function(){var e=this.hot.view.wt;return e.wtViewport.columnsVisibleCalculator?e.wtTable.getLastVisibleColumn():e.wtViewport.columnsRenderCalculator?e.wtTable.getLastRenderedColumn():-1},clearCache:function(){this.widths.length=0},isNeedRecalculate:function(){return m(this.widths,function(e){return void 0===e}).length?!0:!1},onBeforeRender:function(){var e=this.hot.renderCall;this.calculateColumnsWidth({from:this.getFirstVisibleColumn(),to:this.getLastVisibleColumn()},void 0,e),this.isNeedRecalculate()&&!this.inProgress&&this.calculateAllColumnsWidth()},onAfterLoadData:function(){var e=this;this.hot.view?this.recalculateAllColumnsWidth():setTimeout(function(){e.hot&&e.recalculateAllColumnsWidth()},0)},onBeforeChange:function(e){var t=this;g(e,function(e){return t.widths[e[1]]=void 0})},onBeforeColumnResize:function(e,t,n){return n&&(this.calculateColumnsWidth(e,void 0,!0),t=this.getColumnWidth(e,void 0,!1)),t},destroy:function(){this.ghostTable.clean(),$traceurRuntime.superGet(this,x.prototype,"destroy").call(this)}},{get CALCULATION_STEP(){return 50},get SYNC_CALCULATION_LIMIT(){return 50}},f),O("autoColumnSize",D)},{"3rdparty/walkontable/src/calculator/viewportColumns":3,_base:58,"helpers/array":42,"helpers/dom/element":45,"helpers/number":49,"helpers/object":50,"helpers/string":52,plugins:57,"utils/ghostTable":98,"utils/samplesGenerator":99}],60:[function(e,t,n){"use strict";Object.defineProperties(n,{AutoRowSize:{get:function(){return M}},__esModule:{value:!0}});var o,r,i,s,a,l,u,c,d,h=(o=e("_base"),o&&o.__esModule&&o||{"default":o})["default"],f=(r=e("helpers/array"),r&&r.__esModule&&r||{"default":r}),p=(f.arrayEach,f.arrayFilter),g=(i=e("helpers/dom/element"),i&&i.__esModule&&i||{"default":i}),m=g.cancelAnimationFrame,v=g.requestAnimationFrame,w=g.isVisible,y=(s=e("utils/ghostTable"),s&&s.__esModule&&s||{"default":s}).GhostTable,b=(a=e("helpers/object"),a&&a.__esModule&&a||{"default":a}),C=b.isObject,R=(b.objectEach,l=e("helpers/number"),l&&l.__esModule&&l||{"default":l}),_=R.valueAccordingPercent,S=R.rangeEach,E=(u=e("plugins"),u&&u.__esModule&&u||{"default":u}).registerPlugin,T=(c=e("utils/samplesGenerator"),c&&c.__esModule&&c||{"default":c}).SamplesGenerator,O=(d=e("helpers/string"),d&&d.__esModule&&d||{"default":d}).isPercentValue,M=function(e){var t=this;$traceurRuntime.superConstructor(k).call(this,e),this.heights=[],this.ghostTable=new y(this.hot),this.samplesGenerator=new T(function(e,n){return t.hot.getDataAtCell(e,n)}),this.firstCalculation=!0,this.inProgress=!1,this.addHook("beforeRowResize",function(e,n,o){return t.onBeforeRowResize(e,n,o)})},k=M;$traceurRuntime.createClass(M,{isEnabled:function(){return this.hot.getSettings().autoRowSize===!0||C(this.hot.getSettings().autoRowSize)},enablePlugin:function(){var e=this;this.enabled||(this.addHook("afterLoadData",function(){return e.onAfterLoadData()}),this.addHook("beforeChange",function(t){return e.onBeforeChange(t)}),this.addHook("beforeColumnMove",function(){return e.recalculateAllRowsHeight()}),this.addHook("beforeColumnResize",function(){return e.recalculateAllRowsHeight()}),this.addHook("beforeColumnSort",function(){return e.clearCache()}),this.addHook("beforeRender",function(t){return e.onBeforeRender(t)}),this.addHook("beforeRowMove",function(t,n){return e.onBeforeRowMove(t,n)}),this.addHook("modifyRowHeight",function(t,n){return e.getRowHeight(n,t)}),$traceurRuntime.superGet(this,k.prototype,"enablePlugin").call(this))},disablePlugin:function(){$traceurRuntime.superGet(this,k.prototype,"disablePlugin").call(this)},calculateRowsHeight:function(){var e=void 0!==arguments[0]?arguments[0]:{from:0,to:this.hot.countRows()-1},t=void 0!==arguments[1]?arguments[1]:{from:0,to:this.hot.countCols()-1},n=void 0!==arguments[2]?arguments[2]:!1,o=this;"number"==typeof e&&(e={from:e,to:e}),"number"==typeof t&&(t={from:t,to:t}),S(e.from,e.to,function(e){if(n||void 0===o.heights[e]){var r=o.samplesGenerator.generateRowSamples(e,t);r.forEach(function(e,t){return o.ghostTable.addRow(t,e)})}}),this.ghostTable.rows.length&&(this.ghostTable.getHeights(function(e,t){return o.heights[e]=t}),this.ghostTable.clean())},calculateAllRowsHeight:function(){var e=void 0!==arguments[0]?arguments[0]:{from:0,to:this.hot.countCols()-1},t=this,n=0,o=this.hot.countRows()-1,r=null;this.inProgress=!0;var i=function(){return t.hot?(t.calculateRowsHeight({from:n, -to:Math.min(n+k.CALCULATION_STEP,o)},e),n=n+k.CALCULATION_STEP+1,void(o>n?r=v(i):(m(r),t.inProgress=!1,t.hot.view.wt.wtOverlays.adjustElementsSize(!0),t.hot.view.wt.wtOverlays.leftOverlay.needFullRender&&t.hot.view.wt.wtOverlays.leftOverlay.clone.draw()))):(m(r),void(t.inProgress=!1))};this.firstCalculation&&this.getSyncCalculationLimit()&&(this.calculateRowsHeight({from:0,to:this.getSyncCalculationLimit()},e),this.firstCalculation=!1,n=this.getSyncCalculationLimit()+1),o>n?i():this.inProgress=!1},recalculateAllRowsHeight:function(){w(this.hot.view.wt.wtTable.TABLE)&&(this.clearCache(),this.calculateAllRowsHeight())},getSyncCalculationLimit:function(){var e=k.SYNC_CALCULATION_LIMIT,t=this.hot.countRows()-1;return C(this.hot.getSettings().autoRowSize)&&(e=this.hot.getSettings().autoRowSize.syncLimit,O(e)?e=_(t,e):e>>=0),Math.min(e,t)},getRowHeight:function(e){var t=arguments[1],n=t;return void 0!==this.heights[e]&&this.heights[e]>(t||0)&&(n=this.heights[e]),n},getFirstVisibleRow:function(){var e=this.hot.view.wt;return e.wtViewport.rowsVisibleCalculator?e.wtTable.getFirstVisibleRow():e.wtViewport.rowsRenderCalculator?e.wtTable.getFirstRenderedRow():-1},getLastVisibleRow:function(){var e=this.hot.view.wt;return e.wtViewport.rowsVisibleCalculator?e.wtTable.getLastVisibleRow():e.wtViewport.rowsRenderCalculator?e.wtTable.getLastRenderedRow():-1},clearCache:function(){this.heights.length=0},clearCacheByRange:function(e){var t=this;"number"==typeof e&&(e={from:e,to:e}),S(Math.min(e.from,e.to),Math.max(e.from,e.to),function(e){return t.heights[e]=void 0})},isNeedRecalculate:function(){return p(this.heights,function(e){return void 0===e}).length?!0:!1},onBeforeRender:function(){var e=this.hot.renderCall;this.calculateRowsHeight({from:this.getFirstVisibleRow(),to:this.getLastVisibleRow()},void 0,e),this.isNeedRecalculate()&&!this.inProgress&&this.calculateAllRowsHeight()},onBeforeRowMove:function(e,t){this.clearCacheByRange({from:e,to:t}),this.calculateAllRowsHeight()},onBeforeRowResize:function(e,t,n){return n&&(this.calculateRowsHeight(e,void 0,!0),t=this.getRowHeight(e)),t},onAfterLoadData:function(){var e=this;this.hot.view?this.recalculateAllRowsHeight():setTimeout(function(){e.hot&&e.recalculateAllRowsHeight()},0)},onBeforeChange:function(e){var t=null;1===e.length?t=e[0][0]:e.length>1&&(t={from:e[0][0],to:e[e.length-1][0]}),null!==t&&this.clearCacheByRange(t)},destroy:function(){this.ghostTable.clean(),$traceurRuntime.superGet(this,k.prototype,"destroy").call(this)}},{get CALCULATION_STEP(){return 50},get SYNC_CALCULATION_LIMIT(){return 500}},h),E("autoRowSize",M)},{_base:58,"helpers/array":42,"helpers/dom/element":45,"helpers/number":49,"helpers/object":50,"helpers/string":52,plugins:57,"utils/ghostTable":98,"utils/samplesGenerator":99}],61:[function(e,t,n){"use strict";function o(e,t,n,o){var r,i,s,a,l,u=n.length,c=n?n[0].length:0,d=[],h=[];if(r=t.row-e.row,i=t.col-e.col,-1!==["down","up"].indexOf(o)){for(var f=0;i>=f;f++)s=parseInt(n[0][f],10),a=parseInt(n[u-1][f],10),l=("down"===o?a-s:s-a)/(u-1)||0,h.push(l);d.push(h)}if(-1!==["right","left"].indexOf(o))for(var p=0;r>=p;p++)s=parseInt(n[p][0],10),a=parseInt(n[p][c-1],10),l=("right"===o?a-s:s-a)/(c-1)||0,h=[],h.push(l),d.push(h);return d}function r(e){function t(t){return e.autofill?void(e.autofill.handle&&e.autofill.handle.isDragged&&(e.autofill.handle.isDragged>1&&e.autofill.apply(),e.autofill.handle.isDragged=0,a=!1)):!0}function n(e){var t,n;return s.instance.autofill?(t=c(s.instance.table).top-(window.pageYOffset||document.documentElement.scrollTop)+d(s.instance.table),n=c(s.instance.table).left-(window.pageXOffset||document.documentElement.scrollLeft)+h(s.instance.table),s.addingStarted===!1&&s.instance.autofill.handle.isDragged>0&&e.clientY>t&&e.clientX<=n?(s.instance.mouseDragOutside=!0,s.addingStarted=!0):s.instance.mouseDragOutside=!1,void(s.instance.mouseDragOutside&&setTimeout(function(){s.addingStarted=!1,s.instance.alter("insert_row")},200))):!1}var o,r,i,s=this,a=!1;this.instance=e,this.addingStarted=!1,i=f(e),i.addEventListener(document,"mouseup",t),i.addEventListener(document,"mousemove",n),o=this.instance.view.wt.wtSettings.settings.onCellCornerMouseDown,this.instance.view.wt.wtSettings.settings.onCellCornerMouseDown=function(t){e.autofill.handle.isDragged=1,a=!0,o(t)},r=this.instance.view.wt.wtSettings.settings.onCellMouseOver,this.instance.view.wt.wtSettings.settings.onCellMouseOver=function(t,n,o,i){e.autofill&&a&&!e.view.isMouseDown()&&e.autofill.handle&&e.autofill.handle.isDragged&&(e.autofill.handle.isDragged++,e.autofill.showBorder(n),e.autofill.checkIfNewRowNeeded()),r(t,n,o,i)},this.instance.view.wt.wtSettings.settings.onCellCornerDblClick=function(){e.autofill.selectAdjacent()}}Object.defineProperties(n,{Autofill:{get:function(){return r}},__esModule:{value:!0}});var i,s,a,l,u=(i=e("helpers/dom/element"),i&&i.__esModule&&i||{"default":i}),c=u.offset,d=u.outerHeight,h=u.outerWidth,f=(s=e("eventManager"),s&&s.__esModule&&s||{"default":s}).eventManager,p=((a=e("plugins"),a&&a.__esModule&&a||{"default":a}).registerPlugin,(l=e("3rdparty/walkontable/src/cell/coords"),l&&l.__esModule&&l||{"default":l}).WalkontableCellCoords);r.prototype.init=function(){this.handle={}},r.prototype.disable=function(){this.handle.disabled=!0},r.prototype.selectAdjacent=function(){var e,t,n,o,r;e=this.instance.selection.isMultiple()?this.instance.view.wt.selections.area.getCorners():this.instance.view.wt.selections.current.getCorners(),t=this.instance.getData();e:for(n=e[2]+1;nt[3]?(s="right",n=new p(e[0],t[3]+1),r=new p(e[2],e[3])):e[0]t[2]&&e[1]===t[1]&&(s="down",n=new p(t[2]+1,e[1]),r=new p(e[2],e[3])),n&&n.row>-1&&n.col>-1?(l={from:this.instance.getSelectedRange().from,to:this.instance.getSelectedRange().to},i=this.instance.getData(l.from.row,l.from.col,l.to.row,l.to.col),a=o(n,r,i,s),Handsontable.hooks.run(this.instance,"beforeAutofill",n,r,i),this.instance.populateFromArray(n.row,n.col,i,r.row,r.col,"autofill",null,s,a),this.instance.selection.setRangeStart(new p(e[0],e[1])),this.instance.selection.setRangeEnd(new p(e[2],e[3]))):this.instance.selection.refreshBorders())},r.prototype.showBorder=function(e){var t=this.instance.getSelectedRange().getTopLeftCorner(),n=this.instance.getSelectedRange().getBottomRightCorner();if("horizontal"!==this.instance.getSettings().fillHandle&&(n.rowe.row))e=new p(e.row,n.col);else{if("vertical"===this.instance.getSettings().fillHandle)return;e=new p(n.row,e.col)}this.instance.view.wt.selections.fill.clear(),this.instance.view.wt.selections.fill.add(this.instance.getSelectedRange().from),this.instance.view.wt.selections.fill.add(this.instance.getSelectedRange().to),this.instance.view.wt.selections.fill.add(e),this.instance.view.render()},r.prototype.checkIfNewRowNeeded=function(){var e,t,n=this.instance.countRows(),o=this;this.instance.view.wt.selections.fill.cellRange&&this.addingStarted===!1&&(t=this.instance.getSelected(),e=this.instance.view.wt.selections.fill.getCorners(),t[2]n[1]?e?1:-1:0}},dateSort:function(e){return function(t,n){if(t[1]===n[1])return 0;if(null===t[1]||""===t[1])return 1;if(null===n[1]||""===n[1])return-1;var o=new Date(t[1]),r=new Date(n[1]);return r>o?e?-1:1:o>r?e?1:-1:0}},sort:function(){if("undefined"==typeof this.hot.sortOrder)return void(this.hot.sortIndex.length=0);var e,t;this.hot.sortingEnabled=!1,this.hot.sortIndex.length=0;for(var n=this.hot.colOffset(),o=0,r=this.hot.countRows()-this.hot.getSettings().minSpareRows;r>o;o++)this.hot.sortIndex.push([o,this.hot.getDataAtCell(o,this.hot.sortColumn+n)]);switch(e=this.hot.getCellMeta(0,this.hot.sortColumn),this.sortIndicators[this.hot.sortColumn]=e.sortIndicator,e.type){case"date":t=this.dateSort;break;default:t=this.defaultSort}this.hot.sortIndex.sort(t(this.hot.sortOrder));for(var o=this.hot.sortIndex.length;o=0&&-1===r&&u(n,"columnSorting"),f(n,"descending"),f(n,"ascending"),this.sortIndicators[e]&&e===this.hot.sortColumn&&("ascending"===this.sortOrderClass?u(n,"ascending"):"descending"===this.sortOrderClass&&u(n,"descending")))},isSorted:function(){return"undefined"!=typeof this.hot.sortColumn},afterCreateRow:function(e,t){if(this.isSorted()){for(var n=0;n=e&&(this.hot.sortIndex[n][0]+=t);for(var n=0;t>n;n++)this.hot.sortIndex.splice(e+n,0,[e+n,this.hot.getSourceData()[e+n][this.hot.sortColumn+this.hot.colOffset()]]);this.saveSortingState()}},afterRemoveRow:function(e,t){function n(e){return m(o,function(t,n){return e>n&&t++,t},0)}if(this.isSorted()){var o=this.hot.sortIndex.splice(e,t);o=g(o,function(e){return e[0]}),this.hot.sortIndex=g(this.hot.sortIndex,function(e,t){var o=n(e[0]);return o&&(e[0]-=o),e}),this.saveSortingState()}}},{},w),y("columnSorting",b)},{_base:58,eventManager:41,"helpers/array":42,"helpers/dom/element":45,plugins:57}],63:[function(e,t,n){"use strict";Object.defineProperties(n,{CommentEditor:{get:function(){return i}},__esModule:{value:!0}});var o,r=(o=e("helpers/dom/element"),o&&o.__esModule&&o||{"default":o}).addClass,i=function(){this.editor=this.createEditor(),this.editorStyle=this.editor.style,this.editorStyle.position="absolute",this.editorStyle.zIndex=100,this.hide()},s=i;$traceurRuntime.createClass(i,{setPosition:function(e,t){this.editorStyle.left=e+"px",this.editorStyle.top=t+"px"},show:function(){this.editorStyle.display="block"},hide:function(){this.editorStyle.display="none"},isVisible:function(){return"block"===this.editorStyle.display},setValue:function(){var e=void 0!==arguments[0]?arguments[0]:"";e=e||"",this.getInputElement().value=e},getValue:function(){return this.getInputElement().value},isFocused:function(){return document.activeElement===this.getInputElement()},focus:function(){this.getInputElement().focus()},createEditor:function(){var e,t,n=document.querySelector("."+s.CLASS_EDITOR_CONTAINER);return n||(n=document.createElement("div"),r(n,s.CLASS_EDITOR_CONTAINER),document.body.appendChild(n)),e=document.createElement("div"),r(e,s.CLASS_EDITOR),t=document.createElement("textarea"),r(t,s.CLASS_INPUT),e.appendChild(t),n.appendChild(e),e},getInputElement:function(){return this.editor.querySelector("."+s.CLASS_INPUT)},destroy:function(){this.editor.parentNode.removeChild(this.editor),this.editor=null,this.editorStyle=null}},{get CLASS_EDITOR_CONTAINER(){return"htCommentsContainer"},get CLASS_EDITOR(){return"htComments"},get CLASS_INPUT(){return"htCommentTextArea"},get CLASS_CELL(){return"htCommentCell"}})},{"helpers/dom/element":45}],64:[function(e,t,n){"use strict";Object.defineProperties(n,{Comments:{get:function(){return R}},__esModule:{value:!0}});var o,r,i,s,a,l,u=(o=e("helpers/dom/element"),o&&o.__esModule&&o||{"default":o}),c=u.addClass,d=u.closest,h=u.getWindowScrollLeft,f=u.getWindowScrollTop,p=u.hasClass,g=u.offset,m=(r=e("eventManager"),r&&r.__esModule&&r||{"default":r}).EventManager,v=(i=e("3rdparty/walkontable/src/cell/coords"),i&&i.__esModule&&i||{"default":i}).WalkontableCellCoords,w=(s=e("plugins"),s&&s.__esModule&&s||{"default":s}),y=w.registerPlugin,b=(w.getPlugin,(a=e("_base"),a&&a.__esModule&&a||{"default":a})["default"]),C=(l=e("commentEditor"),l&&l.__esModule&&l||{"default":l}).CommentEditor,R=function(e){$traceurRuntime.superConstructor(_).call(this,e),this.editor=null,this.eventManager=null,this.range={},this.mouseDown=!1,this.contextMenuEvent=!1,this.timer=null},_=R;$traceurRuntime.createClass(R,{isEnabled:function(){return this.hot.getSettings().comments},enablePlugin:function(){var e=this;this.enabled||(this.editor||(this.editor=new C),this.eventManager||(this.eventManager=new m(this)),this.addHook("afterContextMenuDefaultOptions",function(t){return e.addToContextMenu(t)}),this.addHook("afterRenderer",function(t,n,o,r,i,s){return e.onAfterRenderer(t,s)}),this.addHook("afterScrollVertically",function(){return e.refreshEditorPosition()}),this.addHook("afterColumnResize",function(){return e.refreshEditorPosition()}),this.addHook("afterRowResize",function(){return e.refreshEditorPosition()}),this.registerListeners(),$traceurRuntime.superGet(this,_.prototype,"enablePlugin").call(this))},disablePlugin:function(){$traceurRuntime.superGet(this,_.prototype,"disablePlugin").call(this)},registerListeners:function(){var e=this;this.eventManager.addEventListener(document,"mouseover",function(t){return e.onMouseOver(t)}),this.eventManager.addEventListener(document,"mousedown",function(t){return e.onMouseDown(t)}),this.eventManager.addEventListener(document,"mousemove",function(t){return e.onMouseMove(t)}),this.eventManager.addEventListener(document,"mouseup",function(t){return e.onMouseUp(t)}),this.eventManager.addEventListener(this.editor.getInputElement(),"blur",function(t){return e.onEditorBlur(t)})},setRange:function(e){this.range=e},clearRange:function(){this.range={}},targetIsCellWithComment:function(e){return p(e.target,"htCommentCell")&&d(e.target,[this.hot.rootElement])?!0:!1},targetIsCommentTextArea:function(e){return this.editor.getInputElement()===e.target},saveComment:function(){if(!this.range.from)throw new Error('Before using this method, first set cell range (hot.getPlugin("comment").setRange())');var e=this.editor.getValue(),t=this.range.from.row,n=this.range.from.col;this.hot.setCellMeta(t,n,"comment",e),this.hot.render()},saveCommentAtCell:function(e,t){this.setRange({from:new v(e,t)}),this.saveComment()},removeComment:function(){if(!this.range.from)throw new Error('Before using this method, first set cell range (hot.getPlugin("comment").setRange())');this.hot.removeCellMeta(this.range.from.row,this.range.from.col,"comment"),this.hot.render(),this.hide()},removeCommentAtCell:function(e,t){this.setRange({from:new v(e,t)}),this.removeComment()},show:function(){if(!this.range.from)throw new Error('Before using this method, first set cell range (hot.getPlugin("comment").setRange())');var e=this.hot.getCellMeta(this.range.from.row,this.range.from.col);return this.refreshEditorPosition(!0),this.editor.setValue(e.comment||""),this.editor.show(),!0},showAtCell:function(e,t){return this.setRange({from:new v(e,t)}),this.show()},hide:function(){this.editor.hide()},refreshEditorPosition:function(){var e=void 0!==arguments[0]?arguments[0]:!1;if(e||this.range.from&&this.editor.isVisible()){var t=this.hot.view.wt.wtTable.getCell(this.range.from),n=g(t),o=this.hot.getColWidth(this.range.from.col),r=n.top,i=n.left,s=0,a=0;this.hot.view.wt.wtViewport.hasVerticalScroll()&&(r-=this.hot.view.wt.wtOverlays.topOverlay.getScrollPosition(),s=20),this.hot.view.wt.wtViewport.hasHorizontalScroll()&&(i-=this.hot.view.wt.wtOverlays.leftOverlay.getScrollPosition(),a=20);var l=i+o,u=r,c=this.hot.view.wt.wtTable.holder.getBoundingClientRect(),d={left:c.left+h()+a,right:c.right+h()-15,top:c.top+f()+s,bottom:c.bottom+f()};l<=d.left||l>d.right||u<=d.top||u>d.bottom?this.hide():this.editor.setPosition(l,u)}},onMouseDown:function(e){this.mouseDown=!0,this.hot.view&&this.hot.view.wt&&(this.contextMenuEvent||this.targetIsCommentTextArea(e)||this.targetIsCellWithComment(e)||this.hide(),this.contextMenuEvent=!1)},onMouseOver:function(e){if(!this.mouseDown&&!this.editor.isFocused())if(this.targetIsCellWithComment(e)){var t=this.hot.view.wt.wtTable.getCoords(e.target),n={from:new v(t.row,t.col)};this.setRange(n),this.show()}else this.targetIsCommentTextArea(e)||this.editor.isFocused()||this.hide()},onMouseMove:function(e){var t=this;this.targetIsCommentTextArea(e)&&(this.mouseDown=!0,clearTimeout(this.timer),this.timer=setTimeout(function(){t.mouseDown=!1},200))},onMouseUp:function(e){this.mouseDown=!1},onAfterRenderer:function(e,t){t.comment&&c(e,t.commentedCellClassName)},onEditorBlur:function(e){this.saveComment()},checkSelectionCommentsConsistency:function(){var e=this.hot.getSelectedRange();if(!e)return!1;var t=!1,n=e.from;return this.hot.getCellMeta(n.row,n.col).comment&&(t=!0),t},onContextMenuAddComment:function(){var e=this,t=this.hot.getSelectedRange();this.contextMenuEvent=!0,this.setRange({from:t.from}),this.show(),setTimeout(function(){e.hot&&(e.hot.deselectCell(),e.editor.focus())},10)},onContextMenuRemoveComment:function(e,t){this.contextMenuEvent=!0,this.removeCommentAtCell(t.start.row,t.start.col)},addToContextMenu:function(e){var t=this;e.items.push(Handsontable.plugins.ContextMenu.SEPARATOR,{key:"commentsAddEdit",name:function(){return t.checkSelectionCommentsConsistency()?"Edit Comment":"Add Comment"},callback:function(){return t.onContextMenuAddComment()},disabled:function(){return this.getSelected()?!1:!0}},{key:"commentsRemove",name:function(){return"Delete Comment"},callback:function(e,n){return t.onContextMenuRemoveComment(e,n)},disabled:function(){return!t.checkSelectionCommentsConsistency()}})},destroy:function(){this.editor&&this.editor.destroy(),$traceurRuntime.superGet(this,_.prototype,"destroy").call(this)}},{},b),y("comments",R)},{"3rdparty/walkontable/src/cell/coords":5,_base:58,commentEditor:63,eventManager:41,"helpers/dom/element":45,plugins:57}],65:[function(e,t,n){"use strict";function o(e,t){var n;return i(t,function(t){var o=t.key?t.key.split(":"):null;return Array.isArray(o)&&o[1]===e?(n=t,!1):void 0}),n}Object.defineProperties(n,{CommandExecutor:{get:function(){return s}},__esModule:{value:!0}});var r,i=(r=e("helpers/array"),r&&r.__esModule&&r||{"default":r}).arrayEach,s=function(e){this.hot=e,this.commands={},this.commonCallback=null};$traceurRuntime.createClass(s,{registerCommand:function(e,t){this.commands[e]=t},setCommonCallback:function(e){this.commonCallback=e},execute:function(e){for(var t=[],n=1;n0;if(s)return}}else if(!(t(i)||w(i,"current")&&w(i,"wtBorder")))return;this.open(e)},onMenuAfterOpen:function(){this.hot.runHooks("afterContextMenuShow",this)},onMenuAfterClose:function(){this.hot.listen(),this.hot.runHooks("afterContextMenuHide",this)},destroy:function(){this.close(),this.menu&&this.menu.destroy(),$traceurRuntime.superGet(this,W.prototype,"destroy").call(this)}},{get DEFAULT_ITEMS(){return[E,T,N,O,M,N,k,H,N,D,x,N,A,N,P]}},p),L.SEPARATOR={name:N},Handsontable.hooks.register("afterContextMenuDefaultOptions"),Handsontable.hooks.register("afterContextMenuShow"),Handsontable.hooks.register("afterContextMenuHide"),Handsontable.hooks.register("afterContextMenuExecute"),R("contextMenu",L)},{_base:58,commandExecutor:65,eventManager:41,"helpers/array":42,"helpers/dom/element":45,"helpers/dom/event":46,"helpers/object":50,itemsFactory:68,menu:69,plugins:57,predefinedItems:70}],67:[function(e,t,n){"use strict";Object.defineProperties(n,{Cursor:{get:function(){return d}},__esModule:{value:!0}});var o,r,i=(o=e("helpers/dom/element"),o&&o.__esModule&&o||{"default":o}),s=i.getWindowScrollLeft,a=i.getWindowScrollTop,l=(r=e("helpers/dom/event"),r&&r.__esModule&&r||{"default":r}),u=l.pageX,c=l.pageY,d=function(e){var t,n,o,r,i,l,d,h,f=a(),p=s();this.type=this.getSourceType(e),"literal"===this.type?(t=parseInt(e.top,10),o=parseInt(e.left,10),d=e.height,h=e.width):"event"===this.type&&(t=parseInt(c(e),10),o=parseInt(u(e),10),d=e.target.clientHeight,h=e.target.clientWidth),n=t-f,r=o-p,i=f,l=p,this.top=t,this.topRelative=n,this.left=o,this.leftRelative=r,this.scrollTop=i,this.scrollLeft=l,this.cellHeight=d,this.cellWidth=h};$traceurRuntime.createClass(d,{getSourceType:function(e){var t="literal";return e instanceof Event&&(t="event"),t},fitsAbove:function(e){return this.topRelative>=e.offsetHeight},fitsBelow:function(e){var t=void 0!==arguments[1]?arguments[1]:window.innerHeight;return this.topRelative+e.offsetHeight<=t},fitsOnRight:function(e){var t=void 0!==arguments[1]?arguments[1]:window.innerWidth;return this.leftRelative+this.cellWidth+e.offsetWidth<=t},fitsOnLeft:function(e){return this.leftRelative>=e.offsetWidth}},{}),Handsontable.plugins.utils=Handsontable.plugins.utils||{},Handsontable.plugins.utils.Cursor=d},{"helpers/dom/element":45,"helpers/dom/event":46}],68:[function(e,t,n){"use strict";function o(){var e=void 0!==arguments[0]?arguments[0]:null,t=void 0!==arguments[1]?arguments[1]:[],n=void 0!==arguments[2]?arguments[2]:{},o=[];return e&&e.items?e=e.items:Array.isArray(e)||(e=t),u(e)?l(e,function(e,t){var r=n["string"==typeof e?e:t];r||(r=e),u(e)?c(r,e):"string"==typeof r&&(r={name:r}),void 0===r.key&&(r.key=t),o.push(r)}):d(e,function(e,t){var r=n[e];!r&&p.indexOf(e)>=0||(r||(r={name:e,key:t+""}),u(e)&&c(r,e),void 0===r.key&&(r.key=t),o.push(r))}),o[0].name===f&&o.shift(),o}Object.defineProperties(n,{ItemsFactory:{get:function(){return m}},__esModule:{value:!0}});var r,i,s,a=(r=e("helpers/object"),r&&r.__esModule&&r||{"default":r}),l=a.objectEach,u=a.isObject,c=a.extend,d=(i=e("helpers/array"),i&&i.__esModule&&i||{"default":i}).arrayEach,h=(s=e("predefinedItems"),s&&s.__esModule&&s||{"default":s}),f=h.SEPARATOR,p=h.ITEMS,g=h.predefinedItems,m=function(e){var t=void 0!==arguments[1]?arguments[1]:null;this.hot=e,this.predefinedItems=g(),this.defaultOrderPattern=t};$traceurRuntime.createClass(m,{setPredefinedItems:function(e){var t=this,n={};this.defaultOrderPattern.length=0,l(e,function(e,o){var r="";e.name===f?(n[f]=e,r=f):isNaN(parseInt(o,10))?(e.key=void 0===e.key?o:e.key,n[o]=e,r=e.key):(n[e.key]=e,r=e.key),t.defaultOrderPattern.push(r)}),this.predefinedItems=n},getVisibleItems:function(){var e=void 0!==arguments[0]?arguments[0]:null,t=this,n={};return l(this.predefinedItems,function(e,o){(!e.hidden||e.hidden&&!e.hidden.apply(t.hot))&&(n[o]=e)}),o(e,this.defaultOrderPattern,n)},getItems:function(){ -var e=void 0!==arguments[0]?arguments[0]:null;return o(e,this.defaultOrderPattern,this.predefinedItems)}},{})},{"helpers/array":42,"helpers/object":50,predefinedItems:70}],69:[function(e,t,n){"use strict";Object.defineProperties(n,{Menu:{get:function(){return W}},__esModule:{value:!0}});var o,r,i,s,a,l,u,c,d,h,f=(o=e("helpers/dom/element"),o&&o.__esModule&&o||{"default":o}),p=f.addClass,g=f.empty,m=f.fastInnerHTML,v=(f.getComputedStyle,f.getScrollbarWidth),w=(f.getWindowScrollLeft,f.getWindowScrollTop,f.hasClass,f.isChildOf),y=f.removeClass,b=(r=e("helpers/array"),r&&r.__esModule&&r||{"default":r}).arrayEach,C=(i=e("cursor"),i&&i.__esModule&&i||{"default":i}).Cursor,R=(s=e("eventManager"),s&&s.__esModule&&s||{"default":s}).EventManager,_=(a=e("helpers/object"),a&&a.__esModule&&a||{"default":a}),S=(_.extend,_.isObject,_.objectEach,_.mixin),E=(l=e("utils"),l&&l.__esModule&&l||{"default":l}),T=E.isSeparator,O=E.isDisabled,M=E.isSelectionDisabled,k=E.hasSubMenu,H=E.normalizeSelection,D=(u=e("helpers/unicode"),u&&u.__esModule&&u||{"default":u}).KEY_CODES,x=(c=e("mixins/localHooks"),c&&c.__esModule&&c||{"default":c}).localHooks,A=(d=e("predefinedItems"),d&&d.__esModule&&d||{"default":d}),P=A.SEPARATOR,N=(A.predefinedItems,h=e("helpers/dom/event"),h&&h.__esModule&&h||{"default":h}),L=(N.stopPropagation,N.stopImmediatePropagation),W=(N.pageX,N.pageY,function(e){var t=void 0!==arguments[1]?arguments[1]:{parent:null,name:null,className:"",keepInViewport:!0};this.hot=e,this.options=t,this.eventManager=new R(this),this.container=this.createContainer(this.options.name),this.hotMenu=null,this.hotSubMenus={},this.parentMenu=this.options.parent||null,this.menuItems=null,this.origOutsideClickDeselects=null,this._afterScrollCallback=null,this.registerEvents()}),I=W;$traceurRuntime.createClass(W,{registerEvents:function(){var e=this;this.eventManager.addEventListener(document.documentElement,"mousedown",function(t){return e.onDocumentMouseDown(t)})},setMenuItems:function(e){this.menuItems=e},isSubMenu:function(){return null!==this.parentMenu},open:function(){var e=this;this.container.removeAttribute("style"),this.container.style.display="block";var t={data:this.menuItems,colHeaders:!1,colWidths:[200],autoRowSize:!1,readOnly:!0,copyPaste:!1,columns:[{data:"name",renderer:function(t,n,o,r,i,s){return e.menuItemRenderer(t,n,o,r,i,s)}}],renderAllRows:!0,fragmentSelection:"cell",beforeKeyDown:function(t){return e.onBeforeKeyDown(t)},afterOnCellMouseOver:function(t,n,o){return e.openSubMenu(n.row)}};this.origOutsideClickDeselects=this.hot.getSettings().outsideClickDeselects,this.hot.getSettings().outsideClickDeselects=!1,this.hotMenu=new Handsontable.Core(this.container,t),this.hotMenu.addHook("afterInit",function(){return e.onAfterInit()}),this.hotMenu.init(),this.hotMenu.listen(),this.blockMainTableCallbacks(),this.runLocalHooks("afterOpen")},close:function(){var e=void 0!==arguments[0]?arguments[0]:!1;this.isOpened()&&(e&&this.parentMenu?this.parentMenu.close():(this.closeAllSubMenus(),this.container.style.display="none",this.releaseMainTableCallbacks(),this.hotMenu.destroy(),this.hotMenu=null,this.hot.getSettings().outsideClickDeselects=this.origOutsideClickDeselects,this.runLocalHooks("afterClose")))},openSubMenu:function(e){var t=this.hotMenu.getCell(e,0);if(this.closeAllSubMenus(),!t||!k(t))return!1;var n=this.hotMenu.getSourceDataAtRow(e),o=new I(this.hot,{parent:this,name:n.name,className:this.options.className});return o.setMenuItems(n.submenu.items),o.open(),o.setPosition(t.getBoundingClientRect()),this.hotSubMenus[n.key]=o,o},closeSubMenu:function(e){var t=this.hotMenu.getSourceDataAtRow(e),n=this.hotSubMenus[t.key];n&&(n.destroy(),delete this.hotSubMenus[t.key])},closeAllSubMenus:function(){var e=this;b(this.hotMenu.getData(),function(t,n){return e.closeSubMenu(n)})},isAllSubMenusClosed:function(){return 0===Object.keys(this.hotSubMenus).length},destroy:function(){this.clearLocalHooks(),this.close(),this.parentMenu=null,this.eventManager.destroy()},isOpened:function(){return null!==this.hotMenu},executeCommand:function(e){if(this.isOpened()&&this.hotMenu.getSelected()){var t=this.hotMenu.getSourceDataAtRow(this.hotMenu.getSelected()[0]);if(this.runLocalHooks("select",t,e),t.isCommand!==!1){var n=this.hot.getSelectedRange(),o=n?H(n):{};this.runLocalHooks("executeCommand",t.key,o,e),this.isSubMenu()&&this.parentMenu.runLocalHooks("executeCommand",t.key,o,e),this.close(!0)}}},setPosition:function(e){var t=new C(e);this.options.keepInViewport?(t.fitsBelow(this.container)?this.setPositionBelowCursor(t):t.fitsAbove(this.container)?this.setPositionAboveCursor(t):this.setPositionBelowCursor(t),t.fitsOnRight(this.container)?this.setPositionOnRightOfCursor(t):this.setPositionOnLeftOfCursor(t)):(this.setPositionBelowCursor(t),this.setPositionOnRightOfCursor(t))},setPositionAboveCursor:function(e){var t=e.top-this.container.offsetHeight;this.isSubMenu()&&(t=window.scrollY+e.top+e.cellHeight-this.container.offsetHeight+3),this.container.style.top=t+"px"},setPositionBelowCursor:function(e){var t=e.top-1;this.isSubMenu()&&(t=e.top+window.scrollY-1),this.container.style.top=t+"px"},setPositionOnRightOfCursor:function(e){var t;t=this.isSubMenu()?window.scrollX+1+e.left+e.cellWidth:1+e.left,this.container.style.left=t+"px"},setPositionOnLeftOfCursor:function(e){this.container.style.left=e.left-this.container.offsetWidth+v()+4+"px"},selectFirstCell:function(){var e=this.hotMenu.getCell(0,0);T(e)||O(e)||M(e)?this.selectNextCell(0,0):this.hotMenu.selectCell(0,0)},selectLastCell:function(){var e=this.hotMenu.countRows()-1,t=this.hotMenu.getCell(e,0);T(t)||O(t)||M(t)?this.selectPrevCell(e,0):this.hotMenu.selectCell(e,0)},selectNextCell:function(e,t){var n=e+1,o=n=0?this.hotMenu.getCell(n,t):null;o&&(T(o)||O(o)||M(o)?this.selectPrevCell(n,t):this.hotMenu.selectCell(n,t))},menuItemRenderer:function(e,t,n,o,r,i){var s=this,a=e.getSourceDataAtRow(n),l=document.createElement("div"),u=function(e){return e.hasOwnProperty("submenu")},c=function(e){return new RegExp(P,"i").test(e.name)},d=function(e){return e.disabled===!0||"function"==typeof e.disabled&&e.disabled.call(s.hot)===!0},h=function(e){return"function"==typeof e.hidden&&e.hidden.call(s.hot)===!0},f=function(e){return e.disableSelection},v=h(a);"function"==typeof i&&(i=i.call(this.hot)),g(t),p(l,"htItemWrapper"),t.appendChild(l),c(a)?p(t,"htSeparator"):v||"function"!=typeof a.renderer?m(l,i):(p(t,"htCustomMenuRenderer"),t.appendChild(a.renderer(e,l,n,o,r,i))),v?t.parentNode&&p(t.parentNode,"htHidden"):d(a)?(p(t,"htDisabled"),this.eventManager.addEventListener(l,"mouseenter",function(){return e.deselectCell()})):f(a)?(p(t,"htSelectionDisabled"),this.eventManager.addEventListener(l,"mouseenter",function(){return e.deselectCell()})):u(a)?(p(t,"htSubmenu"),f(a)?this.eventManager.addEventListener(l,"mouseenter",function(){return e.deselectCell()}):this.eventManager.addEventListener(l,"mouseenter",function(){return e.selectCell(n,o,void 0,void 0,void 0,!1)})):(y(t,"htSubmenu"),y(t,"htDisabled"),f(a)?this.eventManager.addEventListener(l,"mouseenter",function(){return e.deselectCell()}):this.eventManager.addEventListener(l,"mouseenter",function(){return e.selectCell(n,o,void 0,void 0,void 0,!1)}))},createContainer:function(){var e=void 0!==arguments[0]?arguments[0]:null;e&&(e=e.replace(/ /g,"_"),e=this.options.className+"Sub_"+e);var t;return t=e?document.querySelector("."+this.options.className+"."+e):document.querySelector("."+this.options.className),t||(t=document.createElement("div"),p(t,"htMenu "+this.options.className),e&&p(t,e),document.getElementsByTagName("body")[0].appendChild(t)),t},blockMainTableCallbacks:function(){this._afterScrollCallback=function(){},this.hot.addHook("afterScrollVertically",this._afterScrollCallback),this.hot.addHook("afterScrollHorizontally",this._afterScrollCallback)},releaseMainTableCallbacks:function(){this._afterScrollCallback&&(this.hot.removeHook("afterScrollVertically",this._afterScrollCallback),this.hot.removeHook("afterScrollHorizontally",this._afterScrollCallback),this._afterScrollCallback=null)},onBeforeKeyDown:function(e){var t=this.hotMenu.getSelected(),n=!1;switch(e.keyCode){case D.ESCAPE:this.close(),n=!0;break;case D.ENTER:t&&(this.hotMenu.getSourceDataAtRow(t[0]).submenu?n=!0:(this.executeCommand(e),this.close(!0)));break;case D.ARROW_DOWN:t?this.selectNextCell(t[0],t[1]):this.selectFirstCell(),n=!0;break;case D.ARROW_UP:t?this.selectPrevCell(t[0],t[1]):this.selectLastCell(),n=!0;break;case D.ARROW_RIGHT:if(t){var o=this.openSubMenu(t[0]);o&&o.selectFirstCell()}n=!0;break;case D.ARROW_LEFT:t&&this.isSubMenu()&&(this.close(),this.parentMenu&&this.parentMenu.hotMenu.listen(),n=!0)}n&&(e.preventDefault(),L(e))},onAfterInit:function(){var e=this.hotMenu.getSettings().data,t=this.hotMenu.view.wt.wtTable.hider.style,n=this.hotMenu.view.wt.wtTable.holder.style,o=parseInt(t.width,10),r=0;b(e,function(e){return r+=e.name===P?1:26}),n.width=o+22+"px",n.height=r+4+"px"},onDocumentMouseDown:function(e){this.isOpened()&&(this.container&&w(e.target,this.container)&&this.executeCommand(e),(this.isAllSubMenusClosed()||this.isSubMenu())&&!w(e.target,".htMenu")&&w(e.target,document)&&this.close(!0))}},{}),S(W,x)},{cursor:67,eventManager:41,"helpers/array":42,"helpers/dom/element":45,"helpers/dom/event":46,"helpers/object":50,"helpers/unicode":53,"mixins/localHooks":54,predefinedItems:70,utils:71}],70:[function(e,t,n){"use strict";function o(){var e={};return c(D,function(t,n){return e[n]=d(t)}),e}function r(e,t){-1===H.indexOf(e)&&(D[e]=t)}var i;Object.defineProperties(n,{ROW_ABOVE:{get:function(){return w}},ROW_BELOW:{get:function(){return y}},COLUMN_LEFT:{get:function(){return b}},COLUMN_RIGHT:{get:function(){return C}},CLEAR_COLUMN:{get:function(){return R}},REMOVE_ROW:{get:function(){return _}},REMOVE_COLUMN:{get:function(){return S}},UNDO:{get:function(){return E}},REDO:{get:function(){return T}},READ_ONLY:{get:function(){return O}},ALIGNMENT:{get:function(){return M}},SEPARATOR:{get:function(){return k}},ITEMS:{get:function(){return H}},predefinedItems:{get:function(){return o}},addItem:{get:function(){return r}},__esModule:{value:!0}});var s,a,l,u=(s=e("helpers/object"),s&&s.__esModule&&s||{"default":s}),c=u.objectEach,d=u.clone,h=((a=e("helpers/number"),a&&a.__esModule&&a||{"default":a}).rangeEach,l=e("utils"),l&&l.__esModule&&l||{"default":l}),f=h.align,p=h.getAlignmentClasses,g=h.getValidSelection,m=h.checkSelectionConsistency,v=h.markLabelAsSelected,w="row_above",y="row_below",b="col_left",C="col_right",R="clear_column",_="remove_row",S="remove_col",E="undo",T="redo",O="make_read_only",M="alignment",k="---------",H=[w,y,b,C,R,_,S,E,T,O,M,k],D=(i={},Object.defineProperty(i,k,{value:{name:k},configurable:!0,enumerable:!0,writable:!0}),Object.defineProperty(i,w,{value:{key:w,name:"Insert row above",callback:function(e,t){this.alter("insert_row",t.start.row)},disabled:function(){var e=g(this);if(!e)return!0;var t=this.countRows(),n=[0,e[1],t-1,e[1]];return n.join(",")===e.join(",")&&t>1},hidden:function(){return!this.getSettings().allowInsertRow}},configurable:!0,enumerable:!0,writable:!0}),Object.defineProperty(i,y,{value:{key:y,name:"Insert row below",callback:function(e,t){this.alter("insert_row",t.end.row+1)},disabled:function(){var e=g(this);if(!e)return!0;var t=this.countRows(),n=[0,e[1],t-1,e[1]];return n.join(",")===e.join(",")&&t>1},hidden:function(){return!this.getSettings().allowInsertRow}},configurable:!0,enumerable:!0,writable:!0}),Object.defineProperty(i,b,{value:{key:b,name:"Insert column on the left",callback:function(e,t){this.alter("insert_col",t.start.col)},disabled:function(){var e=g(this);if(!e)return!0;if(!this.isColumnModificationAllowed())return!0;var t=[e[0],0,e[0],this.countCols()-1],n=t.join(",")==e.join(",");return e[1]<0||this.countCols()>=this.getSettings().maxCols||n},hidden:function(){return!this.getSettings().allowInsertColumn}},configurable:!0,enumerable:!0,writable:!0}),Object.defineProperty(i,C,{value:{key:C,name:"Insert column on the right",callback:function(e,t){this.alter("insert_col",t.end.col+1)},disabled:function(){var e=g(this);if(!e)return!0;if(!this.isColumnModificationAllowed())return!0;var t=[e[0],0,e[0],this.countCols()-1],n=t.join(",")==e.join(",");return e[1]<0||this.countCols()>=this.getSettings().maxCols||n},hidden:function(){return!this.getSettings().allowInsertColumn}},configurable:!0,enumerable:!0,writable:!0}),Object.defineProperty(i,R,{value:{key:R,name:"Clear column",callback:function(e,t){var n=t.start.col;this.countRows()&&this.populateFromArray(0,n,[[null]],Math.max(t.start.row,t.end.row),n)},disabled:function(){var e=g(this);if(!e)return!0;var t=[e[0],0,e[0],this.countCols()-1],n=t.join(",")==e.join(",");return e[1]<0||this.countCols()>=this.getSettings().maxCols||n}},configurable:!0,enumerable:!0,writable:!0}),Object.defineProperty(i,_,{value:{key:_,name:"Remove row",callback:function(e,t){var n=t.end.row-t.start.row+1;this.alter("remove_row",t.start.row,n)},disabled:function(){var e=g(this);if(!e)return!0;var t=[0,e[1],this.countRows()-1,e[1]];return t.join(",")===e.join(",")},hidden:function(){return!this.getSettings().allowRemoveRow}},configurable:!0,enumerable:!0,writable:!0}),Object.defineProperty(i,S,{value:{key:S,name:"Remove column",callback:function(e,t){var n=t.end.col-t.start.col+1;this.alter("remove_col",t.start.col,n)},disabled:function(){var e=g(this);if(!e)return!0;if(!this.isColumnModificationAllowed())return!0;var t=[e[0],0,e[0],this.countCols()-1],n=t.join(",")==e.join(",");return e[1]<0||n},hidden:function(){return!this.getSettings().allowRemoveColumn}},configurable:!0,enumerable:!0,writable:!0}),Object.defineProperty(i,E,{value:{key:E,name:"Undo",callback:function(){this.undo()},disabled:function(){return this.undoRedo&&!this.undoRedo.isUndoAvailable()}},configurable:!0,enumerable:!0,writable:!0}),Object.defineProperty(i,T,{value:{key:T,name:"Redo",callback:function(){this.redo()},disabled:function(){return this.undoRedo&&!this.undoRedo.isRedoAvailable()}},configurable:!0,enumerable:!0,writable:!0}),Object.defineProperty(i,O,{value:{key:O,name:function(){var e=this,t="Read only",n=m(this.getSelectedRange(),function(t,n){return e.getCellMeta(t,n).readOnly});return n&&(t=v(t)),t},callback:function(){var e=this,t=this.getSelectedRange(),n=m(t,function(t,n){return e.getCellMeta(t,n).readOnly});t.forAll(function(t,o){e.getCellMeta(t,o).readOnly=n?!1:!0}),this.render()},disabled:function(){return this.getSelectedRange()?!1:!0}},configurable:!0,enumerable:!0,writable:!0}),Object.defineProperty(i,M,{value:{key:M,name:"Alignment",disabled:function(){return this.getSelectedRange()?!1:!0},submenu:{items:[{key:M+":left",name:function(){var e=this,t="Left",n=m(this.getSelectedRange(),function(t,n){var o=e.getCellMeta(t,n).className;return o&&-1!==o.indexOf("htLeft")?!0:void 0});return n&&(t=v(t)),t},callback:function(){var e=this,t=this.getSelectedRange(),n=p(t,function(t,n){return e.getCellMeta(t,n).className}),o="horizontal",r="htLeft";this.runHooks("beforeCellAlignment",n,t,o,r),f(t,o,r,function(t,n){return e.getCellMeta(t,n)}),this.render()},disabled:!1},{key:M+":center",name:function(){var e=this,t="Center",n=m(this.getSelectedRange(),function(t,n){var o=e.getCellMeta(t,n).className;return o&&-1!==o.indexOf("htCenter")?!0:void 0});return n&&(t=v(t)),t},callback:function(){var e=this,t=this.getSelectedRange(),n=p(t,function(t,n){return e.getCellMeta(t,n).className}),o="horizontal",r="htCenter";this.runHooks("beforeCellAlignment",n,t,o,r),f(t,o,r,function(t,n){return e.getCellMeta(t,n)}),this.render()},disabled:!1},{key:M+":right",name:function(){var e=this,t="Right",n=m(this.getSelectedRange(),function(t,n){var o=e.getCellMeta(t,n).className;return o&&-1!==o.indexOf("htRight")?!0:void 0});return n&&(t=v(t)),t},callback:function(){var e=this,t=this.getSelectedRange(),n=p(t,function(t,n){return e.getCellMeta(t,n).className}),o="horizontal",r="htRight";this.runHooks("beforeCellAlignment",n,t,o,r),f(t,o,r,function(t,n){return e.getCellMeta(t,n)}),this.render()},disabled:!1},{key:M+":justify",name:function(){var e=this,t="Justify",n=m(this.getSelectedRange(),function(t,n){var o=e.getCellMeta(t,n).className;return o&&-1!==o.indexOf("htJustify")?!0:void 0});return n&&(t=v(t)),t},callback:function(){var e=this,t=this.getSelectedRange(),n=p(t,function(t,n){return e.getCellMeta(t,n).className}),o="horizontal",r="htJustify";this.runHooks("beforeCellAlignment",n,t,o,r),f(t,o,r,function(t,n){return e.getCellMeta(t,n)}),this.render()},disabled:!1},{name:k},{key:M+":top",name:function(){var e=this,t="Top",n=m(this.getSelectedRange(),function(t,n){var o=e.getCellMeta(t,n).className;return o&&-1!==o.indexOf("htTop")?!0:void 0});return n&&(t=v(t)),t},callback:function(){var e=this,t=this.getSelectedRange(),n=p(t,function(t,n){return e.getCellMeta(t,n).className}),o="vertical",r="htTop";this.runHooks("beforeCellAlignment",n,t,o,r),f(t,o,r,function(t,n){return e.getCellMeta(t,n)}),this.render()},disabled:!1},{key:M+":middle",name:function(){var e=this,t="Middle",n=m(this.getSelectedRange(),function(t,n){var o=e.getCellMeta(t,n).className;return o&&-1!==o.indexOf("htMiddle")?!0:void 0});return n&&(t=v(t)),t},callback:function(){var e=this,t=this.getSelectedRange(),n=p(t,function(t,n){return e.getCellMeta(t,n).className}),o="vertical",r="htMiddle";this.runHooks("beforeCellAlignment",n,t,o,r),f(t,o,r,function(t,n){return e.getCellMeta(t,n)}),this.render()},disabled:!1},{key:M+":bottom",name:function(){var e=this,t="Bottom",n=m(this.getSelectedRange(),function(t,n){var o=e.getCellMeta(t,n).className;return o&&-1!==o.indexOf("htBottom")?!0:void 0});return n&&(t=v(t)),t},callback:function(){var e=this,t=this.getSelectedRange(),n=p(t,function(t,n){return e.getCellMeta(t,n).className}),o="vertical",r="htBottom";this.runHooks("beforeCellAlignment",n,t,o,r),f(t,o,r,function(t,n){return e.getCellMeta(t,n)}),this.render()},disabled:!1}]}},configurable:!0,enumerable:!0,writable:!0}),i)},{"helpers/number":49,"helpers/object":50,utils:71}],71:[function(e,t,n){"use strict";function o(e){return{start:e.getTopLeftCorner(),end:e.getBottomRightCorner()}}function r(e){return v(e,"htSeparator")}function i(e){return v(e,"htSubmenu")}function s(e){return v(e,"htDisabled")}function a(e){return v(e,"htSelectionDisabled")}function l(e){var t=e.getSelected();return t?t[0]<0?null:e.countRows()>=e.getSettings().maxRows?null:t:null}function u(e,t){return-1!=e.indexOf(t)?e:(e=e.replace("htTop","").replace("htMiddle","").replace("htBottom","").replace(" ",""),e+=" "+t)}function c(e,t){return-1!=e.indexOf(t)?e:(e=e.replace("htLeft","").replace("htCenter","").replace("htRight","").replace("htJustify","").replace(" ",""),e+=" "+t)}function d(e,t){for(var n={},o=e.from.row;o<=e.to.row;o++)for(var r=e.from.col;r<=e.to.col;r++)n[o]||(n[o]=[]),n[o][r]=t(o,r);return n}function h(e,t,n,o){if(e.from.row==e.to.row&&e.from.col==e.to.col)f(e.from.row,e.from.col,t,n,o);else for(var r=e.from.row;r<=e.to.row;r++)for(var i=e.from.col;i<=e.to.col;i++)f(r,i,t,n,o)}function f(e,t,n,o,r){var i=r(e,t),s=o;i.className&&(s="vertical"===n?u(i.className,o):c(i.className,o)),i.className=s}function p(e,t){var n=!1;return e&&e.forAll(function(e,o){return t(e,o)?(n=!0,!1):void 0}),n}function g(e){return''+String.fromCharCode(10003)+""+e}Object.defineProperties(n,{normalizeSelection:{get:function(){return o}},isSeparator:{get:function(){return r}},hasSubMenu:{get:function(){return i}},isDisabled:{get:function(){return s}},isSelectionDisabled:{get:function(){return a}},getValidSelection:{get:function(){return l}},prepareVerticalAlignClass:{get:function(){return u}},prepareHorizontalAlignClass:{get:function(){return c}},getAlignmentClasses:{get:function(){return d}},align:{get:function(){return h}},checkSelectionConsistency:{get:function(){return p}},markLabelAsSelected:{get:function(){return g}},__esModule:{value:!0}});var m,v=(m=e("helpers/dom/element"),m&&m.__esModule&&m||{"default":m}).hasClass},{"helpers/dom/element":45}],72:[function(e,t,n){"use strict";Object.defineProperties(n,{ContextMenuCopyPaste:{get:function(){return g}},__esModule:{value:!0}});var o,r,i,s,a,l,u=(o=e("helpers/dom/element"),o&&o.__esModule&&o||{"default":o}).removeClass,c=(r=e("helpers/array"),r&&r.__esModule&&r||{"default":r}).arrayEach,d=(i=e("eventManager"),i&&i.__esModule&&i||{"default":i}).EventManager,h=(s=e("plugins"),s&&s.__esModule&&s||{"default":s}).registerPlugin,f=(a=e("_base"),a&&a.__esModule&&a||{"default":a})["default"],p=(l=e("zeroclipboard"),l&&l.__esModule&&l||{"default":l})["default"],g=function(e){$traceurRuntime.superConstructor(m).call(this,e),this.eventManager=new d(this),this.swfPath=null,this.outsideClickDeselectsCache=null},m=g;$traceurRuntime.createClass(g,{isEnabled:function(){return this.hot.getSettings().contextMenuCopyPaste},enablePlugin:function(){var e=this;if(!this.enabled){"object"==typeof this.hot.getSettings().contextMenuCopyPaste&&(this.swfPath=this.hot.getSettings().contextMenuCopyPaste.swfPath),"undefined"==typeof p&&console.error("To be able to use the Copy/Paste feature from the context menu, you need to manually include ZeroClipboard.js file to your website.");try{new ActiveXObject("ShockwaveFlash.ShockwaveFlash")}catch(t){"undefined"==typeof navigator.mimeTypes["application/x-shockwave-flash"]&&console.error("To be able to use the Copy/Paste feature from the context menu, your browser needs to have Flash Plugin installed.")}this.swfPath&&p.config({swfPath:this.swfPath}),this.hot.addHook("afterContextMenuShow",function(){return e.onAfterContextMenuShow()}),this.hot.addHook("afterContextMenuDefaultOptions",function(t){return e.onAfterContextMenuDefaultOptions(t)}),this.registerEvents(),$traceurRuntime.superGet(this,m.prototype,"enablePlugin").call(this)}},disablePlugin:function(){$traceurRuntime.superGet(this,m.prototype,"disablePlugin").call(this)},registerEvents:function(){var e=this;this.eventManager.addEventListener(document,"mouseenter",function(){return e.removeCurrentClass()}),this.eventManager.addEventListener(document,"mouseleave",function(){return e.removeZeroClipboardClass()})},getCopyValue:function(){return this.hot.copyPaste.setCopyableText(),this.hot.copyPaste.copyPasteInstance.elTextarea.value},onAfterContextMenuDefaultOptions:function(e){e.items.unshift({key:"copy",name:"Copy"},{key:"paste",name:"Paste",callback:function(){this.copyPaste.triggerPaste()}},Handsontable.plugins.ContextMenu.SEPARATOR)},onAfterContextMenuShow:function(){var e=this,t=this.hot.getPlugin("contextMenu"),n=t.menu.hotMenu.getSourceData();c(n,function(n,o){if("copy"===n.key){var r=new p(t.menu.hotMenu.getCell(o,0));return r.off(),r.on("copy",function(t){var n=t.clipboardData;n.setData("text/plain",e.getCopyValue()),e.hot.getSettings().outsideClickDeselects=e.outsideClickDeselectsCache}),!1}})},removeCurrentClass:function(){var e=this.hot.getPlugin("contextMenu");if(e.menu.isOpened()){var t=e.menu.hotMenu.rootElement.querySelector("td.current");t&&u(t,"current")}this.outsideClickDeselectsCache=this.hot.getSettings().outsideClickDeselects,this.hot.getSettings().outsideClickDeselects=!1},removeZeroClipboardClass:function(){var e=this.hot.getPlugin("contextMenu");if(e.menu.isOpened()){var t=e.menu.hotMenu.rootElement.querySelector("td.zeroclipboard-is-hover");t&&u(t,"zeroclipboard-is-hover")}this.hot.getSettings().outsideClickDeselects=this.outsideClickDeselectsCache}},{},f),h("contextMenuCopyPaste",g)},{_base:58,eventManager:41,"helpers/array":42,"helpers/dom/element":45,plugins:57,zeroclipboard:"zeroclipboard"}],73:[function(e,t,n){"use strict";function o(e){function t(){e.isListening()&&e.selection.empty()}function n(t){var n,o,r,i,s,a,l,u,c,d;if(e.isListening()&&e.selection.isSelected()){n=t,o=v.parse(n),r=e.getSelected(),i=new M(r[0],r[1]),s=new M(r[2],r[3]),a=new k(i,i,s),l=a.getTopLeftCorner(),u=a.getBottomRightCorner(),c=l,d=new M(Math.max(u.row,o.length-1+l.row),Math.max(u.col,o[0].length-1+l.col));var h=s.row-i.row>=o.length-1,f=s.col-i.col>=o[0].length-1;e.addHookOnce("afterChange",function(t,n){var o=t?t.length:0;if(o){var r={row:0,col:0},i=-1;C(t,function(e,n){var s=o>n+1?t[n+1]:null;s&&(h||(r.row=r.row+Math.max(s[0]-e[0]-1,0)),!f&&e[1]>i&&(i=e[1],r.col=r.col+Math.max(s[1]-e[1]-1,0)))}),e.selectCell(c.row,c.col,d.row+r.row,d.col+r.col)}}),e.populateFromArray(c.row,c.col,o,d.row,d.col,"paste",e.getSettings().pasteMode)}}function o(t){if(e.getSelected()&&!(e.getActiveEditor()&&e.getActiveEditor().isOpened()||E(t))){if(b(t.keyCode)){if(e.getSettings().fragmentSelection&&T())return;return r.setCopyableText(),void S(t)}var n=(t.ctrlKey||t.metaKey)&&!t.altKey;t.keyCode==y.A&&n&&e._registerTimeout(setTimeout(O(r.setCopyableText,r),0))}}var r=this;this.copyPasteInstance=m(),this.copyPasteInstance.onCut(t),this.copyPasteInstance.onPaste(n),this.onPaste=n,e.addHook("beforeKeyDown",o),this.destroy=function(){this.copyPasteInstance&&(this.copyPasteInstance.removeCallback(t),this.copyPasteInstance.removeCallback(n),this.copyPasteInstance.destroy(),this.copyPasteInstance=null),e.removeHook("beforeKeyDown",o)},e.addHook("afterDestroy",O(this.destroy,this)),this.triggerPaste=O(this.copyPasteInstance.triggerPaste,this.copyPasteInstance),this.triggerCut=O(this.copyPasteInstance.triggerCut,this.copyPasteInstance),this.setCopyableText=function(){var t=e.getSettings(),n=t.copyRowsLimit,o=t.copyColsLimit,r=e.getSelectedRange(),i=r.getTopLeftCorner(),s=r.getBottomRightCorner(),a=i.row,l=i.col,u=s.row,c=s.col,d=Math.min(u,a+n-1),h=Math.min(c,l+o-1),f=[];f.push({startRow:a,startCol:l,endRow:d,endCol:h}),f=Handsontable.hooks.run(e,"modifyCopyableRange",f);var p=this.getRangedCopyableData(f);e.copyPaste.copyPasteInstance.copyable(p),(u!==d||c!==h)&&Handsontable.hooks.run(e,"afterCopyLimit",u-a+1,c-l+1,n,o)},this.getRangedCopyableData=function(t){var n=[],o=[],r=[];return C(t,function(e){R(e.startRow,e.endRow,function(e){-1===o.indexOf(e)&&o.push(e)}),R(e.startCol,e.endCol,function(e){-1===r.indexOf(e)&&r.push(e)})}),C(o,function(t){var o=[];C(r,function(n){o.push(e.getCopyableData(t,n))}),n.push(o)}),v.stringify(n)}}function r(){var e=this,t=e.getSettings().copyPaste!==!1;t&&!e.copyPaste?e.copyPaste=new o(e):!t&&e.copyPaste&&(e.copyPaste.destroy(),e.copyPaste=null)}Object.defineProperties(n,{CopyPastePlugin:{get:function(){return o}},__esModule:{value:!0}});var i,s,a,l,u,c,d,h,f,p,g,m=(i=e("copyPaste"),i&&i.__esModule&&i||{"default":i})["default"],v=(s=e("SheetClip"),s&&s.__esModule&&s||{"default":s})["default"],w=(a=e("helpers/unicode"),a&&a.__esModule&&a||{"default":a}),y=w.KEY_CODES,b=w.isCtrlKey,C=(l=e("helpers/array"),l&&l.__esModule&&l||{"default":l}).arrayEach,R=(u=e("helpers/number"),u&&u.__esModule&&u||{"default":u}).rangeEach,_=(c=e("helpers/dom/event"),c&&c.__esModule&&c||{"default":c}),S=_.stopImmediatePropagation,E=_.isImmediatePropagationStopped,T=(d=e("helpers/dom/element"),d&&d.__esModule&&d||{"default":d}).getSelectionText,O=(h=e("helpers/function"),h&&h.__esModule&&h||{"default":h}).proxy,M=((f=e("plugins"),f&&f.__esModule&&f||{"default":f}).registerPlugin,(p=e("3rdparty/walkontable/src/cell/coords"),p&&p.__esModule&&p||{"default":p}).WalkontableCellCoords),k=(g=e("3rdparty/walkontable/src/cell/range"),g&&g.__esModule&&g||{"default":g}).WalkontableCellRange;Handsontable.hooks.add("afterInit",r),Handsontable.hooks.add("afterUpdateSettings",r),Handsontable.hooks.register("afterCopyLimit"),Handsontable.hooks.register("modifyCopyableRange")},{"3rdparty/walkontable/src/cell/coords":5,"3rdparty/walkontable/src/cell/range":6,SheetClip:"SheetClip",copyPaste:"copyPaste","helpers/array":42,"helpers/dom/element":45,"helpers/dom/event":46,"helpers/function":47,"helpers/number":49,"helpers/unicode":53,plugins:57}],74:[function(e,t,n){"use strict";function o(){}var r,i,s,a,l=((r=e("plugins"),r&&r.__esModule&&r||{"default":r}).registerPlugin,(i=e("3rdparty/walkontable/src/cell/range"),i&&i.__esModule&&i||{"default":i}).WalkontableCellRange),u=(s=e("3rdparty/walkontable/src/selection"),s&&s.__esModule&&s||{"default":s}).WalkontableSelection,c=function(e){return"boolean"==typeof e&&e===!0?!0:"object"==typeof e&&e.length>0?!0:!1},d=function(){c(this.getSettings().customBorders)&&(this.customBorders||(a=this,this.customBorders=new o))},h=function(e){for(var t=0;t=0?a.view.wt.selections[o]=n:a.view.wt.selections.push(n)},p=function(e,t,n){var o=b(e,t);o=C(o,n),this.setCellMeta(e,t,"borders",o),f(o)},g=function(e){for(var t=e.range,n=t.from.row;n<=t.to.row;n++)for(var o=t.from.col;o<=t.to.col;o++){var r=b(n,o),i=0;n==t.from.row&&(i++,e.hasOwnProperty("top")&&(r.top=e.top)),n==t.to.row&&(i++,e.hasOwnProperty("bottom")&&(r.bottom=e.bottom)),o==t.from.col&&(i++,e.hasOwnProperty("left")&&(r.left=e.left)),o==t.to.col&&(i++,e.hasOwnProperty("right")&&(r.right=e.right)),i>0&&(this.setCellMeta(n,o,"borders",r),f(r))}},m=function(e,t){return"border_row"+e+"col"+t},v=function(){return{width:1,color:"#000"}},w=function(){return{hide:!0}},y=function(){return{width:1,color:"#000",cornerVisible:!1}},b=function(e,t){return{className:m(e,t),border:y(),row:e,col:t,top:w(),right:w(),bottom:w(),left:w()}},C=function(e,t){return t.hasOwnProperty("border")&&(e.border=t.border),t.hasOwnProperty("top")&&(e.top=t.top),t.hasOwnProperty("right")&&(e.right=t.right),t.hasOwnProperty("bottom")&&(e.bottom=t.bottom),t.hasOwnProperty("left")&&(e.left=t.left),e},R=function(e){for(var t=document.querySelectorAll("."+e),n=0;n'+String.fromCharCode(10003)+""+e},M=function(e){this.getSettings().customBorders&&(e.items.push(Handsontable.plugins.ContextMenu.SEPARATOR),e.items.push({key:"borders",name:"Borders",submenu:{items:[{key:"borders:top",name:function(){var e="Top",t=T(this,"top");return t&&(e=O(e)),e},callback:function(){var e=T(this,"top");E.call(this,this.getSelectedRange(),"top",e)},disabled:!1},{key:"borders:right",name:function(){var e="Right",t=T(this,"right");return t&&(e=O(e)),e},callback:function(){var e=T(this,"right");E.call(this,this.getSelectedRange(),"right",e)},disabled:!1},{key:"borders:bottom",name:function(){var e="Bottom",t=T(this,"bottom");return t&&(e=O(e)),e},callback:function(){var e=T(this,"bottom");E.call(this,this.getSelectedRange(),"bottom",e)},disabled:!1},{key:"borders:left",name:function(){var e="Left",t=T(this,"left");return t&&(e=O(e)),e},callback:function(){var e=T(this,"left");E.call(this,this.getSelectedRange(),"left",e); -},disabled:!1},{key:"borders:no_borders",name:"Remove border(s)",callback:function(){E.call(this,this.getSelectedRange(),"noBorders")},disabled:function(){return!T(this)}}]}}))};Handsontable.hooks.add("beforeInit",d),Handsontable.hooks.add("afterContextMenuDefaultOptions",M),Handsontable.hooks.add("afterInit",function(){var e=this.getSettings().customBorders;if(e){for(var t=0;tthis.boundaries.bottom&&(o=t-this.boundaries.bottom),ethis.boundaries.right&&(n=e-this.boundaries.right),this.callback(n,o)};var a,l=function(e){e.dragToScrollListening=!1;var t=e.view.wt.wtTable.holder;a=new o,t!==window&&(a.setBoundaries(t.getBoundingClientRect()),a.setCallback(function(e,n){0>e?t.scrollLeft-=50:e>0&&(t.scrollLeft+=50),0>n?t.scrollTop-=20:n>0&&(t.scrollTop+=20)}),e.dragToScrollListening=!0)};Handsontable.hooks.add("afterInit",function(){var e=this,t=s(this);t.addEventListener(document,"mouseup",function(){e.dragToScrollListening=!1}),t.addEventListener(document,"mousemove",function(t){e.dragToScrollListening&&a.check(t.clientX,t.clientY)})}),Handsontable.hooks.add("afterDestroy",function(){s(this).clear()}),Handsontable.hooks.add("afterOnCellMouseDown",function(){l(this)}),Handsontable.hooks.add("afterOnCellCornerMouseDown",function(){l(this)}),Handsontable.plugins.DragToScroll=o},{eventManager:41,plugins:57}],76:[function(e,t,n){"use strict";Object.defineProperties(n,{ManualColumnFreeze:{get:function(){return a}},__esModule:{value:!0}});var o,r,i=(o=e("_base"),o&&o.__esModule&&o||{"default":o})["default"],s=(r=e("plugins"),r&&r.__esModule&&r||{"default":r}).registerPlugin,a=function(e){$traceurRuntime.superConstructor(l).call(this,e)},l=a;$traceurRuntime.createClass(a,{isEnabled:function(){return!!this.hot.getSettings().manualColumnFreeze},enablePlugin:function(){var e=this;this.enabled||(this.addHook("modifyCol",function(t){return e.onModifyCol(t)}),this.addHook("afterContextMenuDefaultOptions",function(t){return e.addContextMenuEntry(t)}),$traceurRuntime.superGet(this,l.prototype,"enablePlugin").call(this))},disablePlugin:function(){$traceurRuntime.superGet(this,l.prototype,"disablePlugin").call(this)},init:function(){$traceurRuntime.superGet(this,l.prototype,"init").call(this),"undefined"==typeof this.hot.manualColumnPositionsPluginUsages?this.hot.manualColumnPositionsPluginUsages=["manualColumnFreeze"]:this.hot.manualColumnPositionsPluginUsages.push("manualColumnFreeze"),this.fixedColumnsCount=this.hot.getSettings().fixedColumnsLeft},onModifyCol:function(e){return this.hot.manualColumnPositionsPluginUsages.length>1?e:this.getModifiedColumnIndex(e)},getModifiedColumnIndex:function(e){return this.hot.manualColumnPositions[e]},addContextMenuEntry:function(e){var t=this;e.items.push(Handsontable.plugins.ContextMenu.SEPARATOR,{key:"freeze_column",name:function(){var e=t.hot.getSelected()[1];return e>t.fixedColumnsCount-1?"Freeze this column":"Unfreeze this column"},disabled:function(){var e=t.hot.getSelected();return e[1]!==e[3]},callback:function(){var e=t.hot.getSelected()[1];e>t.fixedColumnsCount-1?t.freezeColumn(e):t.unfreezeColumn(e)}})},freezeColumn:function(e){if(!(e<=this.fixedColumnsCount-1)){var t=this.getModifiedColumnIndex(e)||e;this.checkPositionData(t),this.modifyColumnOrder(t,e,null,"freeze"),this.addFixedColumn(),this.hot.view.wt.wtOverlays.leftOverlay.refresh(),this.hot.view.wt.wtOverlays.adjustElementsSize()}},unfreezeColumn:function(e){if(!(e>this.fixedColumnsCount-1)){var t=this.getBestColumnReturnPosition(e),n=this.getModifiedColumnIndex(e)||e;this.checkPositionData(n),this.modifyColumnOrder(n,e,t,"unfreeze"),this.removeFixedColumn(),this.hot.view.wt.wtOverlays.leftOverlay.refresh(),this.hot.view.wt.wtOverlays.adjustElementsSize()}},addFixedColumn:function(){this.hot.updateSettings({fixedColumnsLeft:this.fixedColumnsCount+1}),this.fixedColumnsCount++},removeFixedColumn:function(){this.hot.updateSettings({fixedColumnsLeft:this.fixedColumnsCount-1}),this.fixedColumnsCount--},checkPositionData:function(e){this.hot.manualColumnPositions&&0!==this.hot.manualColumnPositions.length||this.hot.manualColumnPositions||(this.hot.manualColumnPositions=[]),e?this.hot.manualColumnPositions[e]||this.createPositionData(e+1):this.createPositionData(this.hot.countCols())},createPositionData:function(e){if(this.hot.manualColumnPositions.lengtht;t++)this.hot.manualColumnPositions[t]=t},modifyColumnOrder:function(e,t,n,o){null==n&&(n=e),"freeze"===o?this.hot.manualColumnPositions.splice(this.fixedColumnsCount,0,this.hot.manualColumnPositions.splice(t,1)[0]):"unfreeze"===o&&this.hot.manualColumnPositions.splice(n,0,this.hot.manualColumnPositions.splice(t,1)[0])},getBestColumnReturnPosition:function(e){for(var t=this.fixedColumnsCount,n=this.getModifiedColumnIndex(t),o=this.getModifiedColumnIndex(e);o>n;)t++,n=this.getModifiedColumnIndex(t);return t-1}},{},i),s("manualColumnFreeze",a)},{_base:58,plugins:57}],77:[function(e,t,n){"use strict";function o(){function e(e){g=this,m=e;var t=this.view.wt.wtTable.getCoords(e).col;if(t>=0){f=t;var n=m.getBoundingClientRect();l=n.left,v.style.top=n.top+"px",v.style.left=l+"px",g.rootElement.appendChild(v)}}function t(e,t){var n=e.getBoundingClientRect(),o=6;t>0?v.style.left=n.left+n.width-o+"px":v.style.left=n.left+"px"}function n(){var e=this;u(v,"active"),u(w,"active");var t=m.getBoundingClientRect();w.style.width=t.width+"px",w.style.height=e.view.maximumVisibleElementHeight(0)+"px",w.style.top=v.style.top,w.style.left=l+"px",e.rootElement.appendChild(w)}function o(e){w.style.left=l+e+"px"}function r(){d(v,"active"),d(w,"active")}var i,s,a,l,f,g,m,v=document.createElement("DIV"),w=document.createElement("DIV"),y=h(this);v.className="manualColumnMover",w.className="manualColumnMoverGuide";var b=function(){var e=this;Handsontable.hooks.run(e,"persistentStateSave","manualColumnPositions",e.manualColumnPositions)},C=function(){var e=this,t={};return Handsontable.hooks.run(e,"persistentStateLoad","manualColumnPositions",t),t.value},R=function(e){return"BODY"!=e.tagName?"THEAD"==e.parentNode.tagName?!0:(e=e.parentNode,R(e)):!1},_=function(e){return"TABLE"!=e.tagName?"TH"==e.tagName?e:_(e.parentNode):null},S=function(){var l,u=this;y.addEventListener(u.rootElement,"mouseover",function(n){if(R(n.target)){var o=_(n.target);if(o)if(l){var r=u.view.wt.wtTable.getCoords(o).col;r>=0&&(s=r,t(n.target,s-i))}else e.call(u,o)}}),y.addEventListener(u.rootElement,"mousedown",function(e){c(e.target,"manualColumnMover")&&(a=p(e),n.call(u),l=u,i=f,s=f)}),y.addEventListener(window,"mousemove",function(e){l&&o(p(e)-a)}),y.addEventListener(window,"mouseup",function(t){l&&(r(),l=!1,T(u.manualColumnPositions,u.countCols()),u.manualColumnPositions.splice(s,0,u.manualColumnPositions.splice(i,1)[0]),Handsontable.hooks.run(u,"beforeColumnMove",i,s),u.forceFullRender=!0,u.view.render(),b.call(u),Handsontable.hooks.run(u,"afterColumnMove",i,s),e.call(u,m))}),u.addHook("afterDestroy",E)},E=function(){y.clear()},T=function(e,t){if(e.lengthn;n++)e[n]=n};this.beforeInit=function(){this.manualColumnPositions=[]},this.init=function(e){var t=this,n=!!this.getSettings().manualColumnMove;if(n){var o=this.getSettings().manualColumnMove,r=C.call(t);"undefined"!=typeof r?this.manualColumnPositions=r:Array.isArray(o)?this.manualColumnPositions=o:this.manualColumnPositions=[],("afterInit"===e||"afterUpdateSettings"===e&&0===y.context.eventListeners.length)&&("undefined"==typeof t.manualColumnPositionsPluginUsages?t.manualColumnPositionsPluginUsages=["manualColumnMove"]:t.manualColumnPositionsPluginUsages.push("manualColumnMove"),S.call(this),this.manualColumnPositions.length>0&&(this.forceFullRender=!0,this.render()))}else{var i=t.manualColumnPositionsPluginUsages?t.manualColumnPositionsPluginUsages.indexOf("manualColumnMove"):-1;i>-1&&(E.call(this),this.manualColumnPositions=[],t.manualColumnPositionsPluginUsages[i]=void 0)}},this.modifyCol=function(e){return this.getSettings().manualColumnMove?("undefined"==typeof this.manualColumnPositions[e]&&T(this.manualColumnPositions,e+1),this.manualColumnPositions[e]):e},this.afterRemoveCol=function(e,t){if(this.getSettings().manualColumnMove){var n,o=this.manualColumnPositions;n=o.splice(e,t),o=o.map(function(e){var t,o=e;for(t=0;tn[t]&&o--;return o}),this.manualColumnPositions=o}},this.afterCreateCol=function(e,t){if(this.getSettings().manualColumnMove){var n=this.manualColumnPositions;if(n.length){for(var o=[],r=0;t>r;r++)o.push(e+r);e>=n.length?n.concat(o):(n=n.map(function(n){return n>=e?n+t:n}),n.splice.apply(n,[e,0].concat(o))),this.manualColumnPositions=n}}}}Object.defineProperties(n,{ManualColumnMove:{get:function(){return o}},__esModule:{value:!0}});var r,i,s,a,l=(r=e("helpers/dom/element"),r&&r.__esModule&&r||{"default":r}),u=l.addClass,c=l.hasClass,d=l.removeClass,h=(i=e("eventManager"),i&&i.__esModule&&i||{"default":i}).eventManager,f=(s=e("helpers/dom/event"),s&&s.__esModule&&s||{"default":s}),p=f.pageX,g=(f.pageY,(a=e("plugins"),a&&a.__esModule&&a||{"default":a}).registerPlugin,new o);Handsontable.hooks.add("beforeInit",g.beforeInit),Handsontable.hooks.add("afterInit",function(){g.init.call(this,"afterInit")}),Handsontable.hooks.add("afterUpdateSettings",function(){g.init.call(this,"afterUpdateSettings")}),Handsontable.hooks.add("modifyCol",g.modifyCol),Handsontable.hooks.add("afterRemoveCol",g.afterRemoveCol),Handsontable.hooks.add("afterCreateCol",g.afterCreateCol),Handsontable.hooks.register("beforeColumnMove"),Handsontable.hooks.register("afterColumnMove")},{eventManager:41,"helpers/dom/element":45,"helpers/dom/event":46,plugins:57}],78:[function(e,t,n){"use strict";Object.defineProperties(n,{ManualColumnResize:{get:function(){return v}},__esModule:{value:!0}});var o,r,i,s,a,l=(o=e("_base.js"),o&&o.__esModule&&o||{"default":o})["default"],u=(r=e("helpers/dom/element"),r&&r.__esModule&&r||{"default":r}),c=u.addClass,d=u.hasClass,h=u.removeClass,f=(i=e("eventManager"),i&&i.__esModule&&i||{"default":i}).eventManager,p=(s=e("helpers/dom/event"),s&&s.__esModule&&s||{"default":s}),g=p.pageX,m=(p.pageY,(a=e("plugins"),a&&a.__esModule&&a||{"default":a}).registerPlugin),v=function(e){$traceurRuntime.superConstructor(w).call(this,e),this.currentTH=null,this.currentCol=null,this.currentWidth=null,this.newSize=null,this.startY=null,this.startWidth=null,this.startOffset=null,this.handle=document.createElement("DIV"),this.guide=document.createElement("DIV"),this.eventManager=f(this),this.pressed=null,this.dblclick=0,this.autoresizeTimeout=null,this.manualColumnWidths=[],c(this.handle,"manualColumnResizer"),c(this.guide,"manualColumnResizerGuide")},w=v;$traceurRuntime.createClass(v,{isEnabled:function(){return this.hot.getSettings().manualColumnResize},enablePlugin:function(){var e=this;if(!this.enabled){this.manualColumnWidths=[];var t=this.hot.getSettings().manualColumnResize,n=this.loadManualColumnWidths();this.addHook("modifyColWidth",function(t,n){return e.onModifyColWidth(t,n)}),"undefined"!=typeof n?this.manualColumnWidths=n:Array.isArray(t)?this.manualColumnWidths=t:this.manualColumnWidths=[],Handsontable.hooks.register("beforeColumnResize"),Handsontable.hooks.register("afterColumnResize"),this.bindEvents(),$traceurRuntime.superGet(this,w.prototype,"enablePlugin").call(this)}},updatePlugin:function(){var e=this.hot.getSettings().manualColumnResize;Array.isArray(e)?this.manualColumnWidths=e:this.manualColumnWidths=[]},disablePlugin:function(){$traceurRuntime.superGet(this,w.prototype,"disablePlugin").call(this)},saveManualColumnWidths:function(){this.hot.runHooks("persistentStateSave","manualColumnWidths",this.manualColumnWidths)},loadManualColumnWidths:function(){var e={};return this.hot.runHooks("persistentStateLoad","manualColumnWidths",e),e.value},setupHandlePosition:function(e){this.currentTH=e;var t=this.hot.view.wt.wtTable.getCoords(e).col;if(t>=0){var n=this.currentTH.getBoundingClientRect();this.currentCol=t,this.startOffset=n.left-6,this.startWidth=parseInt(n.width,10),this.handle.style.top=n.top+"px",this.handle.style.left=this.startOffset+this.startWidth+"px",this.hot.rootElement.appendChild(this.handle)}},refreshHandlePosition:function(){this.handle.style.left=this.startOffset+this.currentWidth+"px"},setupGuidePosition:function(){c(this.handle,"active"),c(this.guide,"active"),this.guide.style.top=this.handle.style.top,this.guide.style.left=this.handle.style.left,this.guide.style.height=this.hot.view.maximumVisibleElementHeight(0)+"px",this.hot.rootElement.appendChild(this.guide)},refreshGuidePosition:function(){this.guide.style.left=this.handle.style.left},hideHandleAndGuide:function(){h(this.handle,"active"),h(this.guide,"active")},checkIfColumnHeader:function(e){return"BODY"!=e.tagName?"THEAD"==e.parentNode.tagName?!0:(e=e.parentNode,this.checkIfColumnHeader(e)):!1},getTHFromTargetElement:function(e){return"TABLE"!=e.tagName?"TH"==e.tagName?e:this.getTHFromTargetElement(e.parentNode):null},onMouseOver:function(e){if(this.checkIfColumnHeader(e.target)){var t=this.getTHFromTargetElement(e.target);if(!t)return;var n=t.getAttribute("colspan");!t||null!==n&&1!==n||this.pressed||this.setupHandlePosition(t)}},afterMouseDownTimeout:function(){if(this.dblclick>=2){var e=this.hot.runHooks("beforeColumnResize",this.currentCol,this.newSize,!0);void 0!==e&&(this.newSize=e),this.setManualSize(this.currentCol,this.newSize),this.hot.forceFullRender=!0,this.hot.view.render(),this.hot.view.wt.wtOverlays.adjustElementsSize(!0),this.hot.runHooks("afterColumnResize",this.currentCol,this.newSize,!0)}this.dblclick=0,this.autoresizeTimeout=null},onMouseDown:function(e){var t=this;d(e.target,"manualColumnResizer")&&(this.setupGuidePosition(),this.pressed=this.hot,null===this.autoresizeTimeout&&(this.autoresizeTimeout=setTimeout(function(){return t.afterMouseDownTimeout()},500),this.hot._registerTimeout(this.autoresizeTimeout)),this.dblclick++,this.startX=g(e),this.newSize=this.startWidth)},onMouseMove:function(e){this.pressed&&(this.currentWidth=this.startWidth+(g(e)-this.startX),this.newSize=this.setManualSize(this.currentCol,this.currentWidth),this.refreshHandlePosition(),this.refreshGuidePosition())},onMouseUp:function(e){this.pressed&&(this.hideHandleAndGuide(),this.pressed=!1,this.newSize!=this.startWidth&&(this.hot.runHooks("beforeColumnResize",this.currentCol,this.newSize),this.hot.forceFullRender=!0,this.hot.view.render(),this.hot.view.wt.wtOverlays.adjustElementsSize(!0),this.saveManualColumnWidths(),this.hot.runHooks("afterColumnResize",this.currentCol,this.newSize)),this.setupHandlePosition(this.currentTH))},bindEvents:function(){var e=this;this.eventManager.addEventListener(this.hot.rootElement,"mouseover",function(t){return e.onMouseOver(t)}),this.eventManager.addEventListener(this.hot.rootElement,"mousedown",function(t){return e.onMouseDown(t)}),this.eventManager.addEventListener(window,"mousemove",function(t){return e.onMouseMove(t)}),this.eventManager.addEventListener(window,"mouseup",function(t){return e.onMouseUp(t)})},setManualSize:function(e,t){return t=Math.max(t,20),e=this.hot.runHooks("modifyCol",e),this.manualColumnWidths[e]=t,t},onModifyColWidth:function(e,t){return this.enabled&&(t=this.hot.runHooks("modifyCol",t),this.hot.getSettings().manualColumnResize&&this.manualColumnWidths[t])?this.manualColumnWidths[t]:e}},{},l),m("manualColumnResize",v)},{"_base.js":58,eventManager:41,"helpers/dom/element":45,"helpers/dom/event":46,plugins:57}],79:[function(e,t,n){"use strict";function o(){function e(e){var t=this;g=e;var n=this.view.wt.wtTable.getCoords(e).row;if(n>=0){f=n;var o=g.getBoundingClientRect();l=o.top,m.style.top=l+"px",m.style.left=o.left+"px",t.rootElement.appendChild(m)}}function t(e,t){var n=e.getBoundingClientRect(),o=6;t>0?m.style.top=n.top+n.height-o+"px":m.style.top=n.top+"px"}function n(){var e=this;u(m,"active"),u(v,"active");var t=g.getBoundingClientRect();v.style.width=e.view.maximumVisibleElementWidth(0)+"px",v.style.height=t.height+"px",v.style.top=l+"px",v.style.left=m.style.left,e.rootElement.appendChild(v)}function o(e){v.style.top=l+e+"px"}function r(){d(m,"active"),d(v,"active")}var i,s,a,l,f,g,m=document.createElement("DIV"),v=document.createElement("DIV"),w=h(this);m.className="manualRowMover",v.className="manualRowMoverGuide";var y=function(){var e=this;Handsontable.hooks.run(e,"persistentStateSave","manualRowPositions",e.manualRowPositions)},b=function(){var e=this,t={};return Handsontable.hooks.run(e,"persistentStateLoad","manualRowPositions",t),t.value},C=function(e){return"BODY"!=e.tagName?"TBODY"==e.parentNode.tagName?!0:(e=e.parentNode,C(e)):!1},R=function(e){return"TABLE"!=e.tagName?"TH"==e.tagName?e:R(e.parentNode):null},_=function(){var l,u=this;w.addEventListener(u.rootElement,"mouseover",function(n){if(C(n.target)){var o=R(n.target);o&&(l?(s=u.view.wt.wtTable.getCoords(o).row,t(o,s-i)):e.call(u,o))}}),w.addEventListener(u.rootElement,"mousedown",function(e){c(e.target,"manualRowMover")&&(a=p(e),n.call(u),l=u,i=f,s=f)}),w.addEventListener(window,"mousemove",function(e){l&&o(p(e)-a)}),w.addEventListener(window,"mouseup",function(t){l&&(r(),l=!1,E(u.manualRowPositions,u.countRows()),u.manualRowPositions.splice(s,0,u.manualRowPositions.splice(i,1)[0]),Handsontable.hooks.run(u,"beforeRowMove",i,s),u.forceFullRender=!0,u.view.render(),y.call(u),Handsontable.hooks.run(u,"afterRowMove",i,s),e.call(u,g))}),u.addHook("afterDestroy",S)},S=function(){w.clear()},E=function(e,t){if(e.lengthn;n++)e[n]=n};this.beforeInit=function(){this.manualRowPositions=[]},this.init=function(e){var t=this,n=!!t.getSettings().manualRowMove;if(n){var o=t.getSettings().manualRowMove,r=b.call(t);"undefined"==typeof t.manualRowPositionsPluginUsages?t.manualRowPositionsPluginUsages=["manualColumnMove"]:t.manualRowPositionsPluginUsages.push("manualColumnMove"),"undefined"!=typeof r?this.manualRowPositions=r:Array.isArray(o)?this.manualRowPositions=o:this.manualRowPositions=[],("afterInit"===e||"afterUpdateSettings"===e&&0===w.context.eventListeners.length)&&(_.call(this),this.manualRowPositions.length>0&&(t.forceFullRender=!0,t.render()))}else{var i=t.manualRowPositionsPluginUsages?t.manualRowPositionsPluginUsages.indexOf("manualColumnMove"):-1;i>-1&&(S.call(this),t.manualRowPositions=[],t.manualRowPositionsPluginUsages[i]=void 0)}},this.modifyRow=function(e){var t=this;return t.getSettings().manualRowMove?("undefined"==typeof t.manualRowPositions[e]&&E(this.manualRowPositions,e+1),t.manualRowPositions[e]):e}}Object.defineProperties(n,{ManualRowMove:{get:function(){return o}},__esModule:{value:!0}});var r,i,s,a,l=(r=e("helpers/dom/element"),r&&r.__esModule&&r||{"default":r}),u=l.addClass,c=l.hasClass,d=l.removeClass,h=(i=e("eventManager"),i&&i.__esModule&&i||{"default":i}).eventManager,f=(s=e("helpers/dom/event"),s&&s.__esModule&&s||{"default":s}),p=(f.pageX,f.pageY),g=((a=e("plugins"),a&&a.__esModule&&a||{"default":a}).registerPlugin,new o);Handsontable.hooks.add("beforeInit",g.beforeInit),Handsontable.hooks.add("afterInit",function(){g.init.call(this,"afterInit")}),Handsontable.hooks.add("afterUpdateSettings",function(){g.init.call(this,"afterUpdateSettings")}),Handsontable.hooks.add("modifyRow",g.modifyRow),Handsontable.hooks.register("beforeRowMove"),Handsontable.hooks.register("afterRowMove")},{eventManager:41,"helpers/dom/element":45,"helpers/dom/event":46,plugins:57}],80:[function(e,t,n){"use strict";Object.defineProperties(n,{ManualRowResize:{get:function(){return v}},__esModule:{value:!0}});var o,r,i,s,a,l=(o=e("_base.js"),o&&o.__esModule&&o||{"default":o})["default"],u=(r=e("helpers/dom/element"),r&&r.__esModule&&r||{"default":r}),c=u.addClass,d=u.hasClass,h=u.removeClass,f=(i=e("eventManager"),i&&i.__esModule&&i||{"default":i}).eventManager,p=(s=e("helpers/dom/event"),s&&s.__esModule&&s||{"default":s}),g=(p.pageX,p.pageY),m=(a=e("plugins"),a&&a.__esModule&&a||{"default":a}).registerPlugin,v=function(e){$traceurRuntime.superConstructor(w).call(this,e),this.currentTH=null,this.currentRow=null,this.currentHeight=null,this.newSize=null,this.startY=null,this.startHeight=null,this.startOffset=null,this.handle=document.createElement("DIV"),this.guide=document.createElement("DIV"),this.eventManager=f(this),this.pressed=null,this.dblclick=0,this.autoresizeTimeout=null,this.manualRowHeights=[],c(this.handle,"manualRowResizer"),c(this.guide,"manualRowResizerGuide")},w=v;$traceurRuntime.createClass(v,{isEnabled:function(){return this.hot.getSettings().manualRowResize},enablePlugin:function(){var e=this;if(!this.enabled){this.manualRowHeights=[];var t=this.hot.getSettings().manualRowResize,n=this.loadManualRowHeights();"undefined"!=typeof n?this.manualRowHeights=n:Array.isArray(t)?this.manualRowHeights=t:this.manualRowHeights=[],this.addHook("modifyRowHeight",function(t,n){return e.onModifyRowHeight(t,n)}),Handsontable.hooks.register("beforeRowResize"),Handsontable.hooks.register("afterRowResize"),this.bindEvents(),$traceurRuntime.superGet(this,w.prototype,"enablePlugin").call(this)}},updatePlugin:function(){var e=this.hot.getSettings().manualRowResize;Array.isArray(e)?this.manualRowHeights=e:this.manualRowHeights=[]},disablePlugin:function(){$traceurRuntime.superGet(this,w.prototype,"disablePlugin").call(this)},saveManualRowHeights:function(){this.hot.runHooks("persistentStateSave","manualRowHeights",this.manualRowHeights)},loadManualRowHeights:function(){var e={};return this.hot.runHooks("persistentStateLoad","manualRowHeights",e),e.value},setupHandlePosition:function(e){this.currentTH=e;var t=this.hot.view.wt.wtTable.getCoords(e).row;if(t>=0){var n=this.currentTH.getBoundingClientRect();this.currentRow=t,this.startOffset=n.top-6,this.startHeight=parseInt(n.height,10),this.handle.style.left=n.left+"px",this.handle.style.top=this.startOffset+this.startHeight+"px",this.hot.rootElement.appendChild(this.handle)}},refreshHandlePosition:function(){this.handle.style.top=this.startOffset+this.currentHeight+"px"},setupGuidePosition:function(){c(this.handle,"active"),c(this.guide,"active"),this.guide.style.top=this.handle.style.top,this.guide.style.left=this.handle.style.left,this.guide.style.width=this.hot.view.maximumVisibleElementWidth(0)+"px",this.hot.rootElement.appendChild(this.guide)},refreshGuidePosition:function(){this.guide.style.top=this.handle.style.top},hideHandleAndGuide:function(){h(this.handle,"active"),h(this.guide,"active")},checkIfRowHeader:function(e){return"BODY"!=e.tagName?"TBODY"==e.parentNode.tagName?!0:(e=e.parentNode,this.checkIfRowHeader(e)):!1},getTHFromTargetElement:function(e){return"TABLE"!=e.tagName?"TH"==e.tagName?e:this.getTHFromTargetElement(e.parentNode):null},onMouseOver:function(e){if(this.checkIfRowHeader(e.target)){var t=this.getTHFromTargetElement(e.target);t&&(this.pressed||this.setupHandlePosition(t))}},afterMouseDownTimeout:function(){if(this.dblclick>=2){var e=this.hot.runHooks("beforeRowResize",this.currentRow,this.newSize,!0);void 0!==e&&(this.newSize=e),this.setManualSize(this.currentRow,this.newSize),this.hot.forceFullRender=!0,this.hot.view.render(),this.hot.view.wt.wtOverlays.adjustElementsSize(!0),this.hot.runHooks("afterRowResize",this.currentRow,this.newSize,!0)}this.dblclick=0,this.autoresizeTimeout=null},onMouseDown:function(e){var t=this;d(e.target,"manualRowResizer")&&(this.setupGuidePosition(),this.pressed=this.hot,null==this.autoresizeTimeout&&(this.autoresizeTimeout=setTimeout(function(){return t.afterMouseDownTimeout()},500),this.hot._registerTimeout(this.autoresizeTimeout)),this.dblclick++,this.startY=g(e),this.newSize=this.startHeight)},onMouseMove:function(e){this.pressed&&(this.currentHeight=this.startHeight+(g(e)-this.startY),this.newSize=this.setManualSize(this.currentRow,this.currentHeight),this.refreshHandlePosition(),this.refreshGuidePosition())},onMouseUp:function(e){this.pressed&&(this.hideHandleAndGuide(),this.pressed=!1,this.newSize!=this.startHeight&&(this.hot.runHooks("beforeRowResize",this.currentRow,this.newSize),this.hot.forceFullRender=!0,this.hot.view.render(),this.hot.view.wt.wtOverlays.adjustElementsSize(!0),this.saveManualRowHeights(),this.hot.runHooks("afterRowResize",this.currentRow,this.newSize)),this.setupHandlePosition(this.currentTH))},bindEvents:function(){var e=this;this.eventManager.addEventListener(this.hot.rootElement,"mouseover",function(t){return e.onMouseOver(t)}),this.eventManager.addEventListener(this.hot.rootElement,"mousedown",function(t){return e.onMouseDown(t)}),this.eventManager.addEventListener(window,"mousemove",function(t){return e.onMouseMove(t)}),this.eventManager.addEventListener(window,"mouseup",function(t){return e.onMouseUp(t)})},setManualSize:function(e,t){return e=this.hot.runHooks("modifyRow",e),this.manualRowHeights[e]=t,t},onModifyRowHeight:function(e,t){if(this.enabled){var n=this.hot.getPlugin("autoRowSize"),o=n?n.heights[t]:null;t=this.hot.runHooks("modifyRow",t);var r=this.manualRowHeights[t];if(void 0!==r&&(r===o||r>(e||0)))return r}return e}},{},l),m("manualRowResize",v)},{"_base.js":58,eventManager:41,"helpers/dom/element":45,"helpers/dom/event":46,plugins:57}],81:[function(e,t,n){"use strict";function o(){var e=[];return e.getInfo=function(e,t){for(var n=0,o=this.length;o>n;n++)if(this[n].row<=e&&this[n].row+this[n].rowspan-1>=e&&this[n].col<=t&&this[n].col+this[n].colspan-1>=t)return this[n]},e.setInfo=function(e){for(var t=0,n=this.length;n>t;t++)if(this[t].row===e.row&&this[t].col===e.col)return void(this[t]=e);this.push(e)},e.removeInfo=function(e,t){for(var n=0,o=this.length;o>n;n++)if(this[n].row===e&&this[n].col===t){this.splice(n,1);break}},e}function r(e){if(this.mergedCellInfoCollection=new o,Array.isArray(e))for(var t=0,n=e.length;n>t;t++)this.mergedCellInfoCollection.setInfo(e[t])}function i(e,t){var n=this.getSettings().mergeCells;if(n&&!this.selection.isMultiple()){var o=this.mergeCells.mergedCellInfoCollection.getInfo(e[0],e[1]);o&&(e[0]=o.row,e[1]=o.col,e[2]=o.row+o.rowspan-1,e[3]=o.col+o.colspan-1)}}function s(e,t){this.mergeCells&&this.mergeCells.shiftCollection("right",e,t)}function a(e,t){this.mergeCells&&this.mergeCells.shiftCollection("left",e,t)}function l(e,t){this.mergeCells&&this.mergeCells.shiftCollection("down",e,t)}function u(e,t){this.mergeCells&&this.mergeCells.shiftCollection("up",e,t)}Object.defineProperties(n,{MergeCells:{get:function(){return r}},__esModule:{value:!0}});var c,d,h,f,p,g=((c=e("plugins"),c&&c.__esModule&&c||{"default":c}).registerPlugin,(d=e("helpers/dom/event"),d&&d.__esModule&&d||{"default":d}).stopImmediatePropagation),m=(h=e("3rdparty/walkontable/src/cell/coords"),h&&h.__esModule&&h||{"default":h}).WalkontableCellCoords,v=(f=e("3rdparty/walkontable/src/cell/range"),f&&f.__esModule&&f||{"default":f}).WalkontableCellRange,w=(p=e("3rdparty/walkontable/src/table"),p&&p.__esModule&&p||{"default":p}).WalkontableTable;r.prototype.canMergeRange=function(e){return!e.isSingle()},r.prototype.mergeRange=function(e){if(this.canMergeRange(e)){var t=e.getTopLeftCorner(),n=e.getBottomRightCorner(),o={};o.row=t.row,o.col=t.col,o.rowspan=n.row-t.row+1,o.colspan=n.col-t.col+1,this.mergedCellInfoCollection.setInfo(o)}},r.prototype.mergeOrUnmergeSelection=function(e){var t=this.mergedCellInfoCollection.getInfo(e.from.row,e.from.col);t?this.unmergeSelection(e.from):this.mergeSelection(e)},r.prototype.mergeSelection=function(e){this.mergeRange(e)},r.prototype.unmergeSelection=function(e){var t=this.mergedCellInfoCollection.getInfo(e.row,e.col);this.mergedCellInfoCollection.removeInfo(t.row,t.col)},r.prototype.applySpanProperties=function(e,t,n){var o=this.mergedCellInfoCollection.getInfo(t,n);o?o.row===t&&o.col===n?(e.setAttribute("rowspan",o.rowspan),e.setAttribute("colspan",o.colspan)):(e.removeAttribute("rowspan"),e.removeAttribute("colspan"),e.style.display="none"):(e.removeAttribute("rowspan"),e.removeAttribute("colspan"))},r.prototype.modifyTransform=function(e,t,n){var o=function(e,t){return t.row>=e.row&&t.row<=e.row+e.rowspan-1?!0:!1},r=function(e,t){return t.col>=e.col&&t.col<=e.col+e.colspan-1?!0:!1},i=function(e){return new m(t.to.row+e.row,t.to.col+e.col)},s={row:n.row,col:n.col};if("modifyTransformStart"==e){this.lastDesiredCoords||(this.lastDesiredCoords=new m(null,null));for(var a,l=new m(t.highlight.row,t.highlight.col),u=this.mergedCellInfoCollection.getInfo(l.row,l.col),c=0,d=this.mergedCellInfoCollection.length;d>c;c++){var h=this.mergedCellInfoCollection[c];if(h=new m(h.row+h.rowspan-1,h.col+h.colspan-1),t.includes(h)){a=!0;break}}if(u){var f=new m(u.row,u.col),p=new m(u.row+u.rowspan-1,u.col+u.colspan-1),g=new v(f,f,p);g.includes(this.lastDesiredCoords)||(this.lastDesiredCoords=new m(null,null)),s.row=this.lastDesiredCoords.row?this.lastDesiredCoords.row-l.row:s.row,s.col=this.lastDesiredCoords.col?this.lastDesiredCoords.col-l.col:s.col,n.row>0?s.row=u.row+u.rowspan-1-l.row+n.row:n.row<0&&(s.row=l.row-u.row+n.row),n.col>0?s.col=u.col+u.colspan-1-l.col+n.col:n.col<0&&(s.col=l.col-u.col+n.col)}var w=new m(t.highlight.row+s.row,t.highlight.col+s.col),y=this.mergedCellInfoCollection.getInfo(w.row,w.col);y&&(this.lastDesiredCoords=w,s={row:y.row-l.row,col:y.col-l.col})}else if("modifyTransformEnd"==e)for(var c=0,d=this.mergedCellInfoCollection.length;d>c;c++){var b=this.mergedCellInfoCollection[c],f=new m(b.row,b.col),p=new m(b.row+b.rowspan-1,b.col+b.colspan-1),C=new v(f,f,p),R=t.getBordersSharedWith(C);if(C.isEqual(t))t.setDirection("NW-SE");else if(R.length>0){var _=t.highlight.isEqual(C.from);R.indexOf("top")>-1?t.to.isSouthEastOf(C.from)&&_?t.setDirection("NW-SE"):t.to.isSouthWestOf(C.from)&&_&&t.setDirection("NE-SW"):R.indexOf("bottom")>-1&&(t.to.isNorthEastOf(C.from)&&_?t.setDirection("SW-NE"):t.to.isNorthWestOf(C.from)&&_&&t.setDirection("SE-NW"))}var w=i(s),S=o(b,w),E=r(b,w);t.includesRange(C)&&(C.includes(w)||S||E)&&(S&&(s.row<0?s.row-=b.rowspan-1:s.row>0&&(s.row+=b.rowspan-1)),E&&(s.col<0?s.col-=b.colspan-1:s.col>0&&(s.col+=b.colspan-1)))}0!==s.row&&(n.row=s.row),0!==s.col&&(n.col=s.col)},r.prototype.shiftCollection=function(e,t,n){var o=[0,0];switch(e){case"right":o[0]+=1;break;case"left":o[0]-=1;break;case"down":o[1]+=1;break;case"up":o[1]-=1}for(var r=0;rn;n++)e.mergeCells.mergedCellInfoCollection.setInfo(t[n])}else e.mergeCells=new r(t);else e.mergeCells&&(e.mergeCells.mergedCellInfoCollection=new o)},R=function(e){if(this.mergeCells){var t=(e.ctrlKey||e.metaKey)&&!e.altKey;t&&77===e.keyCode&&(this.mergeCells.mergeOrUnmergeSelection(this.getSelectedRange()),this.render(), -g(e))}},_=function(e){this.getSettings().mergeCells&&(e.items.push(Handsontable.plugins.ContextMenu.SEPARATOR),e.items.push({key:"mergeCells",name:function(){var e=this.getSelected(),t=this.mergeCells.mergedCellInfoCollection.getInfo(e[0],e[1]);return t?"Unmerge cells":"Merge cells"},callback:function(){this.mergeCells.mergeOrUnmergeSelection(this.getSelectedRange()),this.render()},disabled:function(){return!1}}))},S=function(e,t,n,o,r,i){this.mergeCells&&this.mergeCells.applySpanProperties(e,t,n)},E=function(e){return function(t){var n=this.getSettings().mergeCells;if(n){var o=this.getSelectedRange();if(this.mergeCells.modifyTransform(e,o,t),"modifyTransformEnd"===e){var r=this.countRows(),i=this.countCols();o.from.row<0?o.from.row=0:o.from.row>0&&o.from.row>=r&&(o.from.row=o.from-1),o.from.col<0?o.from.col=0:o.from.col>0&&o.from.col>=i&&(o.from.col=i-1)}}}},T=function(e){this.lastDesiredCoords=null;var t=this.getSettings().mergeCells;if(t){var n=this.getSelectedRange();n.highlight=new m(n.highlight.row,n.highlight.col),n.to=e;var o=!1;do{o=!1;for(var r=0,i=this.mergeCells.mergedCellInfoCollection.length;i>r;r++){var s=this.mergeCells.mergedCellInfoCollection[r],a=new m(s.row,s.col),l=new m(s.row+s.rowspan-1,s.col+s.colspan-1),u=new v(a,a,l);n.expandByRange(u)&&(e.row=n.to.row,e.col=n.to.col,o=!0)}}while(o)}},O=function(e,t){if(t&&"area"==t){var n=this.getSettings().mergeCells;if(n)for(var o=this.getSelectedRange(),r=new v(o.from,o.from,o.from),i=new v(o.to,o.to,o.to),s=0,a=this.mergeCells.mergedCellInfoCollection.length;a>s;s++){var l=this.mergeCells.mergedCellInfoCollection[s],u=new m(l.row,l.col),c=new m(l.row+l.rowspan-1,l.col+l.colspan-1),d=new v(u,u,c);r.expandByRange(d)&&(e[0]=r.from.row,e[1]=r.from.col),i.expandByRange(d)&&(e[2]=i.from.row,e[3]=i.from.col)}}},M=function(e,t,n){var o=this.getSettings().mergeCells;if(o){var r=this.mergeCells.mergedCellInfoCollection.getInfo(e,t);!r||r.row==e&&r.col==t||(n.copyable=!1)}},k=function(e){var t=this.getSettings().mergeCells;if(t)for(var n,o=this.countCols(),r=0;o>r;r++){if(n=this.mergeCells.mergedCellInfoCollection.getInfo(e.startRow,r),n&&n.rowe.endRow)return e.endRow=i,k.call(this,e)}}},H=function(e){var t=this.getSettings().mergeCells;if(t)for(var n,o=this.countRows(),r=0;o>r;r++){if(n=this.mergeCells.mergedCellInfoCollection.getInfo(r,e.startColumn),n&&n.cole.endColumn)return e.endColumn=i,H.call(this,e)}}},D=function(e){if(e&&this.mergeCells){var t=this.mergeCells.mergedCellInfoCollection,n=this.getSelectedRange();for(var o in t)if(n.highlight.row==t[o].row&&n.highlight.col==t[o].col&&n.to.row==t[o].row+t[o].rowspan-1&&n.to.col==t[o].col+t[o].colspan-1)return!1}return e};Handsontable.hooks.add("beforeInit",y),Handsontable.hooks.add("afterInit",b),Handsontable.hooks.add("afterUpdateSettings",C),Handsontable.hooks.add("beforeKeyDown",R),Handsontable.hooks.add("modifyTransformStart",E("modifyTransformStart")),Handsontable.hooks.add("modifyTransformEnd",E("modifyTransformEnd")),Handsontable.hooks.add("beforeSetRangeEnd",T),Handsontable.hooks.add("beforeDrawBorders",O),Handsontable.hooks.add("afterIsMultipleSelection",D),Handsontable.hooks.add("afterRenderer",S),Handsontable.hooks.add("afterContextMenuDefaultOptions",_),Handsontable.hooks.add("afterGetCellMeta",M),Handsontable.hooks.add("afterViewportRowCalculatorOverride",k),Handsontable.hooks.add("afterViewportColumnCalculatorOverride",H),Handsontable.hooks.add("afterAutofillApplyValues",i),Handsontable.hooks.add("afterCreateCol",s),Handsontable.hooks.add("afterRemoveCol",a),Handsontable.hooks.add("afterCreateRow",l),Handsontable.hooks.add("afterRemoveRow",u),Handsontable.MergeCells=r},{"3rdparty/walkontable/src/cell/coords":5,"3rdparty/walkontable/src/cell/range":6,"3rdparty/walkontable/src/table":20,"helpers/dom/event":46,plugins:57}],82:[function(e,t,n){"use strict";Object.defineProperties(n,{MultipleSelectionHandles:{get:function(){return p}},__esModule:{value:!0}});var o,r,i,s,a=(o=e("helpers/dom/element"),o&&o.__esModule&&o||{"default":o}),l=a.getWindowScrollTop,u=a.hasClass,c=a.getWindowScrollLeft,d=(r=e("_base"),r&&r.__esModule&&r||{"default":r})["default"],h=(i=e("eventManager"),i&&i.__esModule&&i||{"default":i}).EventManager,f=(s=e("plugins"),s&&s.__esModule&&s||{"default":s}).registerPlugin,p=function(e){$traceurRuntime.superConstructor(g).call(this,e),this.dragged=[],this.eventManager=null,this.lastSetCell=null},g=p;$traceurRuntime.createClass(p,{isEnabled:function(){return Handsontable.mobileBrowser},enablePlugin:function(){this.enabled||(this.eventManager||(this.eventManager=new h(this)),this.registerListeners(),$traceurRuntime.superGet(this,g.prototype,"enablePlugin").call(this))},registerListeners:function(){function e(e){if(1===t.dragged.length)return t.dragged.splice(0,t.dragged.length),!0;var n=t.dragged.indexOf(e);return-1==n?!1:void(0===n?t.dragged=t.dragged.slice(0,1):1==n&&(t.dragged=t.dragged.slice(-1)))}var t=this;this.eventManager.addEventListener(this.hot.rootElement,"touchstart",function(e){var n;return u(e.target,"topLeftSelectionHandle-HitArea")?(n=t.hot.getSelectedRange(),t.dragged.push("topLeft"),t.touchStartRange={width:n.getWidth(),height:n.getHeight(),direction:n.getDirection()},e.preventDefault(),!1):u(e.target,"bottomRightSelectionHandle-HitArea")?(n=t.hot.getSelectedRange(),t.dragged.push("bottomRight"),t.touchStartRange={width:n.getWidth(),height:n.getHeight(),direction:n.getDirection()},e.preventDefault(),!1):void 0}),this.eventManager.addEventListener(this.hot.rootElement,"touchend",function(n){return u(n.target,"topLeftSelectionHandle-HitArea")?(e.call(t,"topLeft"),t.touchStartRange=void 0,n.preventDefault(),!1):u(n.target,"bottomRightSelectionHandle-HitArea")?(e.call(t,"bottomRight"),t.touchStartRange=void 0,n.preventDefault(),!1):void 0}),this.eventManager.addEventListener(this.hot.rootElement,"touchmove",function(e){var n,o,r,i,s,a,u,d=l(),h=c();0!==t.dragged.length&&(n=document.elementFromPoint(e.touches[0].screenX-h,e.touches[0].screenY-d),n&&n!==t.lastSetCell&&(("TD"==n.nodeName||"TH"==n.nodeName)&&(o=t.hot.getCoords(n),-1==o.col&&(o.col=0),r=t.hot.getSelectedRange(),i=r.getWidth(),s=r.getHeight(),a=r.getDirection(),1==i&&1==s&&t.hot.selection.setRangeEnd(o),u=t.getCurrentRangeCoords(r,o,t.touchStartRange.direction,a,t.dragged[0]),null!==u.start&&t.hot.selection.setRangeStart(u.start),t.hot.selection.setRangeEnd(u.end),t.lastSetCell=n),e.preventDefault()))})},getCurrentRangeCoords:function(e,t,n,o,r){var i=e.getTopLeftCorner(),s=e.getBottomRightCorner(),a=e.getBottomLeftCorner(),l=e.getTopRightCorner(),u={start:null,end:null};switch(n){case"NE-SW":switch(o){case"NE-SW":case"NW-SE":u="topLeft"==r?{start:new WalkontableCellCoords(t.row,e.highlight.col),end:new WalkontableCellCoords(a.row,t.col)}:{start:new WalkontableCellCoords(e.highlight.row,t.col),end:new WalkontableCellCoords(t.row,i.col)};break;case"SE-NW":"bottomRight"==r&&(u={start:new WalkontableCellCoords(s.row,t.col),end:new WalkontableCellCoords(t.row,i.col)})}break;case"NW-SE":switch(o){case"NE-SW":"topLeft"==r?u={start:t,end:a}:u.end=t;break;case"NW-SE":"topLeft"==r?u={start:t,end:s}:u.end=t;break;case"SE-NW":"topLeft"==r?u={start:t,end:i}:u.end=t;break;case"SW-NE":"topLeft"==r?u={start:t,end:l}:u.end=t}break;case"SW-NE":switch(o){case"NW-SE":u="bottomRight"==r?{start:new WalkontableCellCoords(t.row,i.col),end:new WalkontableCellCoords(a.row,t.col)}:{start:new WalkontableCellCoords(i.row,t.col),end:new WalkontableCellCoords(t.row,s.col)};break;case"SW-NE":u="topLeft"==r?{start:new WalkontableCellCoords(e.highlight.row,t.col),end:new WalkontableCellCoords(t.row,s.col)}:{start:new WalkontableCellCoords(t.row,i.col),end:new WalkontableCellCoords(i.row,t.col)};break;case"SE-NW":"bottomRight"==r?u={start:new WalkontableCellCoords(t.row,l.col),end:new WalkontableCellCoords(i.row,t.col)}:"topLeft"==r&&(u={start:a,end:t})}break;case"SE-NW":switch(o){case"NW-SE":case"NE-SW":case"SW-NE":"topLeft"==r&&(u.end=t);break;case"SE-NW":"topLeft"==r?u.end=t:u={start:t,end:i}}}return u},isDragged:function(){return this.dragged.length>0}},{},d),f("multipleSelectionHandles",p)},{_base:58,eventManager:41,"helpers/dom/element":45,plugins:57}],83:[function(e,t,n){"use strict";function o(){}function r(){var e=this,t=e.getSettings().observeChanges;t?(e.observer&&a.call(e),i.call(e),u.call(e)):t||a.call(e)}function i(){var e=this;e.observeChangesActive=!0,e.pauseObservingChanges=function(){e.observeChangesActive=!1},e.resumeObservingChanges=function(){e.observeChangesActive=!0},e.observedData=e.getSourceData(),e.observer=p.observe(e.observedData,function(t){e.observeChangesActive&&(s.call(e,t),e.render()),e.runHooks("afterChangesObserved")})}function s(e){function t(e){var t;return t=o(e),t=n(t)}function n(e){var t=[];return e.filter(function(e){var n=r(e.path);if(-1!=["add","remove"].indexOf(e.op)&&!isNaN(n.col)){if(-1!=t.indexOf(n.col))return!1;t.push(n.col)}return!0})}function o(e){return e.filter(function(e){return!/[\/]length/gi.test(e.path)})}function r(e){var t=e.match(/^\/(\d+)\/?(.*)?$/);return{row:parseInt(t[1],10),col:/^\d*$/.test(t[2])?parseInt(t[2],10):t[2]}}for(var i=this,s=t(e),a=0,l=s.length;l>a;a++){var u=s[a],c=r(u.path);switch(u.op){case"add":isNaN(c.col)?i.runHooks("afterCreateRow",c.row):i.runHooks("afterCreateCol",c.col);break;case"remove":isNaN(c.col)?i.runHooks("afterRemoveRow",c.row,1):i.runHooks("afterRemoveCol",c.col,1);break;case"replace":i.runHooks("afterChange",[c.row,c.col,null,u.value],"external")}}}function a(){var e=this;e.observer&&(l.call(e),c.call(e))}function l(){var e=this;p.unobserve(e.observedData,e.observer),delete e.observedData,delete e.observeChangesActive,delete e.pauseObservingChanges,delete e.resumeObservingChanges}function u(){var e=this;e.addHook("afterDestroy",a),e.addHook("afterCreateRow",d),e.addHook("afterRemoveRow",d),e.addHook("afterCreateCol",d),e.addHook("afterRemoveCol",d),e.addHook("afterChange",function(e,t){"loadData"!=t&&d.call(this)})}function c(){var e=this;e.removeHook("afterDestroy",a),e.removeHook("afterCreateRow",d),e.removeHook("afterRemoveRow",d),e.removeHook("afterCreateCol",d),e.removeHook("afterRemoveCol",d),e.removeHook("afterChange",d)}function d(){var e=this;e.pauseObservingChanges(),e.addHookOnce("afterChangesObserved",function(){e.resumeObservingChanges()})}Object.defineProperties(n,{ObserveChanges:{get:function(){return o}},__esModule:{value:!0}});var h,f,p=((h=e("plugins"),h&&h.__esModule&&h||{"default":h}).registerPlugin,(f=e("jsonpatch"),f&&f.__esModule&&f||{"default":f})["default"]);Handsontable.hooks.add("afterLoadData",r),Handsontable.hooks.add("afterUpdateSettings",r),Handsontable.hooks.register("afterChangesObserved")},{jsonpatch:"jsonpatch",plugins:57}],84:[function(e,t,n){"use strict";function o(e){var t,n=function(){window.localStorage[e+"__persistentStateKeys"]=JSON.stringify(t)},o=function(){var n=window.localStorage[e+"__persistentStateKeys"],o="string"==typeof n?JSON.parse(n):void 0;t=o?o:[]},r=function(){t=[],n()};o(),this.saveValue=function(o,r){window.localStorage[e+"_"+o]=JSON.stringify(r),-1==t.indexOf(o)&&(t.push(o),n())},this.loadValue=function(t,n){t="undefined"==typeof t?n:t;var o=window.localStorage[e+"_"+t];return"undefined"==typeof o?void 0:JSON.parse(o)},this.reset=function(t){window.localStorage.removeItem(e+"_"+t)},this.resetAll=function(){for(var n=0;na;a++)for(var l=0;i>l;l++){var u=e.getDataAtCell(a,l),c=e.getCellMeta(a,l),d=c.search.callback||n,h=c.search.queryMethod||o,f=h(t,u);if(f){var p={row:a,col:l,data:u};s.push(p)}d&&d(e,a,l,u,f)}return s}},Handsontable.Search.DEFAULT_CALLBACK=function(e,t,n,o,r){e.getCellMeta(t,n).isSearchResult=r},Handsontable.Search.DEFAULT_QUERY_METHOD=function(e,t){return"undefined"!=typeof e&&null!=e&&e.toLowerCase&&0!==e.length?"undefined"==typeof t||null==t?!1:-1!=t.toString().toLowerCase().indexOf(e.toLowerCase()):!1},Handsontable.Search.DEFAULT_SEARCH_RESULT_CLASS="htSearchResult",Handsontable.Search.global=function(){var e=Handsontable.Search.DEFAULT_CALLBACK,t=Handsontable.Search.DEFAULT_QUERY_METHOD,n=Handsontable.Search.DEFAULT_SEARCH_RESULT_CLASS;return{getDefaultCallback:function(){return e},setDefaultCallback:function(t){e=t},getDefaultQueryMethod:function(){return t},setDefaultQueryMethod:function(e){t=e},getDefaultSearchResultClass:function(){return n},setDefaultSearchResultClass:function(e){n=e}}}(),Handsontable.SearchCellDecorator=function(e,t,n,o,r,i,s){var u=null!==s.search&&"object"==typeof s.search&&s.search.searchResultClass||Handsontable.Search.global.getDefaultSearchResultClass();s.isSearchResult?a(t,u):l(t,u)};var h=d("base");c("base",function(e,t,n,o,r,i,s){h.apply(this,arguments),Handsontable.SearchCellDecorator.apply(this,arguments)}),Handsontable.hooks.add("afterInit",o),Handsontable.hooks.add("afterUpdateSettings",o)},{"helpers/dom/element":45,renderers:88}],86:[function(e,t,n){"use strict";Object.defineProperties(n,{TouchScroll:{get:function(){return d}},__esModule:{value:!0}});var o,r,i,s=(o=e("helpers/dom/element"),o&&o.__esModule&&o||{"default":o}),a=s.addClass,l=s.removeClass,u=(r=e("_base"),r&&r.__esModule&&r||{"default":r})["default"],c=(i=e("plugins"),i&&i.__esModule&&i||{"default":i}).registerPlugin,d=function(e){var t=this;$traceurRuntime.superConstructor(h).call(this,e),this.hot.addHook("afterInit",function(){return t.afterInit()}),this.hot.addHook("afterUpdateSettings",function(){return t.onAfterUpdateSettings()}),this.scrollbars=[],this.clones=[]},h=d;$traceurRuntime.createClass(d,{afterInit:function(){this.registerEvents(),this.onAfterUpdateSettings()},onAfterUpdateSettings:function(){var e=this;this.hot.addHookOnce("afterRender",function(){var t=e.hot.view.wt.wtOverlays;e.scrollbars=[],e.scrollbars.push(t.topOverlay),t.bottomOverlay.clone&&e.scrollbars.push(t.bottomOverlay),e.scrollbars.push(t.leftOverlay),t.topLeftCornerOverlay&&e.scrollbars.push(t.topLeftCornerOverlay),t.bottomLeftCornerOverlay&&t.bottomLeftCornerOverlay.clone&&e.scrollbars.push(t.bottomLeftCornerOverlay),e.clones=[],t.topOverlay.needFullRender&&e.clones.push(t.topOverlay.clone.wtTable.holder.parentNode),t.bottomOverlay.needFullRender&&e.clones.push(t.bottomOverlay.clone.wtTable.holder.parentNode),t.leftOverlay.needFullRender&&e.clones.push(t.leftOverlay.clone.wtTable.holder.parentNode),t.topLeftCornerOverlay&&e.clones.push(t.topLeftCornerOverlay.clone.wtTable.holder.parentNode),t.bottomLeftCornerOverlay&&t.bottomLeftCornerOverlay.clone&&e.clones.push(t.bottomLeftCornerOverlay.clone.wtTable.holder.parentNode)})},registerEvents:function(){var e=this;this.hot.addHook("beforeTouchScroll",function(){return e.onBeforeTouchScroll()}),this.hot.addHook("afterMomentumScroll",function(){return e.onAfterMomentumScroll()})},onBeforeTouchScroll:function(){Handsontable.freezeOverlays=!0;for(var e=0,t=this.clones.length;t>e;e++)a(this.clones[e],"hide-tween")},onAfterMomentumScroll:function(){Handsontable.freezeOverlays=!1;for(var e=this,t=0,n=this.clones.length;n>t;t++)l(this.clones[t],"hide-tween");for(var o=0,r=this.clones.length;r>o;o++)a(this.clones[o],"show-tween");setTimeout(function(){for(var t=0,n=e.clones.length;n>t;t++)l(e.clones[t],"show-tween")},400);for(var i=0,s=this.scrollbars.length;s>i;i++)this.scrollbars[i].refresh(),this.scrollbars[i].resetFixedPosition();this.hot.view.wt.wtOverlays.syncScrollWithMaster()}},{},u),c("touchScroll",d)},{_base:58,"helpers/dom/element":45,plugins:57}],87:[function(e,t,n){"use strict";function o(){var e=this,t="undefined"==typeof e.getSettings().undo||e.getSettings().undo;t?e.undoRedo||(e.undoRedo=new Handsontable.UndoRedo(e),s(e),e.addHook("beforeKeyDown",r),e.addHook("afterChange",i)):e.undoRedo&&(delete e.undoRedo,a(e),e.removeHook("beforeKeyDown",r),e.removeHook("afterChange",i))}function r(e){var t=this,n=(e.ctrlKey||e.metaKey)&&!e.altKey;n&&(89===e.keyCode||e.shiftKey&&90===e.keyCode?(t.undoRedo.redo(),f(e)):90===e.keyCode&&(t.undoRedo.undo(),f(e)))}function i(e,t){var n=this;return"loadData"==t?n.undoRedo.clear():void 0}function s(e){e.undo=function(){return e.undoRedo.undo()},e.redo=function(){return e.undoRedo.redo()},e.isUndoAvailable=function(){return e.undoRedo.isUndoAvailable()},e.isRedoAvailable=function(){return e.undoRedo.isRedoAvailable()},e.clearUndo=function(){return e.undoRedo.clear()}}function a(e){delete e.undo,delete e.redo,delete e.isUndoAvailable,delete e.isRedoAvailable,delete e.clearUndo}var l,u,c=(l=e("helpers/object"),l&&l.__esModule&&l||{"default":l}),d=c.inherit,h=c.deepClone,f=(u=e("helpers/dom/event"),u&&u.__esModule&&u||{"default":u}).stopImmediatePropagation;Handsontable.UndoRedo=function(e){var t=this;this.instance=e,this.doneActions=[],this.undoneActions=[],this.ignoreNewActions=!1,e.addHook("afterChange",function(e,n){if(e){var o=new Handsontable.UndoRedo.ChangeAction(e);t.done(o)}}),e.addHook("afterCreateRow",function(e,n,o){if(!o){var r=new Handsontable.UndoRedo.CreateRowAction(e,n);t.done(r)}}),e.addHook("beforeRemoveRow",function(e,n){var o=t.instance.getSourceData();e=(o.length+e)%o.length;var r=o.slice(e,e+n),i=new Handsontable.UndoRedo.RemoveRowAction(e,r);t.done(i)}),e.addHook("afterCreateCol",function(e,n,o){if(!o){var r=new Handsontable.UndoRedo.CreateColumnAction(e,n);t.done(r)}}),e.addHook("beforeRemoveCol",function(n,o){var r=t.instance.getSourceData();n=(t.instance.countCols()+n)%t.instance.countCols();for(var i=[],s=0,a=r.length;a>s;s++)i[s]=r[s].slice(n,n+o);var l;Array.isArray(e.getSettings().colHeaders)&&(l=e.getSettings().colHeaders.slice(n,n+i.length));var u=new Handsontable.UndoRedo.RemoveColumnAction(n,i,l);t.done(u)}),e.addHook("beforeCellAlignment",function(e,n,o,r){var i=new Handsontable.UndoRedo.CellAlignmentAction(e,n,o,r);t.done(i)})},Handsontable.UndoRedo.prototype.done=function(e){this.ignoreNewActions||(this.doneActions.push(e),this.undoneActions.length=0)},Handsontable.UndoRedo.prototype.undo=function(){if(this.isUndoAvailable()){var e=this.doneActions.pop();this.ignoreNewActions=!0;var t=this;e.undo(this.instance,function(){t.ignoreNewActions=!1,t.undoneActions.push(e)})}},Handsontable.UndoRedo.prototype.redo=function(){if(this.isRedoAvailable()){var e=this.undoneActions.pop();this.ignoreNewActions=!0;var t=this;e.redo(this.instance,function(){t.ignoreNewActions=!1,t.doneActions.push(e)})}},Handsontable.UndoRedo.prototype.isUndoAvailable=function(){return this.doneActions.length>0},Handsontable.UndoRedo.prototype.isRedoAvailable=function(){return this.undoneActions.length>0},Handsontable.UndoRedo.prototype.clear=function(){this.doneActions.length=0,this.undoneActions.length=0},Handsontable.UndoRedo.Action=function(){},Handsontable.UndoRedo.Action.prototype.undo=function(){},Handsontable.UndoRedo.Action.prototype.redo=function(){},Handsontable.UndoRedo.ChangeAction=function(e){this.changes=e},d(Handsontable.UndoRedo.ChangeAction,Handsontable.UndoRedo.Action),Handsontable.UndoRedo.ChangeAction.prototype.undo=function(e,t){for(var n=h(this.changes),o=e.countEmptyRows(!0),r=e.countEmptyCols(!0),i=0,s=n.length;s>i;i++)n[i].splice(3,1);e.addHookOnce("afterChange",t),e.setDataAtRowProp(n,null,null,"undo");for(var i=0,s=n.length;s>i;i++)e.getSettings().minSpareRows&&n[i][0]+1+e.getSettings().minSpareRows===e.countRows()&&o==e.getSettings().minSpareRows&&(e.alter("remove_row",parseInt(n[i][0]+1,10),e.getSettings().minSpareRows),e.undoRedo.doneActions.pop()),e.getSettings().minSpareCols&&n[i][1]+1+e.getSettings().minSpareCols===e.countCols()&&r==e.getSettings().minSpareCols&&(e.alter("remove_col",parseInt(n[i][1]+1,10),e.getSettings().minSpareCols),e.undoRedo.doneActions.pop())},Handsontable.UndoRedo.ChangeAction.prototype.redo=function(e,t){for(var n=h(this.changes),o=0,r=n.length;r>o;o++)n[o].splice(2,1);e.addHookOnce("afterChange",t),e.setDataAtRowProp(n,null,null,"redo")},Handsontable.UndoRedo.CreateRowAction=function(e,t){this.index=e,this.amount=t},d(Handsontable.UndoRedo.CreateRowAction,Handsontable.UndoRedo.Action),Handsontable.UndoRedo.CreateRowAction.prototype.undo=function(e,t){var n=e.countRows(),o=e.getSettings().minSpareRows;this.index>=n&&this.index-or;r++)n=e.getSourceDataAtRow(r),o=[this.index,0],Array.prototype.push.apply(o,this.data[r]),Array.prototype.splice.apply(n,o);"undefined"!=typeof this.headers&&(o=[this.index,0],Array.prototype.push.apply(o,this.headers),Array.prototype.splice.apply(e.getSettings().colHeaders,o)),e.addHookOnce("afterRender",t),e.render()},Handsontable.UndoRedo.RemoveColumnAction.prototype.redo=function(e,t){e.addHookOnce("afterRemoveCol",t),e.alter("remove_col",this.index,this.amount)},Handsontable.hooks.add("afterInit",o),Handsontable.hooks.add("afterUpdateSettings",o)},{"helpers/dom/event":46,"helpers/object":50}],88:[function(e,t,n){"use strict";function o(e,t){var n;l[e]=t,n=a(e)+"Renderer",Handsontable.renderers[n]=t,Handsontable[n]=t}function r(e){if("function"==typeof e)return e;if("string"!=typeof e)throw Error('Only strings and functions can be passed as "renderer" parameter');if(!(e in l))throw Error('No editor registered under name "'+e+'"');return l[e]}function i(e){return e in l}Object.defineProperties(n,{registerRenderer:{get:function(){return o}},getRenderer:{get:function(){return r}},hasRenderer:{get:function(){return i}},__esModule:{value:!0}});var s,a=(s=e("helpers/string"),s&&s.__esModule&&s||{"default":s}).toUpperCaseFirst,l={};Handsontable.renderers=Handsontable.renderers||{},Handsontable.renderers.registerRenderer=o,Handsontable.renderers.getRenderer=r},{"helpers/string":52}],89:[function(e,t,n){"use strict";function o(e,t,n,o,r,i,s){s.className&&(t.className?t.className=t.className+" "+s.className:t.className=s.className),s.readOnly&&a(t,s.readOnlyCellClassName),s.valid===!1&&s.invalidCellClassName?a(t,s.invalidCellClassName):l(t,s.invalidCellClassName),s.wordWrap===!1&&s.noWordWrapClassName&&a(t,s.noWordWrapClassName),!i&&s.placeholder&&a(t,s.placeholderCellClassName)}Object.defineProperties(n,{cellDecorator:{get:function(){return o}},__esModule:{value:!0}});var r,i,s=(r=e("helpers/dom/element"),r&&r.__esModule&&r||{"default":r}),a=s.addClass,l=s.removeClass,u=(i=e("renderers"),i&&i.__esModule&&i||{"default":i}).registerRenderer;u("base",o),Handsontable.renderers.cellDecorator=o},{"helpers/dom/element":45,renderers:88}],90:[function(e,t,n){"use strict";function o(e,t,n,o,r,i,s){var a=(m.cloneNode(!0),v.cloneNode(!0));if(f("text")(e,t,n,o,r,i,s),t.appendChild(a),u(t,"htAutocomplete"),t.firstChild||t.appendChild(document.createTextNode(String.fromCharCode(160))),!e.acArrowListener){var l=d(e);e.acArrowListener=function(r){c(r.target,"htAutocompleteArrow")&&e.view.wt.getSetting("onCellDblClick",null,new g(n,o),t)},l.addEventListener(e.rootElement,"mousedown",e.acArrowListener),e.addHookOnce("afterDestroy",function(){l.destroy()})}}Object.defineProperties(n,{autocompleteRenderer:{get:function(){return o}},__esModule:{value:!0}});var r,i,s,a,l=(r=e("helpers/dom/element"),r&&r.__esModule&&r||{"default":r}),u=l.addClass,c=l.hasClass,d=(l.empty,(i=e("eventManager"),i&&i.__esModule&&i||{"default":i}).eventManager),h=(s=e("renderers"),s&&s.__esModule&&s||{"default":s}),f=h.getRenderer,p=h.registerRenderer,g=(a=e("3rdparty/walkontable/src/cell/coords"),a&&a.__esModule&&a||{"default":a}).WalkontableCellCoords,m=document.createElement("DIV");m.className="htAutocompleteWrapper";var v=document.createElement("DIV");v.className="htAutocompleteArrow",v.appendChild(document.createTextNode(String.fromCharCode(9660)));p("autocomplete",o)},{"3rdparty/walkontable/src/cell/coords":5,eventManager:41,"helpers/dom/element":45,renderers:88}],91:[function(e,t,n){"use strict";function o(e,t,n,o,a,l,u){function c(e){var t=[C.SPACE,C.ENTER,C.DELETE,C.BACKSPACE];-1===t.indexOf(e.keyCode)||E(e)||f(function(){S(e),e.preventDefault()}),(e.keyCode==C.SPACE||e.keyCode==C.ENTER)&&d(),(e.keyCode==C.DELETE||e.keyCode==C.BACKSPACE)&&d(!1)}function d(){var e=void 0!==arguments[0]?arguments[0]:null;f(function(t){for(var n=0,o=t.length;o>n;n++){if(m(t[n],O)&&null===e)return;h(t[n],e)}})}function h(e){var t=void 0!==arguments[1]?arguments[1]:null;null===t?e.checked=!e.checked:e.checked=t,y.fireEvent(e,"change")}function f(t){for(var n=e.getSelectedRange(),o=n.getTopLeftCorner(),r=n.getBottomRightCorner(),i=o.row;i<=r.row;i++)for(var s=o.col;s<=r.col;s++){var a=e.getCell(i,s),l=e.getCellMeta(i,s),u=a.querySelectorAll("input[type=checkbox]");u.length>0&&!l.readOnly&&t(u)}}var y=new w(e),b=r(),R=u.label,M=!1;if("undefined"==typeof u.checkedTemplate&&(u.checkedTemplate=!0),"undefined"==typeof u.uncheckedTemplate&&(u.uncheckedTemplate=!1),p(t),l===u.checkedTemplate||v(l,u.checkedTemplate)?b.checked=!0:l===u.uncheckedTemplate||v(l,u.uncheckedTemplate)?b.checked=!1:null===l?g(b,"noValue"):(b.style.display="none",g(b,O),M=!0),!M&&R){var k="";R.value?k="function"==typeof R.value?R.value.call(this,n,o,a,l):R.value:R.property&&(k=e.getDataAtRowProp(n,R.property));var H=i(k);"before"===R.position?H.appendChild(b):H.insertBefore(b,H.firstChild),b=H}t.appendChild(b),M&&t.appendChild(document.createTextNode("#bad-value#")),u.readOnly?y.addEventListener(b,"click",s):(y.addEventListener(b,"mousedown",_),y.addEventListener(b,"mouseup",_),y.addEventListener(b,"change",function(t){e.setDataAtRowProp(n,a,t.target.checked?u.checkedTemplate:u.uncheckedTemplate)})),T.has(e)||(T.set(e,!0),e.addHook("beforeKeyDown",c))}function r(){var e=document.createElement("input");return e.className="htCheckboxRendererInput",e.type="checkbox",e.setAttribute("autocomplete","off"),e.cloneNode(!1)}function i(e){var t=document.createElement("label");return t.className="htCheckboxRendererLabel",t.appendChild(document.createTextNode(e)),t.cloneNode(!0)}function s(e){e.preventDefault()}Object.defineProperties(n,{checkboxRenderer:{get:function(){return o}},__esModule:{value:!0}});var a,l,u,c,d,h,f=(a=e("helpers/dom/element"),a&&a.__esModule&&a||{"default":a}),p=f.empty,g=f.addClass,m=f.hasClass,v=(l=e("helpers/string"),l&&l.__esModule&&l||{"default":l}).equalsIgnoreCase,w=(u=e("eventManager"),u&&u.__esModule&&u||{"default":u}).EventManager,y=(c=e("renderers"),c&&c.__esModule&&c||{"default":c}),b=(y.getRenderer,y.registerRenderer),C=(d=e("helpers/unicode"),d&&d.__esModule&&d||{"default":d}).KEY_CODES,R=(h=e("helpers/dom/event"),h&&h.__esModule&&h||{"default":h}),_=R.stopPropagation,S=R.stopImmediatePropagation,E=R.isImmediatePropagationStopped,T=new WeakMap,O="htBadValue";b("checkbox",o)},{eventManager:41,"helpers/dom/element":45,"helpers/dom/event":46,"helpers/string":52,"helpers/unicode":53,renderers:88}],92:[function(e,t,n){"use strict";function o(e,t,n,o,r,i,a){l("base").apply(this,arguments),s(t,i)}Object.defineProperties(n,{htmlRenderer:{get:function(){return o}},__esModule:{value:!0}});var r,i,s=(r=e("helpers/dom/element"),r&&r.__esModule&&r||{"default":r}).fastInnerHTML,a=(i=e("renderers"),i&&i.__esModule&&i||{"default":i}),l=a.getRenderer,u=a.registerRenderer;u("html",o)},{"helpers/dom/element":45,renderers:88}],93:[function(e,t,n){"use strict";function o(e,t,n,o,r,i,s){f(i)&&("undefined"!=typeof s.language&&l.language(s.language),i=l(i).format(s.format||"0"),u(t,"htNumeric")),d("text")(e,t,n,o,r,i,s)}Object.defineProperties(n,{numericRenderer:{get:function(){return o}},__esModule:{value:!0}});var r,i,s,a,l=(r=e("numeral"),r&&r.__esModule&&r||{"default":r})["default"],u=(i=e("helpers/dom/element"),i&&i.__esModule&&i||{"default":i}).addClass,c=(s=e("renderers"),s&&s.__esModule&&s||{"default":s}),d=c.getRenderer,h=c.registerRenderer,f=(a=e("helpers/number"),a&&a.__esModule&&a||{"default":a}).isNumeric;h("numeric",o)},{"helpers/dom/element":45,"helpers/number":49,numeral:"numeral",renderers:88 -}],94:[function(e,t,n){"use strict";function o(e,t,n,o,r,i,a){l("text").apply(this,arguments),i=t.innerHTML;var u,c=a.hashLength||i.length,d=a.hashSymbol||"*";for(u="";u.split(d).length-13?("function"==typeof o&&(e.__proto__=o),e.prototype=d(a(o),i(t))):e.prototype=t,f(e,"prototype",{configurable:!1,writable:!1}),h(e,i(n))}function a(e){if("function"==typeof e){var t=e.prototype;if(u(t)===t||null===t)return e.prototype;throw new c("super prototype must be an Object or null")}if(null===e)return null;throw new c("Super expression must either be null or a function, not "+typeof e+".")}function l(e,t,o){null!==g(t)&&n(e,t,"constructor",o)}var u=Object,c=TypeError,d=u.create,h=$traceurRuntime.defineProperties,f=$traceurRuntime.defineProperty,p=$traceurRuntime.getOwnPropertyDescriptor,g=Object.getPrototypeOf,m=$traceurRuntime.toProperty,v=Object,w=v.getOwnPropertyNames,y=v.getOwnPropertySymbols;$traceurRuntime.createClass=s,$traceurRuntime.defaultSuperCall=l,$traceurRuntime.superCall=n,$traceurRuntime.superConstructor=t,$traceurRuntime.superGet=o,$traceurRuntime.superSet=r}()},{}],97:[function(e,t,n){"use strict";function o(e){var t=this;this.eventManager=b(e),this.instance=e,this.settings=e.getSettings(),this.selectionMouseDown=!1;var n=e.rootElement.getAttribute("style");n&&e.rootElement.setAttribute("data-originalstyle",n),d(e.rootElement,"handsontable");var o=document.createElement("TABLE");d(o,"htCore"),e.getSettings().tableClassName&&d(o,e.getSettings().tableClassName),this.THEAD=document.createElement("THEAD"),o.appendChild(this.THEAD),this.TBODY=document.createElement("TBODY"),o.appendChild(this.TBODY),e.table=o,e.container.insertBefore(o,e.container.firstChild),this.eventManager.addEventListener(e.rootElement,"mousedown",function(e){this.selectionMouseDown=!0,t.isTextSelectionAllowed(e.target)||(i(),e.preventDefault(),window.focus())}),this.eventManager.addEventListener(e.rootElement,"mouseup",function(e){this.selectionMouseDown=!1}),this.eventManager.addEventListener(e.rootElement,"mousemove",function(e){this.selectionMouseDown&&!t.isTextSelectionAllowed(e.target)&&(i(),e.preventDefault())}),this.eventManager.addEventListener(document.documentElement,"keyup",function(t){e.selection.isInProgress()&&!t.shiftKey&&e.selection.finish()});var r;this.isMouseDown=function(){return r},this.eventManager.addEventListener(document.documentElement,"mouseup",function(t){e.selection.isInProgress()&&1===t.which&&e.selection.finish(),r=!1,y(document.activeElement)&&e.unlisten()}),this.eventManager.addEventListener(document.documentElement,"mousedown",function(n){var o=n.target,i=n.x||n.clientX,s=n.y||n.clientY;if(!r&&e.rootElement){if(o===e.view.wt.wtTable.holder){var a=g();if(document.elementFromPoint(i+a,s)!==e.view.wt.wtTable.holder||document.elementFromPoint(i,s+a)!==e.view.wt.wtTable.holder)return}else for(;o!==document.documentElement;){if(null===o){if(n.isTargetWebComponent)break;return}if(o===e.rootElement)return;o=o.parentNode}t.settings.outsideClickDeselects?e.deselectCell():e.destroyEditor()}}),this.eventManager.addEventListener(o,"selectstart",function(e){t.settings.fragmentSelection||w(e.target)||e.preventDefault()});var i=function(){window.getSelection?window.getSelection().empty?window.getSelection().empty():window.getSelection().removeAllRanges&&window.getSelection().removeAllRanges():document.selection&&document.selection.empty()},s=[new E({className:"current",border:{width:2,color:"#5292F7",cornerVisible:function(){return t.settings.fillHandle&&!t.isCellEdited()&&!e.selection.isMultiple()},multipleSelectionHandlesVisible:function(){return!t.isCellEdited()&&!e.selection.isMultiple()}}}),new E({className:"area",border:{width:1,color:"#89AFF9",cornerVisible:function(){return t.settings.fillHandle&&!t.isCellEdited()&&e.selection.isMultiple()},multipleSelectionHandlesVisible:function(){return!t.isCellEdited()&&e.selection.isMultiple()}}}),new E({className:"highlight",highlightRowClassName:t.settings.currentRowClassName,highlightColumnClassName:t.settings.currentColClassName}),new E({className:"fill",border:{width:1,color:"red"}})];s.current=s[0],s.area=s[1],s.highlight=s[2],s.fill=s[3];var a={debug:function(){return t.settings.debug},externalRowCalculator:this.instance.getPlugin("autoRowSize")&&this.instance.getPlugin("autoRowSize").isEnabled(),table:o,stretchH:this.settings.stretchH,data:e.getDataAtCell,totalRows:function(){return e.countRows()},totalColumns:function(){return e.countCols()},fixedColumnsLeft:function(){return t.settings.fixedColumnsLeft},fixedRowsTop:function(){return t.settings.fixedRowsTop},fixedRowsBottom:function(){return t.settings.fixedRowsBottom},minSpareRows:function(){return t.settings.minSpareRows},renderAllRows:t.settings.renderAllRows,rowHeaders:function(){var n=[];return e.hasRowHeaders()&&n.push(function(e,n){t.appendRowHeader(e,n)}),Handsontable.hooks.run(e,"afterGetRowHeaderRenderers",n),n},columnHeaders:function(){var n=[];return e.hasColHeaders()&&n.push(function(e,n){t.appendColHeader(e,n)}),Handsontable.hooks.run(e,"afterGetColumnHeaderRenderers",n),n},columnWidth:e.getColWidth,rowHeight:e.getRowHeight,cellRenderer:function(e,n,o){var r=t.instance.colToProp(n),i=t.instance.getCellMeta(e,n),s=t.instance.getCellRenderer(i),a=t.instance.getDataAtRowProp(e,r);s(t.instance,o,e,n,r,a,i),Handsontable.hooks.run(t.instance,"afterRenderer",o,e,n,r,a,i)},selections:s,hideBorderOnMouseDownOver:function(){return t.settings.fragmentSelection},onCellMouseDown:function(n,o,i,s){var a,l,u=i.parentNode,c=u.parentNode;if(e.listen(),t.activeWt=s,r=!0,Handsontable.hooks.run(e,"beforeOnCellMouseDown",n,o,i),e.selection.setSelectedHeaders(!1,!1),!_(n)){if(2===n.button&&e.selection.inInSelection(o));else n.shiftKey?o.row>=0&&o.col>=0&&e.selection.setRangeEnd(o):(o.row<0||o.col<0)&&(o.row>=0||o.col>=0)?(o.row<0&&(a=c.childNodes.length-Array.prototype.indexOf.call(c.childNodes,u)-1,l=e.getHeaderColspan(o.col,a),e.selection.setSelectedHeaders(!1,!0),e.selectCell(0,o.col,e.countRows()-1,o.col+Math.max(0,l-1))),o.col<0&&(e.selection.setSelectedHeaders(!0,!1),e.selectCell(o.row,0,o.row,e.countCols()-1))):(o.row=o.row<0?0:o.row,o.col=o.col<0?0:o.col,e.selection.setRangeStart(o));Handsontable.hooks.run(e,"afterOnCellMouseDown",n,o,i),t.activeWt=t.wt}},onCellMouseOver:function(n,o,i,s){t.activeWt=s,o.row>=0&&o.col>=0?r&&e.selection.setRangeEnd(o):r&&(o.row<0&&(e.selection.selectedHeader.cols?(e.selection.setRangeEnd(new S(e.countRows()-1,o.col)),e.selection.setSelectedHeaders(!1,!0)):e.selection.setRangeEnd(new S(o.row,o.col))),o.col<0&&(e.selection.selectedHeader.rows?(e.selection.setRangeEnd(new S(o.row,e.countCols()-1)),e.selection.setSelectedHeaders(!0,!1)):e.selection.setRangeEnd(new S(o.row,o.col)))),Handsontable.hooks.run(e,"afterOnCellMouseOver",n,o,i),t.activeWt=t.wt},onCellCornerMouseDown:function(t){t.preventDefault(),Handsontable.hooks.run(e,"afterOnCellCornerMouseDown",t)},beforeDraw:function(e){t.beforeRender(e)},onDraw:function(e){t.onDraw(e)},onScrollVertically:function(){e.runHooks("afterScrollVertically")},onScrollHorizontally:function(){e.runHooks("afterScrollHorizontally")},onBeforeDrawBorders:function(t,n){e.runHooks("beforeDrawBorders",t,n)},onBeforeTouchScroll:function(){e.runHooks("beforeTouchScroll")},onAfterMomentumScroll:function(){e.runHooks("afterMomentumScroll")},viewportRowCalculatorOverride:function(n){var o=e.countRows(),r=t.settings.viewportRowRenderingOffset;if("auto"===r&&t.settings.fixedRowsTop&&(r=10),"number"==typeof r&&(n.startRow=Math.max(n.startRow-r,0),n.endRow=Math.min(n.endRow+r,o-1)),"auto"===r){var i=n.startRow+n.endRow-n.startRow,s=Math.ceil(i/o*12);n.startRow=Math.max(n.startRow-s,0),n.endRow=Math.min(n.endRow+s,o-1)}e.runHooks("afterViewportRowCalculatorOverride",n)},viewportColumnCalculatorOverride:function(n){var o=e.countCols(),r=t.settings.viewportColumnRenderingOffset;if("auto"===r&&t.settings.fixedColumnsLeft&&(r=10),"number"==typeof r&&(n.startColumn=Math.max(n.startColumn-r,0),n.endColumn=Math.min(n.endColumn+r,o-1)),"auto"===r){var i=n.startColumn+n.endColumn-n.startColumn,s=Math.ceil(i/o*12);n.startRow=Math.max(n.startColumn-s,0),n.endColumn=Math.min(n.endColumn+s,o-1)}e.runHooks("afterViewportColumnCalculatorOverride",n)}};Handsontable.hooks.run(e,"beforeInitWalkontable",a),this.wt=new T(a),this.activeWt=this.wt,this.eventManager.addEventListener(t.wt.wtTable.spreader,"mousedown",function(e){e.target===t.wt.wtTable.spreader&&3===e.which&&R(e)}),this.eventManager.addEventListener(t.wt.wtTable.spreader,"contextmenu",function(e){e.target===t.wt.wtTable.spreader&&3===e.which&&R(e)}),this.eventManager.addEventListener(document.documentElement,"click",function(){t.settings.observeDOMVisibility&&t.wt.drawInterrupted&&(t.instance.forceFullRender=!0,t.render())})}Object.defineProperties(n,{TableView:{get:function(){return o}},__esModule:{value:!0}});var r,i,s,a,l,u,c=(r=e("helpers/dom/element"),r&&r.__esModule&&r||{"default":r}),d=c.addClass,h=c.empty,f=c.fastInnerHTML,p=c.fastInnerText,g=c.getScrollbarWidth,m=c.hasClass,v=c.isChildOf,w=c.isInput,y=c.isOutsideInput,b=(i=e("eventManager"),i&&i.__esModule&&i||{"default":i}).eventManager,C=(s=e("helpers/dom/event"),s&&s.__esModule&&s||{"default":s}),R=C.stopPropagation,_=C.isImmediatePropagationStopped,S=(a=e("3rdparty/walkontable/src/cell/coords"),a&&a.__esModule&&a||{"default":a}).WalkontableCellCoords,E=(l=e("3rdparty/walkontable/src/selection"),l&&l.__esModule&&l||{"default":l}).WalkontableSelection,T=(u=e("3rdparty/walkontable/src/core"),u&&u.__esModule&&u||{"default":u}).Walkontable;Handsontable.TableView=o,o.prototype.isTextSelectionAllowed=function(e){if(w(e))return!0;var t=v(e,this.instance.view.wt.wtTable.spreader);return this.settings.fragmentSelection===!0&&t?!0:"cell"===this.settings.fragmentSelection&&this.isSelectedOnlyCell()&&t?!0:!1},o.prototype.isSelectedOnlyCell=function(){var e=this.instance.getSelected()||[],t=e[0],n=e[1],o=e[2],r=e[3];return void 0!==t&&t===o&&n===r},o.prototype.isCellEdited=function(){var e=this.instance.getActiveEditor();return e&&e.isOpened()},o.prototype.beforeRender=function(e){e&&Handsontable.hooks.run(this.instance,"beforeRender",this.instance.forceFullRender)},o.prototype.onDraw=function(e){e&&Handsontable.hooks.run(this.instance,"afterRender",this.instance.forceFullRender)},o.prototype.render=function(){this.wt.draw(!this.instance.forceFullRender),this.instance.forceFullRender=!1,this.instance.renderCall=!1},o.prototype.getCellAtCoords=function(e,t){var n=this.wt.getCell(e,t);return 0>n?null:n},o.prototype.scrollViewport=function(e){this.wt.scrollViewport(e)},o.prototype.appendRowHeader=function(e,t){if(t.firstChild){var n=t.firstChild;if(!m(n,"relative"))return h(t),void this.appendRowHeader(e,t);this.updateCellHeader(n.querySelector(".rowHeader"),e,this.instance.getRowHeader)}else{var o=document.createElement("div"),r=document.createElement("span");o.className="relative",r.className="rowHeader",this.updateCellHeader(r,e,this.instance.getRowHeader),o.appendChild(r),t.appendChild(o)}Handsontable.hooks.run(this.instance,"afterGetRowHeader",e,t)},o.prototype.appendColHeader=function(e,t){if(t.firstChild){var n=t.firstChild;m(n,"relative")?this.updateCellHeader(n.querySelector(".colHeader"),e,this.instance.getColHeader):(h(t),this.appendColHeader(e,t))}else{var o=document.createElement("div"),r=document.createElement("span");o.className="relative",r.className="colHeader",this.updateCellHeader(r,e,this.instance.getColHeader),o.appendChild(r),t.appendChild(o)}Handsontable.hooks.run(this.instance,"afterGetColHeader",e,t)},o.prototype.updateCellHeader=function(e,t,n){t>-1?f(e,n(t)):(p(e,String.fromCharCode(160)),d(e,"cornerHeader"))},o.prototype.maximumVisibleElementWidth=function(e){var t=this.wt.wtViewport.getWorkspaceWidth(),n=t-e;return n>0?n:0},o.prototype.maximumVisibleElementHeight=function(e){var t=this.wt.wtViewport.getWorkspaceHeight(),n=t-e;return n>0?n:0},o.prototype.mainViewIsActive=function(){return this.wt===this.activeWt},o.prototype.destroy=function(){this.wt.destroy(),this.eventManager.destroy()}},{"3rdparty/walkontable/src/cell/coords":5,"3rdparty/walkontable/src/core":7,"3rdparty/walkontable/src/selection":18,eventManager:41,"helpers/dom/element":45,"helpers/dom/event":46}],98:[function(e,t,n){"use strict";Object.defineProperties(n,{GhostTable:{get:function(){return f}},__esModule:{value:!0}});var o,r,i,s,a,l=(o=e("helpers/dom/element"),o&&o.__esModule&&o||{"default":o}),u=l.addClass,c=l.outerHeight,d=l.outerWidth,h=(r=e("helpers/array"),r&&r.__esModule&&r||{"default":r}).arrayEach,f=((i=e("helpers/object"),i&&i.__esModule&&i||{"default":i}).objectEach,(s=e("helpers/number"),s&&s.__esModule&&s||{"default":s}).rangeEach,(a=e("helpers/mixed"),a&&a.__esModule&&a||{"default":a}).stringify,function(e){this.hot=e,this.container=null,this.injected=!1,this.rows=[],this.columns=[],this.samples=null});$traceurRuntime.createClass(f,{addRow:function(e,t){if(this.columns.length)throw new Error("Doesn't support multi-dimensional table");this.rows.length||(this.container=this.createContainer(this.hot.rootElement.className));var n={row:e};this.rows.push(n),this.samples=t,this.table=this.createTable(this.hot.table.className),this.table.colGroup.appendChild(this.createColGroupsCol()),this.table.tr.appendChild(this.createRow(e)),this.container.container.appendChild(this.table.fragment),n.table=this.table.table},addColumn:function(e,t){if(this.rows.length)throw new Error("Doesn't support multi-dimensional table");this.columns.length||(this.container=this.createContainer(this.hot.rootElement.className));var n={col:e};this.columns.push(n),this.samples=t,this.table=this.createTable(this.hot.table.className),null!==this.hot.getColHeader(e)&&this.hot.view.appendColHeader(e,this.table.th),this.table.tBody.appendChild(this.createCol(e)),this.container.container.appendChild(this.table.fragment),n.table=this.table.table},getHeights:function(e){this.injected||this.injectTable(),h(this.rows,function(t){e(t.row,c(t.table)-1)})},getWidths:function(e){this.injected||this.injectTable(),h(this.columns,function(t){e(t.col,d(t.table))})},createColGroupsCol:function(){var e=this,t=document,n=t.createDocumentFragment();return n.appendChild(this.createColElement(-1)),this.samples.forEach(function(t){h(t.strings,function(t){n.appendChild(e.createColElement(t.col))})}),n},createRow:function(e){var t=this,n=document,o=n.createDocumentFragment(),r=n.createElement("th");return null!==this.hot.getRowHeader(e)&&this.hot.view.appendRowHeader(e,r),o.appendChild(r),this.samples.forEach(function(r){h(r.strings,function(r){var i=r.col,s=t.hot.getCellMeta(e,i);s.col=i,s.row=e;var a=t.hot.getCellRenderer(s),l=n.createElement("td");a(t.hot,l,e,i,t.hot.colToProp(i),r.value,s),o.appendChild(l)})}),o},createCol:function(e){var t=this,n=document,o=n.createDocumentFragment();return this.samples.forEach(function(r){h(r.strings,function(r){var i=r.row,s=t.hot.getCellMeta(i,e);s.col=e,s.row=i;var a=t.hot.getCellRenderer(s),l=n.createElement("td"),u=n.createElement("tr");a(t.hot,l,i,e,t.hot.colToProp(i),r.value,s),u.appendChild(l),o.appendChild(u)})}),o},clean:function(){this.rows.length=0,this.columns.length=0,this.samples&&this.samples.clear(),this.samples=null,this.removeTable()},injectTable:function(){var e=void 0!==arguments[0]?arguments[0]:null;this.injected||((e||this.hot.rootElement).appendChild(this.container.fragment),this.injected=!0)},removeTable:function(){this.injected&&this.container.container.parentNode&&(this.container.container.parentNode.removeChild(this.container.container),this.container=null,this.injected=!1)},createColElement:function(e){var t=document,n=t.createElement("col");return n.style.width=this.hot.view.wt.wtTable.getStretchedColumnWidth(e)+"px",n},createTable:function(){var e=void 0!==arguments[0]?arguments[0]:"",t=document,n=t.createDocumentFragment(),o=t.createElement("table"),r=t.createElement("thead"),i=t.createElement("tbody"),s=t.createElement("colgroup"),a=t.createElement("tr"),l=t.createElement("th");return this.isVertical()&&o.appendChild(s),this.isHorizontal()&&(a.appendChild(l),r.appendChild(a),o.style.tableLayout="auto",o.style.width="auto"),o.appendChild(r),this.isVertical()&&i.appendChild(a),o.appendChild(i),u(o,e),n.appendChild(o),{fragment:n,table:o,tHead:r,tBody:i,colGroup:s,tr:a,th:l}},createContainer:function(){var e=void 0!==arguments[0]?arguments[0]:"",t=document,n=t.createDocumentFragment(),o=t.createElement("div");return e="htGhostTable htAutoSize "+e.trim(),u(o,e),n.appendChild(o),{fragment:n,container:o}},isVertical:function(){return this.rows.length&&!this.columns.length?!0:!1},isHorizontal:function(){return this.columns.length&&!this.rows.length?!0:!1}},{}),Handsontable.utils=Handsontable.utils||{},Handsontable.utils.GhostTable=f},{"helpers/array":42,"helpers/dom/element":45,"helpers/mixed":48,"helpers/number":49,"helpers/object":50}],99:[function(e,t,n){"use strict";var o;Object.defineProperties(n,{SamplesGenerator:{get:function(){return h}},__esModule:{value:!0}});var r,i,s,a,l,u=(r=e("helpers/dom/element"),r&&r.__esModule&&r||{"default":r}),c=(u.addClass,u.outerHeight,u.outerWidth,(i=e("helpers/array"),i&&i.__esModule&&i||{"default":i}).arrayEach,(s=e("helpers/object"),s&&s.__esModule&&s||{"default":s}).objectEach,(a=e("helpers/number"),a&&a.__esModule&&a||{"default":a}).rangeEach),d=(l=e("helpers/mixed"),l&&l.__esModule&&l||{"default":l}).stringify,h=function(e){this.samples=null,this.dataFactory=e},f=h;$traceurRuntime.createClass(h,(o={},Object.defineProperty(o,"generateRowSamples",{value:function(e,t){return this.generateSamples("row",t,e)},configurable:!0,enumerable:!0,writable:!0}),Object.defineProperty(o,"generateColumnSamples",{value:function(e,t){return this.generateSamples("col",t,e)},configurable:!0,enumerable:!0,writable:!0}),Object.defineProperty(o,"generateSamples",{value:function(e,t,n){var o=this,r=new Map;return"number"==typeof n&&(n={from:n,to:n}),c(n.from,n.to,function(n){var i=o.generateSample(e,t,n);r.set(n,i)}),r},configurable:!0,enumerable:!0,writable:!0}),Object.defineProperty(o,"generateSample",{value:function(e,t,n){var o=this,r=new Map;return c(t.from,t.to,function(t){var i,s;if("row"===e)s=o.dataFactory(n,t);else{if("col"!==e)throw new Error("Unsupported sample type");s=o.dataFactory(t,n)}Array.isArray(s)||(s=d(s));var a=s.length;r.has(a)||r.set(a,{needed:f.SAMPLE_COUNT,strings:[]});var l=r.get(a);if(l.needed){var u="row"===e?"col":"row";l.strings.push((i={},Object.defineProperty(i,"value",{value:s,configurable:!0,enumerable:!0,writable:!0}),Object.defineProperty(i,u,{value:t,configurable:!0,enumerable:!0,writable:!0}),i)),l.needed--}}),r},configurable:!0,enumerable:!0,writable:!0}),o),{get SAMPLE_COUNT(){return 3}}),Handsontable.utils=Handsontable.utils||{},Handsontable.utils.SamplesGenerator=h},{"helpers/array":42,"helpers/dom/element":45,"helpers/mixed":48,"helpers/number":49,"helpers/object":50}],100:[function(e,t,n){"use strict";function o(e,t){var n=e,o="string"==typeof n?n.toLowerCase():null;return function(e){for(var r=!1,s=0,a=e.length;a>s;s++){if(n===e[s]){r=!0;break}if(o===i(e[s]).toLowerCase()){r=!0;break}}t(r)}}var r,i=(r=e("helpers/mixed"),r&&r.__esModule&&r||{"default":r}).stringify;Handsontable.AutocompleteValidator=function(e,t){this.strict&&this.source?"function"==typeof this.source?this.source(e,o(e,t)):o(e,t)(this.source):t(!0)}},{"helpers/mixed":48}],101:[function(e,t,n){"use strict";var o,r,i=(o=e("moment"),o&&o.__esModule&&o||{"default":o})["default"],s=(r=e("editors"),r&&r.__esModule&&r||{"default":r}).getEditor;Handsontable.DateValidator=function(e,t){var n=!0,o=s("date",this.instance);null===e&&(e="");var r=i(new Date(e)).isValid(),l=i(e,this.dateFormat||o.defaultDateFormat,!0).isValid();if(r||(n=!1),!r&&l&&(n=!0),r&&!l)if(this.correctFormat===!0){var u=a(e,this.dateFormat);this.instance.setDataAtCell(this.row,this.col,u,"dateValidator"),n=!0}else n=!1;t(n)};var a=function(e,t){var n=i(new Date(e)),o=n.format("YYYY"),r=i().format("YYYY");return o.substr(0,2)!==r.substr(0,2)?e.match(new RegExp(o))||n.year(o.replace(o.substr(0,2),r.substr(0,2))):o.length>4&&n.year((n.year()+"").substr(0,4)),n.format(t)}},{editors:29,moment:"moment"}],102:[function(e,t,n){"use strict";Handsontable.NumericValidator=function(e,t){null===e&&(e=""),t(/^-?\d*(\.|\,)?\d*$/.test(e))}},{}],SheetClip:[function(e,t,n){"use strict";!function(e){function t(e){return e.split('"').length-1}var o={parse:function(e){var n,o,r,i,s,a,l,u=[],c=0;for(r=e.split("\n"),r.length>1&&""===r[r.length-1]&&r.pop(),n=0,o=r.length;o>n;n+=1){for(r[n]=r[n].split(" "),i=0,s=r[n].length;s>i;i+=1)u[c]||(u[c]=[]),a&&0===i?(l=u[c].length-1,u[c][l]=u[c][l]+"\n"+r[n][0],a&&1&t(r[n][0])&&(a=!1,u[c][l]=u[c][l].substring(0,u[c][l].length-1).replace(/""/g,'"'))):i===s-1&&0===r[n][i].indexOf('"')&&1&t(r[n][i])?(u[c].push(r[n][i].substring(1).replace(/""/g,'"')),a=!0):(u[c].push(r[n][i].replace(/""/g,'"')),a=!1);a||(c+=1)}return u},stringify:function(e){var t,n,o,r,i,s="";for(t=0,n=e.length;n>t;t+=1){for(r=e[t].length,o=0;r>o;o+=1)o>0&&(s+=" "),i=e[t][o],s+="string"==typeof i?i.indexOf("\n")>-1?'"'+i.replace(/"/g,'""')+'"':i:null===i||void 0===i?"":i;s+="\n"}return s}};"undefined"!=typeof n?(n.parse=o.parse,n.stringify=o.stringify):e.SheetClip=o}(window)},{}],autoResize:[function(e,t,n){"use strict";function o(){var e,t={minHeight:200,maxHeight:300,minWidth:100,maxWidth:300},n=document.body,o=document.createTextNode(""),r=document.createElement("SPAN"),i=function(e,t,n){window.attachEvent?e.attachEvent("on"+t,n):e.addEventListener(t,n,!1)},s=function(e,t,n){window.removeEventListener?e.removeEventListener(t,n,!1):e.detachEvent("on"+t,n)},a=function(i){var s,a;i?/^[a-zA-Z \.,\\\/\|0-9]$/.test(i)||(i="."):i="",void 0!==o.textContent?o.textContent=e.value+i:o.data=e.value+i,r.style.fontSize=Handsontable.Dom.getComputedStyle(e).fontSize,r.style.fontFamily=Handsontable.Dom.getComputedStyle(e).fontFamily,r.style.whiteSpace="pre",n.appendChild(r),s=r.clientWidth+2,n.removeChild(r),e.style.height=t.minHeight+"px",t.minWidth>s?e.style.width=t.minWidth+"px":s>t.maxWidth?e.style.width=t.maxWidth+"px":e.style.width=s+"px",a=e.scrollHeight?e.scrollHeight-1:0,t.minHeight>a?e.style.height=t.minHeight+"px":t.maxHeight-1||"true"===e.contentEditable}var n=this,o=!1;if(e.metaKey?o=!0:e.ctrlKey&&-1===navigator.userAgent.indexOf("Mac")&&(o=!0),o){if(document.activeElement!==this.elTextarea&&(""!==this.getSelectionText()||t()))return;this.selectNodeText(this.elTextarea),setTimeout(function(){document.activeElement!==n.elTextarea&&n.selectNodeText(n.elTextarea)},0)}!o||67!==e.keyCode&&86!==e.keyCode&&88!==e.keyCode||(88===e.keyCode?setTimeout(function(){n.triggerCut(e)},0):86===e.keyCode&&setTimeout(function(){n.triggerPaste(e)},0))},r.prototype.selectNodeText=function(e){e&&e.select()},r.prototype.getSelectionText=function(){var e="";return window.getSelection?e=window.getSelection().toString():document.selection&&"Control"!==document.selection.type&&(e=document.selection.createRange().text),e},r.prototype.copyable=function(e){if("string"!=typeof e&&void 0===e.toString)throw new Error("copyable requires string parameter");this.elTextarea.value=e,this.selectNodeText(this.elTextarea)},r.prototype.onCut=function(e){this.cutCallbacks.push(e)},r.prototype.onPaste=function(e){this.pasteCallbacks.push(e)},r.prototype.removeCallback=function(e){var t,n;for(t=0,n=this.copyCallbacks.length;n>t;t++)if(this.copyCallbacks[t]===e)return this.copyCallbacks.splice(t,1),!0;for(t=0,n=this.cutCallbacks.length;n>t;t++)if(this.cutCallbacks[t]===e)return this.cutCallbacks.splice(t,1), -!0;for(t=0,n=this.pasteCallbacks.length;n>t;t++)if(this.pasteCallbacks[t]===e)return this.pasteCallbacks.splice(t,1),!0;return!1},r.prototype.triggerCut=function(e){var t=this;t.cutCallbacks&&setTimeout(function(){for(var n=0,o=t.cutCallbacks.length;o>n;n++)t.cutCallbacks[n](e)},50)},r.prototype.triggerPaste=function(e,t){var n=this;n.pasteCallbacks&&setTimeout(function(){for(var o=t||n.elTextarea.value,r=0,i=n.pasteCallbacks.length;i>r;r++)n.pasteCallbacks[r](o,e)},50)},r.prototype.destroy=function(){this.hasBeenDestroyed()||0!==--this.refCounter||(this.elDiv&&this.elDiv.parentNode&&(this.elDiv.parentNode.removeChild(this.elDiv),this.elDiv=null,this.elTextarea=null),document.documentElement.removeEventListener("keydown",this.onKeyDownRef),this.onKeyDownRef=null)},r.prototype.hasBeenDestroyed=function(){return!this.refCounter}},{}],es6collections:[function(e,t,n){"use strict";!function(e){function t(e,t){function o(e){return this&&this.constructor===o?(this._keys=[],this._values=[],this._itp=[],this.objectOnly=t,void(e&&n.call(this,e))):new o(e)}return t||y(e,"size",{get:m}),e.constructor=o,o.prototype=e,o}function n(e){this.add?e.forEach(this.add,this):e.forEach(function(e){this.set(e[0],e[1])},this)}function o(e){return this.has(e)&&(this._keys.splice(w,1),this._values.splice(w,1),this._itp.forEach(function(e){w-1}function r(e){return this.has(e)?this._values[w]:void 0}function i(e,t){if(this.objectOnly&&t!==Object(t))throw new TypeError("Invalid value used as weak collection key");if(t!=t||0===t)for(w=e.length;w--&&!b(e[w],t););else w=e.indexOf(t);return w>-1}function s(e){return i.call(this,this._values,e)}function a(e){return i.call(this,this._keys,e)}function l(e,t){return this.has(e)?this._values[w]=t:this._values[this._keys.push(e)-1]=t,this}function u(e){return this.has(e)||this._values.push(e),this}function c(){this._values.length=0}function d(){return g(this._itp,this._keys)}function h(){return g(this._itp,this._values)}function f(){return g(this._itp,this._keys,this._values)}function p(){return g(this._itp,this._values,this._values)}function g(e,t,n){var o=[0],r=!1;return e.push(o),{next:function(){var i,s=o[0];return!r&&st;t++)if(w[t].obj===e)return w[t]}function i(e){for(var t=0,n=w.length;n>t;t++)w[t]===e&&w.splice(t,1)}function s(e,t){for(var n=0,o=e.observers.length;o>n;n++)if(e.observers[n].callback===t)return e.observers[n].observer}function a(e,t){for(var n=0,o=e.observers.length;o>n;n++)if(e.observers[n].observer===t)return e.observers.splice(n,1),void(e.observers.length||i(e))}function l(e,t){h(t),Object.observe?d(t,e):clearTimeout(t.next);var n=r(e);a(n,t)}function u(e,t){var n,i=[],a=e,l=r(e);if(l?n=s(l,t):(l=new y(e),w.push(l)),n)return n;if(Object.observe)n=function(r){d(n,e),c(n,e);for(var s=0,l=r.length;l>s;){if(("length"!==r[s].name||!R(r[s].object))&&"__Jasmine_been_here_before__"!==r[s].name){var u=r[s].type;switch(u){case"new":u="add";break;case"deleted":u="delete";break;case"updated":u="update"}v[u].call(r[s],i,o(a,r[s].object))}s++}i&&t&&t(i),n.patches=i,i=[]};else if(n={},l.value=JSON.parse(JSON.stringify(e)),t){n.callback=t,n.next=null;var u=this.intervals||[100,1e3,1e4,6e4],f=0,p=function(){h(n)},g=function(){clearTimeout(n.next),n.next=setTimeout(function(){p(),f=0,n.next=setTimeout(m,u[f++])},0)},m=function(){p(),f==u.length&&(f=u.length-1),n.next=setTimeout(m,u[f++])};"undefined"!=typeof window&&(window.addEventListener?(window.addEventListener("mousedown",g),window.addEventListener("mouseup",g),window.addEventListener("keydown",g)):(window.attachEvent("onmousedown",g),window.attachEvent("onmouseup",g),window.attachEvent("onkeydown",g))),n.next=setTimeout(m,u[f++])}return n.patches=i,n.object=e,l.observers.push(new b(t,n)),c(n,e)}function c(e,t){if(Object.observe){Object.observe(t,e);for(var n in t)if(t.hasOwnProperty(n)){var o=t[n];o&&"object"==typeof o&&c(e,o)}}return e}function d(e,t){if(Object.observe){Object.unobserve(t,e);for(var n in t)if(t.hasOwnProperty(n)){var o=t[n];o&&"object"==typeof o&&d(e,o)}}return e}function h(e){if(Object.observe)Object.deliverChangeRecords(e);else{for(var t,n=0,o=w.length;o>n;n++)if(w[n].obj===e.object){t=w[n];break}t&&f(t.value,e.object,e.patches,"")}var r=e.patches;return r.length>0&&(e.patches=[],e.callback&&e.callback(r)),r}function f(e,n,o,r){for(var i=C(n),s=C(e),a=!1,l=!1,u=s.length-1;u>=0;u--){var c=s[u],d=e[c];if(n.hasOwnProperty(c)){var h=n[c];d instanceof Object?f(d,h,o,r+"/"+t(c)):d!=h&&(a=!0,o.push({op:"replace",path:r+"/"+t(c),value:h}),e[c]=h)}else o.push({op:"remove",path:r+"/"+t(c)}),delete e[c],l=!0}if(l||i.length!=s.length)for(var u=0;ur;){n=t[r];for(var s=n.path.split("/"),a=e,l=1,u=s.length;;)if(R(a)){var c=parseInt(s[l],10);if(l++,l>=u){o=m[n.op].call(n,a,c,e);break}a=a[c]}else{var d=s[l];if(-1!=d.indexOf("~")&&(d=d.replace(/~1/g,"/").replace(/~0/g,"~")),l++,l>=u){o=g[n.op].call(n,a,d,e);break}a=a[d]}r++}return o}var g={add:function(e,t){return e[t]=this.value,!0},remove:function(e,t){return delete e[t],!0},replace:function(e,t){return e[t]=this.value,!0},move:function(e,t,n){var o={op:"_get",path:this.from};return p(n,[o]),p(n,[{op:"remove",path:this.from}]),p(n,[{op:"add",path:this.path,value:o.value}]),!0},copy:function(e,t,n){var o={op:"_get",path:this.from};return p(n,[o]),p(n,[{op:"add",path:this.path,value:o.value}]),!0},test:function(e,t){return JSON.stringify(e[t])===JSON.stringify(this.value)},_get:function(e,t){this.value=e[t]}},m={add:function(e,t){return e.splice(t,0,this.value),!0},remove:function(e,t){return e.splice(t,1),!0},replace:function(e,t){return e[t]=this.value,!0},move:g.move,copy:g.copy,test:g.test,_get:g._get},v={add:function(e,n){var o={op:"add",path:n+t(this.name),value:this.object[this.name]};e.push(o)},"delete":function(e,n){var o={op:"remove",path:n+t(this.name)};e.push(o)},update:function(e,n){var o={op:"replace",path:n+t(this.name),value:this.object[this.name]};e.push(o)}},w=[];e.intervals;var y=function(){function e(e){this.observers=[],this.obj=e}return e}(),b=function(){function e(e,t){this.callback=e,this.observer=t}return e}();e.unobserve=l,e.observe=u,e.generate=h;var C;C=Object.keys?Object.keys:function(e){var t=[];for(var n in e)e.hasOwnProperty(n)&&t.push(n);return t};var R;R=Array.isArray?Array.isArray:function(e){return e.push&&"number"==typeof e.length},e.apply=p}(o||(o={})),"undefined"!=typeof n&&(n.apply=o.apply,n.observe=o.observe,n.unobserve=o.unobserve,n.generate=o.generate)},{}],moment:[function(t,n,o){ +!function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var t;t="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this,t.Handsontable=e()}}(function(){var e;return function(e,t,n){return function o(e,t,n){function r(a,l){if(!t[a]){if(!e[a]){var u="function"==typeof require&&require;if(!l&&u)return u(a,!0);if(i)return i(a,!0);if(s[a]&&"undefined"!=typeof window[s[a]])return window[s[a]];var c=new Error("Cannot find module '"+a+"'");throw c.code="MODULE_NOT_FOUND",c}var d=t[a]={exports:{}};e[a][0].call(d.exports,function(t){var n=e[a][1][t];return r(n?n:t)},d,d.exports,o,e,t,n)}return t[a].exports}for(var i="function"==typeof require&&require,s=JSON.parse('{"zeroclipboard":"ZeroClipboard","moment":"moment","pikaday":"Pikaday"}')||{},a=0;a1)for(t=1,o=arguments.length;o>t;t++)r.push(arguments[t]);if(l){if("undefined"==typeof l[e])throw new Error("Handsontable do not provide action: "+e);i=l[e].apply(l,r),"destroy"===e&&a.removeData()}return i}}(window,jQuery,Handsontable)},{}],2:[function(e,t,n){"use strict";Object.defineProperties(n,{WalkontableBorder:{get:function(){return b}},__esModule:{value:!0}});var o,r,i,s,a,l=(o=e("helpers/dom/element"),o&&o.__esModule&&o||{"default":o}),u=l.getComputedStyle,c=l.getTrimmingContainer,d=l.innerWidth,h=l.innerHeight,f=l.offset,p=l.outerHeight,g=l.outerWidth,m=(r=e("helpers/dom/event"),r&&r.__esModule&&r||{"default":r}).stopImmediatePropagation,v=(i=e("eventManager"),i&&i.__esModule&&i||{"default":i}).EventManager,w=(s=e("cell/coords"),s&&s.__esModule&&s||{"default":s}).WalkontableCellCoords,y=(a=e("overlay/_base.js"),a&&a.__esModule&&a||{"default":a}).WalkontableOverlay,b=function(e,t){t&&(this.eventManager=new v(e),this.instance=e,this.wot=e,this.settings=t,this.mouseDown=!1,this.main=null,this.top=null,this.left=null,this.bottom=null,this.right=null,this.topStyle=null,this.leftStyle=null,this.bottomStyle=null,this.rightStyle=null,this.cornerDefaultStyle={width:"5px",height:"5px",borderWidth:"2px",borderStyle:"solid",borderColor:"#FFF"},this.corner=null,this.cornerStyle=null,this.createBorders(t),this.registerListeners())};$traceurRuntime.createClass(b,{registerListeners:function(){var e=this;this.eventManager.addEventListener(document.body,"mousedown",function(){return e.onMouseDown()}),this.eventManager.addEventListener(document.body,"mouseup",function(){return e.onMouseUp()});for(var t=this,n=function(n,o){t.eventManager.addEventListener(t.main.childNodes[n],"mouseenter",function(t){return e.onMouseEnter(t,e.main.childNodes[n])})},o=0,r=this.main.childNodes.length;r>o;o++)n(o,r)},onMouseDown:function(){this.mouseDown=!0},onMouseUp:function(){this.mouseDown=!1},onMouseEnter:function(e,t){function n(e){return e.clientYMath.ceil(i.top+i.height)?!0:e.clientXMath.ceil(i.left+i.width)?!0:void 0}function o(e){n(e)&&(r.eventManager.removeEventListener(document.body,"mousemove",o),t.style.display="block")}if(this.mouseDown&&this.wot.getSetting("hideBorderOnMouseDownOver")){e.preventDefault(),m(e);var r=this,i=t.getBoundingClientRect();t.style.display="none",this.eventManager.addEventListener(document.body,"mousemove",o)}},createBorders:function(e){this.main=document.createElement("div");var t=["top","left","bottom","right","corner"],n=this.main.style;n.position="absolute",n.top=0,n.left=0;for(var o=0;5>o;o++){var r=t[o],i=document.createElement("div");i.className="wtBorder "+(this.settings.className||""),this.settings[r]&&this.settings[r].hide&&(i.className+=" hidden"),n=i.style,n.backgroundColor=this.settings[r]&&this.settings[r].color?this.settings[r].color:e.border.color,n.height=this.settings[r]&&this.settings[r].width?this.settings[r].width+"px":e.border.width+"px",n.width=this.settings[r]&&this.settings[r].width?this.settings[r].width+"px":e.border.width+"px",this.main.appendChild(i)}this.top=this.main.childNodes[0],this.left=this.main.childNodes[1],this.bottom=this.main.childNodes[2],this.right=this.main.childNodes[3],this.topStyle=this.top.style,this.leftStyle=this.left.style,this.bottomStyle=this.bottom.style,this.rightStyle=this.right.style,this.corner=this.main.childNodes[4],this.corner.className+=" corner",this.cornerStyle=this.corner.style,this.cornerStyle.width=this.cornerDefaultStyle.width,this.cornerStyle.height=this.cornerDefaultStyle.height,this.cornerStyle.border=[this.cornerDefaultStyle.borderWidth,this.cornerDefaultStyle.borderStyle,this.cornerDefaultStyle.borderColor].join(" "),Handsontable.mobileBrowser&&this.createMultipleSelectorHandles(),this.disappear(),this.wot.wtTable.bordersHolder||(this.wot.wtTable.bordersHolder=document.createElement("div"),this.wot.wtTable.bordersHolder.className="htBorders",this.wot.wtTable.spreader.appendChild(this.wot.wtTable.bordersHolder)),this.wot.wtTable.bordersHolder.insertBefore(this.main,this.wot.wtTable.bordersHolder.firstChild)},createMultipleSelectorHandles:function(){this.selectionHandles={topLeft:document.createElement("DIV"),topLeftHitArea:document.createElement("DIV"),bottomRight:document.createElement("DIV"),bottomRightHitArea:document.createElement("DIV")};var e=10,t=40;this.selectionHandles.topLeft.className="topLeftSelectionHandle",this.selectionHandles.topLeftHitArea.className="topLeftSelectionHandle-HitArea",this.selectionHandles.bottomRight.className="bottomRightSelectionHandle",this.selectionHandles.bottomRightHitArea.className="bottomRightSelectionHandle-HitArea",this.selectionHandles.styles={topLeft:this.selectionHandles.topLeft.style,topLeftHitArea:this.selectionHandles.topLeftHitArea.style,bottomRight:this.selectionHandles.bottomRight.style,bottomRightHitArea:this.selectionHandles.bottomRightHitArea.style};var n={position:"absolute",height:t+"px",width:t+"px","border-radius":parseInt(t/1.5,10)+"px"};for(var o in n)n.hasOwnProperty(o)&&(this.selectionHandles.styles.bottomRightHitArea[o]=n[o],this.selectionHandles.styles.topLeftHitArea[o]=n[o]);var r={position:"absolute",height:e+"px",width:e+"px","border-radius":parseInt(e/1.5,10)+"px",background:"#F5F5FF",border:"1px solid #4285c8"};for(var i in r)r.hasOwnProperty(i)&&(this.selectionHandles.styles.bottomRight[i]=r[i],this.selectionHandles.styles.topLeft[i]=r[i]);this.main.appendChild(this.selectionHandles.topLeft),this.main.appendChild(this.selectionHandles.bottomRight),this.main.appendChild(this.selectionHandles.topLeftHitArea),this.main.appendChild(this.selectionHandles.bottomRightHitArea)},isPartRange:function(e,t){return!this.wot.selections.area.cellRange||e==this.wot.selections.area.cellRange.to.row&&t==this.wot.selections.area.cellRange.to.col?!1:!0},updateMultipleSelectionHandlesPosition:function(e,t,n,o,r,i){var s=parseInt(this.selectionHandles.styles.topLeft.width,10),a=parseInt(this.selectionHandles.styles.topLeftHitArea.width,10);this.selectionHandles.styles.topLeft.top=parseInt(n-s,10)+"px",this.selectionHandles.styles.topLeft.left=parseInt(o-s,10)+"px",this.selectionHandles.styles.topLeftHitArea.top=parseInt(n-a/4*3,10)+"px",this.selectionHandles.styles.topLeftHitArea.left=parseInt(o-a/4*3,10)+"px",this.selectionHandles.styles.bottomRight.top=parseInt(n+i,10)+"px",this.selectionHandles.styles.bottomRight.left=parseInt(o+r,10)+"px",this.selectionHandles.styles.bottomRightHitArea.top=parseInt(n+i-a/4,10)+"px",this.selectionHandles.styles.bottomRightHitArea.left=parseInt(o+r-a/4,10)+"px",this.settings.border.multipleSelectionHandlesVisible&&this.settings.border.multipleSelectionHandlesVisible()?(this.selectionHandles.styles.topLeft.display="block",this.selectionHandles.styles.topLeftHitArea.display="block",this.isPartRange(e,t)?(this.selectionHandles.styles.bottomRight.display="none",this.selectionHandles.styles.bottomRightHitArea.display="none"):(this.selectionHandles.styles.bottomRight.display="block",this.selectionHandles.styles.bottomRightHitArea.display="block")):(this.selectionHandles.styles.topLeft.display="none",this.selectionHandles.styles.bottomRight.display="none",this.selectionHandles.styles.topLeftHitArea.display="none",this.selectionHandles.styles.bottomRightHitArea.display="none"),e==this.wot.wtSettings.getSetting("fixedRowsTop")||t==this.wot.wtSettings.getSetting("fixedColumnsLeft")?(this.selectionHandles.styles.topLeft.zIndex="9999",this.selectionHandles.styles.topLeftHitArea.zIndex="9999"):(this.selectionHandles.styles.topLeft.zIndex="",this.selectionHandles.styles.topLeftHitArea.zIndex="")},appear:function(e){if(!this.disabled){var t,n,o,r,i,s,a,l,m,v,b,C,R,_,S,E,T,O,M;M=y.isOverlayTypeOf(this.wot.cloneOverlay,y.CLONE_TOP)||y.isOverlayTypeOf(this.wot.cloneOverlay,y.CLONE_TOP_LEFT_CORNER)?this.wot.getSetting("fixedRowsTop"):y.isOverlayTypeOf(this.wot.cloneOverlay,y.CLONE_BOTTOM)||y.isOverlayTypeOf(this.wot.cloneOverlay,y.CLONE_BOTTOM_LEFT_CORNER)?this.wot.getSetting("fixedRowsBottom"):this.wot.wtTable.getRenderedRowsCount();for(var k=0;M>k;k++){var H=this.wot.wtTable.rowFilter.renderedToSource(k);if(H>=e[0]&&H<=e[2]){R=H;break}}for(var D=M-1;D>=0;D--){var A=this.wot.wtTable.rowFilter.renderedToSource(D);if(A>=e[0]&&A<=e[2]){S=A;break}}M=this.wot.wtTable.getRenderedColumnsCount();for(var x=0;M>x;x++){var P=this.wot.wtTable.columnFilter.renderedToSource(x);if(P>=e[1]&&P<=e[3]){_=P;break}}for(var N=M-1;N>=0;N--){var L=this.wot.wtTable.columnFilter.renderedToSource(N);if(L>=e[1]&&L<=e[3]){E=L;break}}if(void 0===R||void 0===_)return void this.disappear();t=R!==S||_!==E,n=this.wot.wtTable.getCell(new w(R,_)),o=t?this.wot.wtTable.getCell(new w(S,E)):n,r=f(n),i=t?f(o):r,s=f(this.wot.wtTable.TABLE),l=r.top,b=i.top+p(o)-l,v=r.left,C=i.left+g(o)-v,a=l-s.top-1,m=v-s.left-1;var W=u(n);parseInt(W.borderTopWidth,10)>0&&(a+=1,b=b>0?b-1:0),parseInt(W.borderLeftWidth,10)>0&&(m+=1,C=C>0?C-1:0),this.topStyle.top=a+"px",this.topStyle.left=m+"px",this.topStyle.width=C+"px",this.topStyle.display="block",this.leftStyle.top=a+"px",this.leftStyle.left=m+"px",this.leftStyle.height=b+"px",this.leftStyle.display="block";var I=Math.floor(this.settings.border.width/2);this.bottomStyle.top=a+b-I+"px",this.bottomStyle.left=m+"px",this.bottomStyle.width=C+"px",this.bottomStyle.display="block",this.rightStyle.top=a+"px",this.rightStyle.left=m+C-I+"px",this.rightStyle.height=b+1+"px",this.rightStyle.display="block",Handsontable.mobileBrowser||!this.hasSetting(this.settings.border.cornerVisible)||this.isPartRange(S,E)?this.cornerStyle.display="none":(this.cornerStyle.top=a+b-4+"px",this.cornerStyle.left=m+C-4+"px",this.cornerStyle.borderRightWidth=this.cornerDefaultStyle.borderWidth,this.cornerStyle.width=this.cornerDefaultStyle.width,this.cornerStyle.display="block",T=c(this.wot.wtTable.TABLE),E===this.wot.getSetting("totalColumns")-1&&(O=o.offsetLeft+g(o)>=d(T),O&&(this.cornerStyle.left=Math.floor(m+C-3-parseInt(this.cornerDefaultStyle.width)/2)+"px",this.cornerStyle.borderRightWidth=0)),S===this.wot.getSetting("totalRows")-1&&(O=o.offsetTop+p(o)>=h(T),O&&(this.cornerStyle.top=Math.floor(a+b-3-parseInt(this.cornerDefaultStyle.height)/2)+"px",this.cornerStyle.borderBottomWidth=0))),Handsontable.mobileBrowser&&this.updateMultipleSelectionHandlesPosition(R,_,a,m,C,b)}},disappear:function(){this.topStyle.display="none",this.leftStyle.display="none",this.bottomStyle.display="none",this.rightStyle.display="none",this.cornerStyle.display="none",Handsontable.mobileBrowser&&(this.selectionHandles.styles.topLeft.display="none",this.selectionHandles.styles.bottomRight.display="none")},hasSetting:function(e){return"function"==typeof e?e():!!e}},{}),window.WalkontableBorder=b},{"cell/coords":5,eventManager:41,"helpers/dom/element":45,"helpers/dom/event":46,"overlay/_base.js":11}],3:[function(e,t,n){"use strict";Object.defineProperties(n,{WalkontableViewportColumnsCalculator:{get:function(){return r}},__esModule:{value:!0}});var o=new WeakMap,r=function(e,t,n,r,i,s,a){o.set(this,{viewportWidth:e,scrollOffset:t,totalColumns:n,columnWidthFn:r,overrideFn:i,onlyFullyVisible:s}),this.count=0,this.startColumn=null,this.endColumn=null,this.startPosition=null,this.stretchAllRatio=0,this.stretchLastWidth=0,this.stretch=a,this.totalTargetWidth=0,this.needVerifyLastColumnWidth=!0,this.stretchAllColumnsWidth=[],this.calculate()},i=r;$traceurRuntime.createClass(r,{calculate:function(){for(var e,t=0,n=!0,r=[],i=o.get(this),s=i.onlyFullyVisible,a=i.overrideFn,l=i.scrollOffset,u=i.totalColumns,c=i.viewportWidth,d=0;u>d;d++)if(e=this._getColumnWidth(d),l>=t&&!s&&(this.startColumn=d),t>=l&&l+c>=t+e&&(null==this.startColumn&&(this.startColumn=d),this.endColumn=d),r.push(t),t+=e,s||(this.endColumn=d),t>=l+c){n=!1;break}if(this.endColumn===u-1&&n)for(this.startColumn=this.endColumn;this.startColumn>0;){var h=r[this.endColumn]+e-r[this.startColumn-1];if((c>=h||!s)&&this.startColumn--,h>c)break}null!==this.startColumn&&a&&a(this),this.startPosition=r[this.startColumn],void 0==this.startPosition&&(this.startPosition=null),null!==this.startColumn&&(this.count=this.endColumn-this.startColumn+1)},refreshStretching:function(e){if("none"!==this.stretch){for(var t,n,r=0,i=o.get(this),s=i.totalColumns,a=0;s>a;a++)t=this._getColumnWidth(a),r+=t;this.totalTargetWidth=e,n=r-e,"all"===this.stretch&&0>n?(this.stretchAllRatio=e/r,this.stretchAllColumnsWidth=[],this.needVerifyLastColumnWidth=!0):"last"===this.stretch&&e!==1/0&&(this.stretchLastWidth=-n+this._getColumnWidth(s-1))}},getStretchedColumnWidth:function(e,t){var n=null;return"all"===this.stretch&&0!==this.stretchAllRatio?n=this._getStretchedAllColumnWidth(e,t):"last"===this.stretch&&0!==this.stretchLastWidth&&(n=this._getStretchedLastColumnWidth(e)),n},_getStretchedAllColumnWidth:function(e,t){var n=0,r=o.get(this),i=r.totalColumns;if(this.stretchAllColumnsWidth[e]||(this.stretchAllColumnsWidth[e]=Math.round(t*this.stretchAllRatio)),this.stretchAllColumnsWidth.length===i&&this.needVerifyLastColumnWidth){this.needVerifyLastColumnWidth=!1;for(var s=0;sf;f++){var p=l(f);if(void 0===p&&(p=i.DEFAULT_HEIGHT),u>=e&&!s&&(this.startRow=f),e>=u&&u+d-h>=e+p&&(null===this.startRow&&(this.startRow=f),this.endRow=f),n.push(e),e+=p,s||(this.endRow=f),e>=u+d-h){t=!1;break}}if(this.endRow===c-1&&t)for(this.startRow=this.endRow;this.startRow>0;){var g=n[this.endRow]+p-n[this.startRow-1];if((d-h>=g||!s)&&this.startRow--,g>=d-h)break}null!==this.startRow&&a&&a(this),this.startPosition=n[this.startRow],void 0==this.startPosition&&(this.startPosition=null),null!==this.startRow&&(this.count=this.endRow-this.startRow+1)}},{get DEFAULT_HEIGHT(){return 23}}),window.WalkontableViewportRowsCalculator=r},{}],5:[function(e,t,n){"use strict";Object.defineProperties(n,{WalkontableCellCoords:{get:function(){return o}},__esModule:{value:!0}});var o=function(e,t){"undefined"!=typeof e&&"undefined"!=typeof t?(this.row=e,this.col=t):(this.row=null,this.col=null)};$traceurRuntime.createClass(o,{isValid:function(e){return this.row<0||this.col<0?!1:this.row>=e.getSetting("totalRows")||this.col>=e.getSetting("totalColumns")?!1:!0},isEqual:function(e){return e===this?!0:this.row===e.row&&this.col===e.col},isSouthEastOf:function(e){return this.row>=e.row&&this.col>=e.col},isNorthWestOf:function(e){return this.row<=e.row&&this.col<=e.col},isSouthWestOf:function(e){return this.row>=e.row&&this.col<=e.col},isNorthEastOf:function(e){return this.row<=e.row&&this.col>=e.col}},{}),window.WalkontableCellCoords=o},{}],6:[function(e,t,n){"use strict";Object.defineProperties(n,{WalkontableCellRange:{get:function(){return i}},__esModule:{value:!0}});var o,r=(o=e("cell/coords"),o&&o.__esModule&&o||{"default":o}).WalkontableCellCoords,i=function(e,t,n){this.highlight=e,this.from=t,this.to=n},s=i;$traceurRuntime.createClass(i,{isValid:function(e){return this.from.isValid(e)&&this.to.isValid(e)},isSingle:function(){return this.from.row===this.to.row&&this.from.col===this.to.col},getHeight:function(){return Math.max(this.from.row,this.to.row)-Math.min(this.from.row,this.to.row)+1},getWidth:function(){return Math.max(this.from.col,this.to.col)-Math.min(this.from.col,this.to.col)+1},includes:function(e){var t=this.getTopLeftCorner(),n=this.getBottomRightCorner();return e.row<0&&(e.row=0),e.col<0&&(e.col=0),t.row<=e.row&&n.row>=e.row&&t.col<=e.col&&n.col>=e.col},includesRange:function(e){return this.includes(e.getTopLeftCorner())&&this.includes(e.getBottomRightCorner())},isEqual:function(e){return Math.min(this.from.row,this.to.row)==Math.min(e.from.row,e.to.row)&&Math.max(this.from.row,this.to.row)==Math.max(e.from.row,e.to.row)&&Math.min(this.from.col,this.to.col)==Math.min(e.from.col,e.to.col)&&Math.max(this.from.col,this.to.col)==Math.max(e.from.col,e.to.col)},overlaps:function(e){return e.isSouthEastOf(this.getTopLeftCorner())&&e.isNorthWestOf(this.getBottomRightCorner())},isSouthEastOf:function(e){return this.getTopLeftCorner().isSouthEastOf(e)||this.getBottomRightCorner().isSouthEastOf(e)},isNorthWestOf:function(e){return this.getTopLeftCorner().isNorthWestOf(e)||this.getBottomRightCorner().isNorthWestOf(e)},expand:function(e){var t=this.getTopLeftCorner(),n=this.getBottomRightCorner();return e.rown.row||e.col>n.col?(this.from=new r(Math.min(t.row,e.row),Math.min(t.col,e.col)),this.to=new r(Math.max(n.row,e.row),Math.max(n.col,e.col)),!0):!1},expandByRange:function(e){if(this.includesRange(e)||!this.overlaps(e))return!1;var t=this.getTopLeftCorner(),n=this.getBottomRightCorner(),o=(this.getTopRightCorner(),this.getBottomLeftCorner(),e.getTopLeftCorner()),i=e.getBottomRightCorner(),a=Math.min(t.row,o.row),l=Math.min(t.col,o.col),u=Math.max(n.row,i.row),c=Math.max(n.col,i.col),d=new r(a,l),h=new r(u,c),f=new s(d,d,h).isCorner(this.from,e),p=e.isEqual(new s(d,d,h));return f&&!p&&(this.from.col>d.col&&(d.col=c,h.col=l),this.from.row>d.row&&(d.row=u,h.row=a)),this.from=d,this.to=h,!0},getDirection:function(){return this.from.isNorthWestOf(this.to)?"NW-SE":this.from.isNorthEastOf(this.to)?"NE-SW":this.from.isSouthEastOf(this.to)?"SE-NW":this.from.isSouthWestOf(this.to)?"SW-NE":void 0},setDirection:function(e){switch(e){case"NW-SE":this.from=this.getTopLeftCorner(),this.to=this.getBottomRightCorner();break;case"NE-SW":this.from=this.getTopRightCorner(),this.to=this.getBottomLeftCorner();break;case"SE-NW":this.from=this.getBottomRightCorner(),this.to=this.getTopLeftCorner();break;case"SW-NE":this.from=this.getBottomLeftCorner(),this.to=this.getTopRightCorner()}},getTopLeftCorner:function(){return new r(Math.min(this.from.row,this.to.row),Math.min(this.from.col,this.to.col))},getBottomRightCorner:function(){return new r(Math.max(this.from.row,this.to.row),Math.max(this.from.col,this.to.col))},getTopRightCorner:function(){return new r(Math.min(this.from.row,this.to.row),Math.max(this.from.col,this.to.col))},getBottomLeftCorner:function(){return new r(Math.max(this.from.row,this.to.row),Math.min(this.from.col,this.to.col))},isCorner:function(e,t){return t&&t.includes(e)&&(this.getTopLeftCorner().isEqual(new r(t.from.row,t.from.col))||this.getTopRightCorner().isEqual(new r(t.from.row,t.to.col))||this.getBottomLeftCorner().isEqual(new r(t.to.row,t.from.col))||this.getBottomRightCorner().isEqual(new r(t.to.row,t.to.col)))?!0:e.isEqual(this.getTopLeftCorner())||e.isEqual(this.getTopRightCorner())||e.isEqual(this.getBottomLeftCorner())||e.isEqual(this.getBottomRightCorner())},getOppositeCorner:function(e,t){if(!(e instanceof r))return!1;if(t&&t.includes(e)){if(this.getTopLeftCorner().isEqual(new r(t.from.row,t.from.col)))return this.getBottomRightCorner();if(this.getTopRightCorner().isEqual(new r(t.from.row,t.to.col)))return this.getBottomLeftCorner();if(this.getBottomLeftCorner().isEqual(new r(t.to.row,t.from.col)))return this.getTopRightCorner();if(this.getBottomRightCorner().isEqual(new r(t.to.row,t.to.col)))return this.getTopLeftCorner()}return e.isEqual(this.getBottomRightCorner())?this.getTopLeftCorner():e.isEqual(this.getTopLeftCorner())?this.getBottomRightCorner():e.isEqual(this.getTopRightCorner())?this.getBottomLeftCorner():e.isEqual(this.getBottomLeftCorner())?this.getTopRightCorner():void 0},getBordersSharedWith:function(e){if(!this.includesRange(e))return[];var t={top:Math.min(this.from.row,this.to.row),bottom:Math.max(this.from.row,this.to.row),left:Math.min(this.from.col,this.to.col),right:Math.max(this.from.col,this.to.col)},n={top:Math.min(e.from.row,e.to.row),bottom:Math.max(e.from.row,e.to.row),left:Math.min(e.from.col,e.to.col),right:Math.max(e.from.col,e.to.col)},o=[];return t.top==n.top&&o.push("top"),t.right==n.right&&o.push("right"),t.bottom==n.bottom&&o.push("bottom"),t.left==n.left&&o.push("left"),o},getInner:function(){for(var e=this.getTopLeftCorner(),t=this.getBottomRightCorner(),n=[],o=e.row;o<=t.row;o++)for(var i=e.col;i<=t.col;i++)this.from.row===o&&this.from.col===i||this.to.row===o&&this.to.col===i||n.push(new r(o,i));return n},getAll:function(){for(var e=this.getTopLeftCorner(),t=this.getBottomRightCorner(),n=[],o=e.row;o<=t.row;o++)for(var i=e.col;i<=t.col;i++)e.row===o&&e.col===i?n.push(e):t.row===o&&t.col===i?n.push(t):n.push(new r(o,i));return n},forAll:function(e){for(var t=this.getTopLeftCorner(),n=this.getBottomRightCorner(),o=t.row;o<=n.row;o++)for(var r=t.col;r<=n.col;r++){var i=e(o,r);if(i===!1)return}}},{}),window.WalkontableCellRange=i},{"cell/coords":5}],7:[function(e,t,n){"use strict";Object.defineProperties(n,{Walkontable:{get:function(){return A}},__esModule:{value:!0}});var o,r,i,s,a,l,u,c,d,h,f,p,g,m,v=(o=e("helpers/dom/element"),o&&o.__esModule&&o||{"default":o}),w=v.addClass,y=v.fastInnerText,b=v.isVisible,C=v.removeClass,R=(r=e("helpers/object"),r&&r.__esModule&&r||{"default":r}).objectEach,_=(i=e("helpers/string"),i&&i.__esModule&&i||{"default":i}),S=_.toUpperCaseFirst,E=_.randomString,T=(s=e("event"),s&&s.__esModule&&s||{"default":s}).WalkontableEvent,O=(a=e("overlays"),a&&a.__esModule&&a||{"default":a}).WalkontableOverlays,M=(l=e("scroll"),l&&l.__esModule&&l||{"default":l}).WalkontableScroll,k=(u=e("settings"),u&&u.__esModule&&u||{"default":u}).WalkontableSettings,H=(c=e("table"),c&&c.__esModule&&c||{"default":c}).WalkontableTable,D=(d=e("viewport"),d&&d.__esModule&&d||{"default":d}).WalkontableViewport,A=((h=e("overlay/_base.js"),h&&h.__esModule&&h||{"default":h}).WalkontableOverlay,(f=e("overlay/top.js"),f&&f.__esModule&&f||{"default":f}).WalkontableTopOverlay,(p=e("overlay/left.js"),p&&p.__esModule&&p||{"default":p}).WalkontableLeftOverlay,(g=e("overlay/debug.js"),g&&g.__esModule&&g||{"default":g}).WalkontableDebugOverlay,(m=e("overlay/topLeftCorner.js"),m&&m.__esModule&&m||{"default":m}).WalkontableTopLeftCornerOverlay,function(e){var t=[];if(this.guid="wt_"+E(),e.cloneSource?(this.cloneSource=e.cloneSource,this.cloneOverlay=e.cloneOverlay,this.wtSettings=e.cloneSource.wtSettings,this.wtTable=new H(this,e.table,e.wtRootElement),this.wtScroll=new M(this),this.wtViewport=e.cloneSource.wtViewport,this.wtEvent=new T(this),this.selections=this.cloneSource.selections):(this.wtSettings=new k(this,e),this.wtTable=new H(this,e.table),this.wtScroll=new M(this),this.wtViewport=new D(this),this.wtEvent=new T(this),this.selections=this.getSetting("selections"),this.wtOverlays=new O(this),this.exportSettingsAsClassNames()),this.wtTable.THEAD.childNodes.length&&this.wtTable.THEAD.childNodes[0].childNodes.length){for(var n=0,o=this.wtTable.THEAD.childNodes[0].childNodes.length;o>n;n++)t.push(this.wtTable.THEAD.childNodes[0].childNodes[n].innerHTML);this.getSetting("columnHeaders").length||this.update("columnHeaders",[function(e,n){y(n,t[e])}])}this.drawn=!1,this.drawInterrupted=!1});$traceurRuntime.createClass(A,{draw:function(){var e=void 0!==arguments[0]?arguments[0]:!1;return this.drawInterrupted=!1,e||b(this.wtTable.TABLE)?this.wtTable.draw(e):this.drawInterrupted=!0,this},getCell:function(e){var t=void 0!==arguments[1]?arguments[1]:!1;if(!t)return this.wtTable.getCell(e);var n=this.wtSettings.getSetting("totalRows"),o=this.wtSettings.getSetting("fixedRowsTop"),r=this.wtSettings.getSetting("fixedRowsBottom"),i=this.wtSettings.getSetting("fixedColumnsLeft");if(e.row=n-r){if(this.wtOverlays.bottomLeftCornerOverlay.clone)return this.wtOverlays.bottomLeftCornerOverlay.clone.wtTable.getCell(e)}else{if(e.coln-r&&this.wtOverlays.bottomOverlay.clone)return this.wtOverlays.bottomOverlay.clone.wtTable.getCell(e)}return this.wtTable.getCell(e)},update:function(e,t){return this.wtSettings.update(e,t)},scrollVertical:function(e){return this.wtOverlays.topOverlay.scrollTo(e),this.getSetting("onScrollVertically"),this},scrollHorizontal:function(e){return this.wtOverlays.leftOverlay.scrollTo(e),this.getSetting("onScrollHorizontally"),this},scrollViewport:function(e){return this.wtScroll.scrollViewport(e),this},getViewport:function(){return[this.wtTable.getFirstVisibleRow(),this.wtTable.getFirstVisibleColumn(),this.wtTable.getLastVisibleRow(),this.wtTable.getLastVisibleColumn()]},getOverlayName:function(){return this.cloneOverlay?this.cloneOverlay.type:"master"},exportSettingsAsClassNames:function(){var e=this,t={rowHeaders:["array"],columnHeaders:["array"]},n=[],o=[];R(t,function(t,r){t.indexOf("array")>-1&&e.getSetting(r).length&&o.push("ht"+S(r)),n.push("ht"+S(r))}),C(this.wtTable.wtRootElement.parentNode,n),w(this.wtTable.wtRootElement.parentNode,o)},getSetting:function(e,t,n,o,r){return this.wtSettings.getSetting(e,t,n,o,r)},hasSetting:function(e){return this.wtSettings.has(e)},destroy:function(){this.wtOverlays.destroy(),this.wtEvent.destroy()}},{}),window.Walkontable=A},{event:8,"helpers/dom/element":45,"helpers/object":50,"helpers/string":52,"overlay/_base.js":11,"overlay/debug.js":12,"overlay/left.js":13,"overlay/top.js":14,"overlay/topLeftCorner.js":15,overlays:16,scroll:17,settings:19,table:20,viewport:22}],8:[function(e,t,n){"use strict";function o(e){var t=this,n=c(e);this.instance=e;var o=[null,null];this.dblClickTimeout=[null,null];var r,i,s=function(e){var n=t.parentCell(e.realTarget);l(e.realTarget,"corner")?t.instance.getSetting("onCellCornerMouseDown",e,e.realTarget):n.TD&&t.instance.hasSetting("onCellMouseDown")&&t.instance.getSetting("onCellMouseDown",e,n.coords,n.TD,t.instance),2!==e.button&&n.TD&&(o[0]=n.TD,clearTimeout(t.dblClickTimeout[0]),t.dblClickTimeout[0]=setTimeout(function(){o[0]=null},1e3))},d=function(e){t.instance.touchMoving=!0},h=function(e){n.addEventListener(this,"touchmove",d),t.checkIfTouchMove=setTimeout(function(){return t.instance.touchMoving===!0?(t.instance.touchMoving=void 0,void n.removeEventListener("touchmove",d,!1)):void s(e)},30)},f=function(e){var n,o;t.instance.hasSetting("onCellMouseOver")&&(n=t.instance.wtTable.TABLE,o=a(e.realTarget,["TD","TH"],n),o&&o!==i&&u(o,n)&&(i=o,t.instance.getSetting("onCellMouseOver",e,t.instance.wtTable.getCoords(o),o,t.instance)))},p=function(e){if(2!==e.button){var n=t.parentCell(e.realTarget);n.TD===o[0]&&n.TD===o[1]?(l(e.realTarget,"corner")?t.instance.getSetting("onCellCornerDblClick",e,n.coords,n.TD,t.instance):t.instance.getSetting("onCellDblClick",e,n.coords,n.TD,t.instance),o[0]=null,o[1]=null):n.TD===o[0]&&(o[1]=n.TD,clearTimeout(t.dblClickTimeout[1]),t.dblClickTimeout[1]=setTimeout(function(){o[1]=null},500))}},g=function(e){clearTimeout(r),e.preventDefault(),p(e)};if(n.addEventListener(this.instance.wtTable.holder,"mousedown",s),n.addEventListener(this.instance.wtTable.TABLE,"mouseover",f),n.addEventListener(this.instance.wtTable.holder,"mouseup",p),this.instance.wtTable.holder.parentNode.parentNode&&Handsontable.mobileBrowser&&!t.instance.wtTable.isWorkingOnClone()){var m="."+this.instance.wtTable.holder.parentNode.className.split(" ").join(".");n.addEventListener(this.instance.wtTable.holder,"touchstart",function(e){t.instance.touchApplied=!0,u(e.target,m)&&h.call(e.target,e)}),n.addEventListener(this.instance.wtTable.holder,"touchend",function(e){t.instance.touchApplied=!1,u(e.target,m)&&g.call(e.target,e)}),t.instance.momentumScrolling||(t.instance.momentumScrolling={}),n.addEventListener(this.instance.wtTable.holder,"scroll",function(e){clearTimeout(t.instance.momentumScrolling._timeout),t.instance.momentumScrolling.ongoing||t.instance.getSetting("onBeforeTouchScroll"),t.instance.momentumScrolling.ongoing=!0,t.instance.momentumScrolling._timeout=setTimeout(function(){t.instance.touchApplied||(t.instance.momentumScrolling.ongoing=!1,t.instance.getSetting("onAfterMomentumScroll"))},200)})}n.addEventListener(window,"resize",function(){"none"!==t.instance.getSetting("stretchH")&&t.instance.draw()}),this.destroy=function(){clearTimeout(this.dblClickTimeout[0]),clearTimeout(this.dblClickTimeout[1]),n.destroy()}}Object.defineProperties(n,{WalkontableEvent:{get:function(){return o}},__esModule:{value:!0}});var r,i,s=(r=e("helpers/dom/element"),r&&r.__esModule&&r||{"default":r}),a=s.closest,l=s.hasClass,u=s.isChildOf,c=(i=e("eventManager"),i&&i.__esModule&&i||{"default":i}).eventManager;o.prototype.parentCell=function(e){var t={},n=this.instance.wtTable.TABLE,o=a(e,["TD","TH"],n);return o&&u(o,n)?(t.coords=this.instance.wtTable.getCoords(o),t.TD=o):l(e,"wtBorder")&&l(e,"current")?(t.coords=this.instance.selections.current.cellRange.highlight,t.TD=this.instance.wtTable.getCell(t.coords)):l(e,"wtBorder")&&l(e,"area")&&this.instance.selections.area.cellRange&&(t.coords=this.instance.selections.area.cellRange.to,t.TD=this.instance.wtTable.getCell(t.coords)),t},window.WalkontableEvent=o},{eventManager:41,"helpers/dom/element":45}],9:[function(e,t,n){"use strict";Object.defineProperties(n,{WalkontableColumnFilter:{get:function(){return o}},__esModule:{value:!0}});var o=function(e,t,n){this.offset=e,this.total=t,this.countTH=n};$traceurRuntime.createClass(o,{offsetted:function(e){return e+this.offset},unOffsetted:function(e){return e-this.offset},renderedToSource:function(e){return this.offsetted(e)},sourceToRendered:function(e){return this.unOffsetted(e)},offsettedTH:function(e){return e-this.countTH},unOffsettedTH:function(e){return e+this.countTH},visibleRowHeadedColumnToSourceColumn:function(e){return this.renderedToSource(this.offsettedTH(e))},sourceColumnToVisibleRowHeadedColumn:function(e){return this.unOffsettedTH(this.sourceToRendered(e))}},{}),window.WalkontableColumnFilter=o; +},{}],10:[function(e,t,n){"use strict";Object.defineProperties(n,{WalkontableRowFilter:{get:function(){return o}},__esModule:{value:!0}});var o=function(e,t,n){this.offset=e,this.total=t,this.countTH=n};$traceurRuntime.createClass(o,{offsetted:function(e){return e+this.offset},unOffsetted:function(e){return e-this.offset},renderedToSource:function(e){return this.offsetted(e)},sourceToRendered:function(e){return this.unOffsetted(e)},offsettedTH:function(e){return e-this.countTH},unOffsettedTH:function(e){return e+this.countTH},visibleColHeadedRowToSourceRow:function(e){return this.renderedToSource(this.offsettedTH(e))},sourceRowToVisibleColHeadedRow:function(e){return this.unOffsettedTH(this.sourceToRendered(e))}},{}),window.WalkontableRowFilter=o},{}],11:[function(e,t,n){"use strict";Object.defineProperties(n,{WalkontableOverlay:{get:function(){return h}},__esModule:{value:!0}});var o,r,i,s=(o=e("helpers/dom/element"),o&&o.__esModule&&o||{"default":o}),a=s.getScrollableElement,l=s.getTrimmingContainer,u=(r=e("helpers/object"),r&&r.__esModule&&r||{"default":r}).defineGetter,c=(i=e("eventManager"),i&&i.__esModule&&i||{"default":i}).eventManager,d={},h=function(e){u(this,"wot",e,{writable:!1}),this.instance=this.wot,this.type="",this.TABLE=this.wot.wtTable.TABLE,this.hider=this.wot.wtTable.hider,this.spreader=this.wot.wtTable.spreader,this.holder=this.wot.wtTable.holder,this.wtRootElement=this.wot.wtTable.wtRootElement,this.trimmingContainer=l(this.hider.parentNode.parentNode),this.mainTableScrollableElement=a(this.wot.wtTable.TABLE),this.needFullRender=this.shouldBeRendered(),this.areElementSizesAdjusted=!1},f=h;$traceurRuntime.createClass(h,{shouldBeRendered:function(){return!0},makeClone:function(e){if(-1===f.CLONE_TYPES.indexOf(e))throw new Error('Clone type "'+e+'" is not supported.');var t=document.createElement("DIV"),n=document.createElement("TABLE");return t.className="ht_clone_"+e+" handsontable",t.style.position="absolute",t.style.top=0,t.style.left=0,t.style.overflow="hidden",n.className=this.wot.wtTable.TABLE.className,t.appendChild(n),this.type=e,this.wot.wtTable.wtRootElement.parentNode.appendChild(t),new Walkontable({cloneSource:this.wot,cloneOverlay:this,table:n})},refresh:function(){var e=void 0!==arguments[0]?arguments[0]:!1,t=this.shouldBeRendered();this.clone&&(this.needFullRender||t)&&this.clone.draw(e),this.needFullRender=t},destroy:function(){c(this.clone).destroy()}},{get CLONE_TOP(){return"top"},get CLONE_BOTTOM(){return"bottom"},get CLONE_LEFT(){return"left"},get CLONE_TOP_LEFT_CORNER(){return"top_left_corner"},get CLONE_BOTTOM_LEFT_CORNER(){return"bottom_left_corner"},get CLONE_DEBUG(){return"debug"},get CLONE_TYPES(){return[f.CLONE_TOP,f.CLONE_BOTTOM,f.CLONE_LEFT,f.CLONE_TOP_LEFT_CORNER,f.CLONE_BOTTOM_LEFT_CORNER,f.CLONE_DEBUG]},registerOverlay:function(e,t){if(-1===f.CLONE_TYPES.indexOf(e))throw new Error("Unsupported overlay ("+e+").");d[e]=t},createOverlay:function(e,t){return new d[e](t)},isOverlayTypeOf:function(e,t){return e&&d[t]?e instanceof d[t]:!1}}),window.WalkontableOverlay=h},{eventManager:41,"helpers/dom/element":45,"helpers/object":50}],12:[function(e,t,n){"use strict";Object.defineProperties(n,{WalkontableDebugOverlay:{get:function(){return a}},__esModule:{value:!0}});var o,r,i=(o=e("helpers/dom/element"),o&&o.__esModule&&o||{"default":o}).addClass,s=(r=e("_base"),r&&r.__esModule&&r||{"default":r}).WalkontableOverlay,a=function(e){$traceurRuntime.superConstructor(l).call(this,e),this.clone=this.makeClone(s.CLONE_DEBUG),this.clone.wtTable.holder.style.opacity=.4,this.clone.wtTable.holder.style.textShadow="0 0 2px #ff0000",i(this.clone.wtTable.holder.parentNode,"wtDebugVisible")},l=a;$traceurRuntime.createClass(a,{},{},s),window.WalkontableDebugOverlay=a,s.registerOverlay(s.CLONE_DEBUG,a)},{_base:11,"helpers/dom/element":45}],13:[function(e,t,n){"use strict";Object.defineProperties(n,{WalkontableLeftOverlay:{get:function(){return g}},__esModule:{value:!0}});var o,r,i=(o=e("helpers/dom/element"),o&&o.__esModule&&o||{"default":o}),s=i.addClass,a=i.getScrollbarWidth,l=i.getScrollLeft,u=i.getWindowScrollTop,c=i.hasClass,d=i.outerWidth,h=i.removeClass,f=i.setOverlayPosition,p=(r=e("_base"),r&&r.__esModule&&r||{"default":r}).WalkontableOverlay,g=function(e){$traceurRuntime.superConstructor(m).call(this,e),this.clone=this.makeClone(p.CLONE_LEFT)},m=g;$traceurRuntime.createClass(g,{shouldBeRendered:function(){return this.wot.getSetting("fixedColumnsLeft")||this.wot.getSetting("rowHeaders").length?!0:!1},resetFixedPosition:function(){if(this.needFullRender&&this.wot.wtTable.holder.parentNode){var e=this.clone.wtTable.holder.parentNode,t=0;if(this.trimmingContainer===window){var n,o,r=this.wot.wtTable.hider.getBoundingClientRect(),i=Math.ceil(r.left),s=Math.ceil(r.right);o=this.wot.wtTable.hider.style.top,o=""===o?0:o,n=0>i&&s-e.offsetWidth>0?-i:0,t=n,n+="px",f(e,n,o)}else t=this.getScrollPosition();this.adjustHeaderBordersPosition(t),this.adjustElementsSize()}},setScrollPosition:function(e){this.mainTableScrollableElement===window?window.scrollTo(e,u()):this.mainTableScrollableElement.scrollLeft=e},onScroll:function(){this.wot.getSetting("onScrollVertically")},sumCellSizes:function(e,t){for(var n=0,o=this.wot.wtSettings.defaultColumnWidth;t>e;)n+=this.wot.wtTable.getStretchedColumnWidth(e)||o,e++;return n},adjustElementsSize:function(){var e=void 0!==arguments[0]?arguments[0]:!1;(this.needFullRender||e)&&(this.adjustRootElementSize(),this.adjustRootChildrenSize(),e||(this.areElementSizesAdjusted=!0))},adjustRootElementSize:function(){var e,t=this.wot.wtTable.holder,n=t.clientHeight===t.offsetHeight?0:a(),o=this.clone.wtTable.holder.parentNode,r=o.style;this.trimmingContainer!==window&&(r.height=this.wot.wtViewport.getWorkspaceHeight()-n+"px"),this.clone.wtTable.holder.style.height=r.height,e=d(this.clone.wtTable.TABLE),r.width=(0===e?e:e+4)+"px"},adjustRootChildrenSize:function(){var e=a();this.clone.wtTable.hider.style.height=this.hider.style.height,this.clone.wtTable.holder.style.height=this.clone.wtTable.holder.parentNode.style.height,0===e&&(e=30),this.clone.wtTable.holder.style.width=parseInt(this.clone.wtTable.holder.parentNode.style.width,10)+e+"px"},applyToDOM:function(){var e=this.wot.getSetting("totalColumns");if(this.areElementSizesAdjusted||this.adjustElementsSize(),"number"==typeof this.wot.wtViewport.columnsRenderCalculator.startPosition)this.spreader.style.left=this.wot.wtViewport.columnsRenderCalculator.startPosition+"px";else{if(0!==e)throw new Error("Incorrect value of the columnsRenderCalculator");this.spreader.style.left="0"}this.spreader.style.right="",this.needFullRender&&this.syncOverlayOffset()},syncOverlayOffset:function(){"number"==typeof this.wot.wtViewport.rowsRenderCalculator.startPosition?this.clone.wtTable.spreader.style.top=this.wot.wtViewport.rowsRenderCalculator.startPosition+"px":this.clone.wtTable.spreader.style.top=""},scrollTo:function(e,t){var n=this.getTableParentOffset(),o=this.wot.cloneSource?this.wot.cloneSource:this.wot,r=o.wtTable.holder,i=0;t&&r.offsetWidth!==r.clientWidth&&(i=a()),t?(n+=this.sumCellSizes(0,e+1),n-=this.wot.wtViewport.getViewportWidth()):n+=this.sumCellSizes(this.wot.getSetting("fixedColumnsLeft"),e),n+=i,this.setScrollPosition(n)},getTableParentOffset:function(){return this.trimmingContainer===window?this.wot.wtTable.holderOffset.left:0},getScrollPosition:function(){return l(this.mainTableScrollableElement)},adjustHeaderBordersPosition:function(e){var t=this.wot.wtTable.holder.parentNode,n=this.wot.getSetting("rowHeaders"),o=this.wot.getSetting("fixedColumnsLeft");if(o&&!n.length)s(t,"innerBorderLeft");else if(!o&&n.length){var r=c(t,"innerBorderLeft");e?s(t,"innerBorderLeft"):h(t,"innerBorderLeft"),(!r&&e||r&&!e)&&this.wot.wtOverlays.adjustElementsSize()}}},{},p),window.WalkontableLeftOverlay=g,p.registerOverlay(p.CLONE_LEFT,g)},{_base:11,"helpers/dom/element":45}],14:[function(e,t,n){"use strict";Object.defineProperties(n,{WalkontableTopOverlay:{get:function(){return g}},__esModule:{value:!0}});var o,r,i=(o=e("helpers/dom/element"),o&&o.__esModule&&o||{"default":o}),s=i.addClass,a=i.getScrollbarWidth,l=i.getScrollTop,u=i.getWindowScrollLeft,c=i.hasClass,d=i.outerHeight,h=i.removeClass,f=i.setOverlayPosition,p=(r=e("_base"),r&&r.__esModule&&r||{"default":r}).WalkontableOverlay,g=function(e){$traceurRuntime.superConstructor(m).call(this,e),this.clone=this.makeClone(p.CLONE_TOP)},m=g;$traceurRuntime.createClass(g,{shouldBeRendered:function(){return this.wot.getSetting("fixedRowsTop")||this.wot.getSetting("columnHeaders").length?!0:!1},resetFixedPosition:function(){if(this.needFullRender&&this.wot.wtTable.holder.parentNode){var e=this.clone.wtTable.holder.parentNode,t=0;if(this.wot.wtOverlays.leftOverlay.trimmingContainer===window){var n,o,r=this.wot.wtTable.hider.getBoundingClientRect(),i=Math.ceil(r.top),s=Math.ceil(r.bottom);n=this.wot.wtTable.hider.style.left,n=""===n?0:n,o=0>i&&s-e.offsetHeight>0?-i:0,t=o,o+="px",f(e,n,o)}else t=this.getScrollPosition();this.adjustHeaderBordersPosition(t),this.adjustElementsSize()}},setScrollPosition:function(e){this.mainTableScrollableElement===window?window.scrollTo(u(),e):this.mainTableScrollableElement.scrollTop=e},onScroll:function(){this.wot.getSetting("onScrollHorizontally")},sumCellSizes:function(e,t){for(var n=0,o=this.wot.wtSettings.settings.defaultRowHeight;t>e;){var r=this.wot.wtTable.getRowHeight(e);n+=void 0===r?o:r,e++}return n},adjustElementsSize:function(){var e=void 0!==arguments[0]?arguments[0]:!1;(this.needFullRender||e)&&(this.adjustRootElementSize(),this.adjustRootChildrenSize(),e||(this.areElementSizesAdjusted=!0))},adjustRootElementSize:function(){var e,t=this.wot.wtTable.holder,n=t.clientWidth===t.offsetWidth?0:a(),o=this.clone.wtTable.holder.parentNode,r=o.style;this.trimmingContainer!==window&&(r.width=this.wot.wtViewport.getWorkspaceWidth()-n+"px"),this.clone.wtTable.holder.style.width=r.width,e=d(this.clone.wtTable.TABLE),r.height=(0===e?e:e+4)+"px"},adjustRootChildrenSize:function(){var e=a();this.clone.wtTable.hider.style.width=this.hider.style.width,this.clone.wtTable.holder.style.width=this.clone.wtTable.holder.parentNode.style.width,0===e&&(e=30),this.clone.wtTable.holder.style.height=parseInt(this.clone.wtTable.holder.parentNode.style.height,10)+e+"px"},applyToDOM:function(){var e=this.wot.getSetting("totalRows");if(this.areElementSizesAdjusted||this.adjustElementsSize(),"number"==typeof this.wot.wtViewport.rowsRenderCalculator.startPosition)this.spreader.style.top=this.wot.wtViewport.rowsRenderCalculator.startPosition+"px";else{if(0!==e)throw new Error("Incorrect value of the rowsRenderCalculator");this.spreader.style.top="0"}this.spreader.style.bottom="",this.needFullRender&&this.syncOverlayOffset()},syncOverlayOffset:function(){"number"==typeof this.wot.wtViewport.columnsRenderCalculator.startPosition?this.clone.wtTable.spreader.style.left=this.wot.wtViewport.columnsRenderCalculator.startPosition+"px":this.clone.wtTable.spreader.style.left=""},scrollTo:function(e,t){var n=this.getTableParentOffset(),o=this.wot.cloneSource?this.wot.cloneSource:this.wot,r=o.wtTable.holder,i=0;if(t&&r.offsetHeight!==r.clientHeight&&(i=a()),t){var s=this.wot.getSetting("fixedRowsBottom"),l=(this.wot.getSetting("fixedRowsTop"),this.wot.getSetting("totalRows"));n+=this.sumCellSizes(0,e+1),n-=this.wot.wtViewport.getViewportHeight()-this.sumCellSizes(l-s,l),n+=1}else n+=this.sumCellSizes(this.wot.getSetting("fixedRowsTop"),e);n+=i,this.setScrollPosition(n)},getTableParentOffset:function(){return this.mainTableScrollableElement===window?this.wot.wtTable.holderOffset.top:0},getScrollPosition:function(){return l(this.mainTableScrollableElement)},adjustHeaderBordersPosition:function(e){if(0===this.wot.getSetting("fixedRowsTop")&&this.wot.getSetting("columnHeaders").length>0){var t=this.wot.wtTable.holder.parentNode,n=c(t,"innerBorderTop");e?s(t,"innerBorderTop"):h(t,"innerBorderTop"),(!n&&e||n&&!e)&&this.wot.wtOverlays.adjustElementsSize()}if(0===this.wot.getSetting("rowHeaders").length){var o=this.clone.wtTable.THEAD.querySelectorAll("th:nth-of-type(2)");if(o)for(var r=0;rc&&h-e.offsetWidth>0?-c+"px":"0",r=0>u&&d-e.offsetHeight>0?-u+"px":"0",l(e,o,r)}e.style.height=(0===t?t:t+4)+"px",e.style.width=(0===n?n:n+4)+"px"}}},{},u),window.WalkontableTopLeftCornerOverlay=c,u.registerOverlay(u.CLONE_TOP_LEFT_CORNER,c)},{_base:11,"helpers/dom/element":45}],16:[function(e,t,n){"use strict";Object.defineProperties(n,{WalkontableOverlays:{get:function(){return f}},__esModule:{value:!0}});var o,r,i,s=(o=e("helpers/dom/element"),o&&o.__esModule&&o||{"default":o}),a=s.getScrollableElement,l=s.getScrollbarWidth,u=s.getScrollLeft,c=s.getScrollTop,d=(r=e("helpers/unicode"),r&&r.__esModule&&r||{"default":r}).isKey,h=(i=e("eventManager"),i&&i.__esModule&&i||{"default":i}).EventManager,f=function(e){this.wot=e,this.instance=this.wot,this.eventManager=new h(this.wot),this.wot.update("scrollbarWidth",l()),this.wot.update("scrollbarHeight",l()),this.mainTableScrollableElement=a(this.wot.wtTable.TABLE),this.topOverlay=WalkontableOverlay.createOverlay(WalkontableOverlay.CLONE_TOP,this.wot),"undefined"==typeof WalkontableBottomOverlay?this.bottomOverlay={needFullRender:!1}:this.bottomOverlay=WalkontableOverlay.createOverlay(WalkontableOverlay.CLONE_BOTTOM,this.wot),this.leftOverlay=WalkontableOverlay.createOverlay(WalkontableOverlay.CLONE_LEFT,this.wot),this.topOverlay.needFullRender&&this.leftOverlay.needFullRender&&(this.topLeftCornerOverlay=WalkontableOverlay.createOverlay(WalkontableOverlay.CLONE_TOP_LEFT_CORNER,this.wot)),this.bottomOverlay.needFullRender&&this.leftOverlay.needFullRender&&"undefined"!=typeof WalkontableBottomLeftCornerOverlay?this.bottomLeftCornerOverlay=WalkontableOverlay.createOverlay(WalkontableOverlay.CLONE_BOTTOM_LEFT_CORNER,this.wot):this.bottomLeftCornerOverlay={needFullRender:!1},this.wot.getSetting("debug")&&(this.debug=WalkontableOverlay.createOverlay(WalkontableOverlay.CLONE_DEBUG,this.wot)),this.destroyed=!1,this.keyPressed=!1,this.spreaderLastSize={width:null,height:null},this.overlayScrollPositions={master:{top:0,left:0},top:{top:null,left:0},bottom:{top:null,left:0},left:{top:0,left:null}},this.verticalScrolling=!1,this.horizontalScrolling=!1,this.delegatedScrollCallback=!1,this.registerListeners()};$traceurRuntime.createClass(f,{refreshAll:function(){if(this.wot.drawn){if(!this.wot.wtTable.holder.parentNode)return void this.destroy();this.wot.draw(!0),this.verticalScrolling&&this.leftOverlay.onScroll(),this.horizontalScrolling&&this.topOverlay.onScroll(),this.verticalScrolling=!1,this.horizontalScrolling=!1}},registerListeners:function(){var e=this;this.eventManager.addEventListener(document.documentElement,"keydown",function(t){return e.onKeyDown(t)}),this.eventManager.addEventListener(document.documentElement,"keyup",function(){return e.onKeyUp()}),this.eventManager.addEventListener(document,"visibilitychange",function(){return e.onKeyUp()}),this.eventManager.addEventListener(this.mainTableScrollableElement,"scroll",function(t){return e.onTableScroll(t)}),this.topOverlay.needFullRender&&(this.eventManager.addEventListener(this.topOverlay.clone.wtTable.holder,"scroll",function(t){return e.onTableScroll(t)}),this.eventManager.addEventListener(this.topOverlay.clone.wtTable.holder,"wheel",function(t){return e.onTableScroll(t)})),this.bottomOverlay.needFullRender&&(this.eventManager.addEventListener(this.bottomOverlay.clone.wtTable.holder,"scroll",function(t){return e.onTableScroll(t)}),this.eventManager.addEventListener(this.bottomOverlay.clone.wtTable.holder,"wheel",function(t){return e.onTableScroll(t)})),this.leftOverlay.needFullRender&&(this.eventManager.addEventListener(this.leftOverlay.clone.wtTable.holder,"scroll",function(t){return e.onTableScroll(t)}),this.eventManager.addEventListener(this.leftOverlay.clone.wtTable.holder,"wheel",function(t){return e.onTableScroll(t)})),this.topOverlay.trimmingContainer!==window&&this.leftOverlay.trimmingContainer!==window&&this.eventManager.addEventListener(window,"wheel",function(t){var n,o=t.wheelDeltaY||t.deltaY,r=t.wheelDeltaX||t.deltaX;e.topOverlay.clone.wtTable.holder.contains(t.realTarget)?n="top":e.bottomOverlay.clone&&e.bottomOverlay.clone.wtTable.holder.contains(t.realTarget)?n="bottom":e.leftOverlay.clone.wtTable.holder.contains(t.realTarget)&&(n="left"),"top"==n&&0!==o?t.preventDefault():"left"==n&&0!==r?t.preventDefault():"bottom"==n&&0!==o&&t.preventDefault()})},onTableScroll:function(e){Handsontable.mobileBrowser||(!this.keyPressed||this.mainTableScrollableElement===window||e.target.contains(this.mainTableScrollableElement))&&("scroll"===e.type?this.syncScrollPositions(e):this.translateMouseWheelToScroll(e))},onKeyDown:function(e){this.keyPressed=d(e.keyCode,"ARROW_UP|ARROW_RIGHT|ARROW_DOWN|ARROW_LEFT")},onKeyUp:function(){this.keyPressed=!1},translateMouseWheelToScroll:function(e){for(var t,n=this.topOverlay.clone.wtTable.holder,o=this.bottomOverlay.clone?this.bottomOverlay.clone.wtTable.holder:null,r=this.leftOverlay.clone.wtTable.holder,i={type:"wheel"},s=e.target,a=e.wheelDeltaY||-1*e.deltaY,l=e.wheelDeltaX||-1*e.deltaX;s!=document&&null!=s;){if(s.className.indexOf("wtHolder")>-1){t=s;break}s=s.parentNode}return i.target=t,t==n?this.syncScrollPositions(i,-.2*a):t==o?this.syncScrollPositions(i,-.2*a):t==r&&this.syncScrollPositions(i,-.2*l),!1},syncScrollPositions:function(e){var t=void 0!==arguments[1]?arguments[1]:null;if(!this.destroyed){if(0===arguments.length)return void this.syncScrollWithMaster();var n,o,r,i=this.mainTableScrollableElement,s=e.target,a=0,l=!1,d=!1;this.topOverlay.needFullRender&&(n=this.topOverlay.clone.wtTable.holder),this.bottomOverlay.needFullRender&&(r=this.bottomOverlay.clone.wtTable.holder),this.leftOverlay.needFullRender&&(o=this.leftOverlay.clone.wtTable.holder),s===document&&(s=window),s===i?(a=u(s),this.overlayScrollPositions.master.left!==a&&(this.horizontalScrolling=!0,this.overlayScrollPositions.master.left=a,l=!0,n&&(n.scrollLeft=a,d=this.mainTableScrollableElement!==window),r&&(r.scrollLeft=a,d=this.mainTableScrollableElement!==window)),a=c(s),this.overlayScrollPositions.master.top!==a&&(this.verticalScrolling=!0,this.overlayScrollPositions.master.top=a,l=!0,o&&(o.scrollTop=a,d=this.mainTableScrollableElement!==window))):s===r?(a=u(s),this.overlayScrollPositions.bottom.left!==a&&(this.horizontalScrolling=!0,this.overlayScrollPositions.bottom.left=a,l=!0,i.scrollLeft=a),null!==t&&(l=!0,i.scrollTop+=t)):s===n?(a=u(s),this.overlayScrollPositions.top.left!==a&&(this.horizontalScrolling=!0,this.overlayScrollPositions.top.left=a,l=!0,i.scrollLeft=a),null!==t&&(l=!0,i.scrollTop+=t)):s===o&&(a=c(s),this.overlayScrollPositions.left.top!==a&&(this.verticalScrolling=!0,this.overlayScrollPositions.left.top=a,l=!0,i.scrollTop=a),null!==t&&(l=!0,i.scrollLeft+=t)),!this.keyPressed&&l&&"scroll"===e.type&&(this.delegatedScrollCallback?this.delegatedScrollCallback=!1:this.refreshAll(),d&&(this.delegatedScrollCallback=!0))}},syncScrollWithMaster:function(){var e=this.topOverlay.mainTableScrollableElement;this.topOverlay.needFullRender&&(this.topOverlay.clone.wtTable.holder.scrollLeft=e.scrollLeft),this.leftOverlay.needFullRender&&(this.leftOverlay.clone.wtTable.holder.scrollTop=e.scrollTop)},destroy:function(){this.eventManager.destroy(),this.topOverlay.destroy(),this.bottomOverlay.clone&&this.bottomOverlay.destroy(),this.leftOverlay.destroy(),this.topLeftCornerOverlay&&this.topLeftCornerOverlay.destroy(),this.bottomLeftCornerOverlay&&this.bottomLeftCornerOverlay.clone&&this.bottomLeftCornerOverlay.destroy(),this.debug&&this.debug.destroy(),this.destroyed=!0},refresh:function(){var e=void 0!==arguments[0]?arguments[0]:!1;if(this.topOverlay.areElementSizesAdjusted&&this.leftOverlay.areElementSizesAdjusted){var t=this.wot.wtTable.wtRootElement.parentNode||this.wot.wtTable.wtRootElement,n=t.clientWidth,o=t.clientHeight;(n!==this.spreaderLastSize.width||o!==this.spreaderLastSize.height)&&(this.spreaderLastSize.width=n,this.spreaderLastSize.height=o,this.adjustElementsSize())}this.bottomOverlay.clone&&this.bottomOverlay.refresh(e),this.leftOverlay.refresh(e),this.topOverlay.refresh(e),this.topLeftCornerOverlay&&this.topLeftCornerOverlay.refresh(e),this.bottomLeftCornerOverlay&&this.bottomLeftCornerOverlay.clone&&this.bottomLeftCornerOverlay.refresh(e),this.debug&&this.debug.refresh(e)},adjustElementsSize:function(){var e=void 0!==arguments[0]?arguments[0]:!1,t=this.wot.getSetting("totalColumns"),n=this.wot.getSetting("totalRows"),o=this.wot.wtViewport.getRowHeaderWidth(),r=this.wot.wtViewport.getColumnHeaderHeight(),i=this.wot.wtTable.hider.style;i.width=o+this.leftOverlay.sumCellSizes(0,t)+"px",i.height=r+this.topOverlay.sumCellSizes(0,n)+1+"px",this.topOverlay.adjustElementsSize(e),this.leftOverlay.adjustElementsSize(e),this.bottomOverlay.clone&&this.bottomOverlay.adjustElementsSize(e)},applyToDOM:function(){this.topOverlay.areElementSizesAdjusted&&this.leftOverlay.areElementSizesAdjusted||this.adjustElementsSize(),this.topOverlay.applyToDOM(),this.bottomOverlay.clone&&this.bottomOverlay.applyToDOM(),this.leftOverlay.applyToDOM()}},{}),window.WalkontableOverlays=f},{eventManager:41,"helpers/dom/element":45,"helpers/unicode":53}],17:[function(e,t,n){"use strict";Object.defineProperties(n,{WalkontableScroll:{get:function(){return o}},__esModule:{value:!0}});var o=function(e){this.wot=e,this.instance=e};$traceurRuntime.createClass(o,{scrollViewport:function(e){if(this.wot.drawn){var t=this.wot.getSetting("totalRows"),n=this.wot.getSetting("totalColumns"),o=this.instance.getSetting("fixedRowsTop"),r=this.instance.getSetting("fixedRowsBottom"),i=this.instance.getSetting("fixedColumnsLeft");if(e.row<0||e.row>t-1)throw new Error("row "+e.row+" does not exist");if(e.col<0||e.col>n-1)throw new Error("column "+e.col+" does not exist");e.row>this.instance.wtTable.getLastVisibleRow()&&e.row=o&&e.rowthis.instance.wtTable.getLastVisibleColumn()?this.wot.wtOverlays.leftOverlay.scrollTo(e.col,!0):e.col>=i&&e.colu;u++)o=e.wtTable.columnFilter.renderedToSource(u),o>=l[1]&&o<=l[3]&&(r=e.wtTable.getColumnHeader(o),r&&this.settings.highlightColumnClassName&&a(r,this.settings.highlightColumnClassName));for(var c=0;i>c;c++){n=e.wtTable.rowFilter.renderedToSource(c),n>=l[0]&&n<=l[2]&&(r=e.wtTable.getRowHeader(n),r&&this.settings.highlightRowClassName&&a(r,this.settings.highlightRowClassName));for(var d=0;s>d;d++)o=e.wtTable.columnFilter.renderedToSource(d),n>=l[0]&&n<=l[2]&&o>=l[1]&&o<=l[3]?this.settings.className&&this.addClassAtCoords(e,n,o,this.settings.className):n>=l[0]&&n<=l[2]?this.settings.highlightRowClassName&&this.addClassAtCoords(e,n,o,this.settings.highlightRowClassName):o>=l[1]&&o<=l[3]&&this.settings.highlightColumnClassName&&this.addClassAtCoords(e,n,o,this.settings.highlightColumnClassName)}if(e.getSetting("onBeforeDrawBorders",l,this.settings.className),this.settings.border){var h=this.getBorder(e);h&&h.appear(l)}}}},{}),window.WalkontableSelection=d},{border:2,"cell/coords":5,"cell/range":6,"helpers/dom/element":45}],19:[function(e,t,n){"use strict";Object.defineProperties(n,{WalkontableSettings:{get:function(){return i}},__esModule:{value:!0}});var o,r=(o=e("helpers/dom/element"),o&&o.__esModule&&o||{"default":o}).fastInnerText,i=function(e,t){var n=this;this.wot=e,this.instance=e,this.defaults={table:void 0,debug:!1,externalRowCalculator:!1,stretchH:"none",currentRowClassName:null,currentColumnClassName:null,data:void 0,fixedColumnsLeft:0,fixedRowsTop:0,fixedRowsBottom:0,minSpareRows:0,rowHeaders:function(){return[]},columnHeaders:function(){return[]},totalRows:void 0,totalColumns:void 0,cellRenderer:function(e,t,o){var i=n.getSetting("data",e,t);r(o,void 0===i||null===i?"":i)},columnWidth:function(e){},rowHeight:function(e){},defaultRowHeight:23,defaultColumnWidth:50,selections:null,hideBorderOnMouseDownOver:!1,viewportRowCalculatorOverride:null,viewportColumnCalculatorOverride:null,onCellMouseDown:null,onCellMouseOver:null,onCellDblClick:null,onCellCornerMouseDown:null,onCellCornerDblClick:null,beforeDraw:null,onDraw:null,onBeforeDrawBorders:null,onScrollVertically:null,onScrollHorizontally:null,onBeforeTouchScroll:null,onAfterMomentumScroll:null,scrollbarWidth:10,scrollbarHeight:10,renderAllRows:!1,groups:!1},this.settings={};for(var o in this.defaults)if(this.defaults.hasOwnProperty(o))if(void 0!==t[o])this.settings[o]=t[o];else{if(void 0===this.defaults[o])throw new Error('A required setting "'+o+'" was not provided');this.settings[o]=this.defaults[o]}};$traceurRuntime.createClass(i,{update:function(e,t){if(void 0===t)for(var n in e)e.hasOwnProperty(n)&&(this.settings[n]=e[n]);else this.settings[e]=t;return this.wot},getSetting:function(e,t,n,o,r){return"function"==typeof this.settings[e]?this.settings[e](t,n,o,r):void 0!==t&&Array.isArray(this.settings[e])?this.settings[e][t]:this.settings[e]},has:function(e){return!!this.settings[e]}},{}),window.WalkontableSettings=i},{"helpers/dom/element":45}],20:[function(e,t,n){"use strict";Object.defineProperties(n,{WalkontableTable:{get:function(){return C}},__esModule:{value:!0}});var o,r,i,s,a,l,u=(o=e("helpers/dom/element"),o&&o.__esModule&&o||{"default":o}),c=u.getStyle,d=u.getTrimmingContainer,h=u.hasClass,f=u.index,p=u.offset,g=u.removeClass,m=u.removeTextNodes,v=(u.overlayContainsElement,(r=e("cell/coords"),r&&r.__esModule&&r||{"default":r}).WalkontableCellCoords),w=((i=e("cell/range"),i&&i.__esModule&&i||{"default":i}).WalkontableCellRange,(s=e("filter/column"),s&&s.__esModule&&s||{"default":s}).WalkontableColumnFilter),y=(a=e("filter/row"),a&&a.__esModule&&a||{"default":a}).WalkontableRowFilter,b=(l=e("tableRenderer"),l&&l.__esModule&&l||{"default":l}).WalkontableTableRenderer,C=function(e,t){this.wot=e,this.instance=this.wot,this.TABLE=t,this.TBODY=null,this.THEAD=null,this.COLGROUP=null,this.tableOffset=0,this.holderOffset=0,m(this.TABLE),this.spreader=this.createSpreader(this.TABLE),this.hider=this.createHider(this.spreader),this.holder=this.createHolder(this.hider),this.wtRootElement=this.holder.parentNode,this.alignOverlaysWithTrimmingContainer(),this.fixTableDomTree(),this.colgroupChildrenLength=this.COLGROUP.childNodes.length,this.theadChildrenLength=this.THEAD.firstChild?this.THEAD.firstChild.childNodes.length:0,this.tbodyChildrenLength=this.TBODY.childNodes.length,this.rowFilter=null,this.columnFilter=null};$traceurRuntime.createClass(C,{fixTableDomTree:function(){this.TBODY=this.TABLE.querySelector("tbody"),this.TBODY||(this.TBODY=document.createElement("tbody"),this.TABLE.appendChild(this.TBODY)),this.THEAD=this.TABLE.querySelector("thead"),this.THEAD||(this.THEAD=document.createElement("thead"),this.TABLE.insertBefore(this.THEAD,this.TBODY)),this.COLGROUP=this.TABLE.querySelector("colgroup"),this.COLGROUP||(this.COLGROUP=document.createElement("colgroup"),this.TABLE.insertBefore(this.COLGROUP,this.THEAD)),this.wot.getSetting("columnHeaders").length&&!this.THEAD.childNodes.length&&this.THEAD.appendChild(document.createElement("TR"))},createSpreader:function(e){var t,n=e.parentNode;return n&&1===n.nodeType&&h(n,"wtHolder")||(t=document.createElement("div"),t.className="wtSpreader",n&&n.insertBefore(t,e),t.appendChild(e)),t.style.position="relative",t},createHider:function(e){var t,n=e.parentNode;return n&&1===n.nodeType&&h(n,"wtHolder")||(t=document.createElement("div"),t.className="wtHider",n&&n.insertBefore(t,e),t.appendChild(e)),t},createHolder:function(e){var t,n=e.parentNode;return n&&1===n.nodeType&&h(n,"wtHolder")||(t=document.createElement("div"),t.style.position="relative",t.className="wtHolder",n&&n.insertBefore(t,e),this.isWorkingOnClone()||(t.parentNode.className+="ht_master handsontable"),t.appendChild(e)),t},alignOverlaysWithTrimmingContainer:function(){var e=d(this.wtRootElement);this.isWorkingOnClone()||(this.holder.parentNode.style.position="relative",e===window?(this.holder.style.overflow="visible",this.wtRootElement.style.overflow="visible"):(this.holder.style.width=c(e,"width"),this.holder.style.height=c(e,"height"),this.holder.style.overflow=""))},isWorkingOnClone:function(){return!!this.wot.cloneSource},draw:function(e){var t=this.instance.getSetting("totalRows");if(this.isWorkingOnClone()||(this.holderOffset=p(this.holder),e=this.wot.wtViewport.createRenderCalculators(e)),e)this.isWorkingOnClone()||this.wot.wtViewport.createVisibleCalculators(),this.wot.wtOverlays&&this.wot.wtOverlays.refresh(!0);else{this.isWorkingOnClone()?this.tableOffset=this.wot.cloneSource.wtTable.tableOffset:this.tableOffset=p(this.TABLE);var n;n=WalkontableOverlay.isOverlayTypeOf(this.wot.cloneOverlay,WalkontableOverlay.CLONE_DEBUG)||WalkontableOverlay.isOverlayTypeOf(this.wot.cloneOverlay,WalkontableOverlay.CLONE_TOP)||WalkontableOverlay.isOverlayTypeOf(this.wot.cloneOverlay,WalkontableOverlay.CLONE_TOP_LEFT_CORNER)?0:WalkontableOverlay.isOverlayTypeOf(this.instance.cloneOverlay,WalkontableOverlay.CLONE_BOTTOM)||WalkontableOverlay.isOverlayTypeOf(this.instance.cloneOverlay,WalkontableOverlay.CLONE_BOTTOM_LEFT_CORNER)?t-this.wot.getSetting("fixedRowsBottom"):this.wot.wtViewport.rowsRenderCalculator.startRow; +var o;o=WalkontableOverlay.isOverlayTypeOf(this.wot.cloneOverlay,WalkontableOverlay.CLONE_DEBUG)||WalkontableOverlay.isOverlayTypeOf(this.wot.cloneOverlay,WalkontableOverlay.CLONE_LEFT)||WalkontableOverlay.isOverlayTypeOf(this.wot.cloneOverlay,WalkontableOverlay.CLONE_TOP_LEFT_CORNER)||WalkontableOverlay.isOverlayTypeOf(this.wot.cloneOverlay,WalkontableOverlay.CLONE_BOTTOM_LEFT_CORNER)?0:this.wot.wtViewport.columnsRenderCalculator.startColumn,this.rowFilter=new y(n,t,this.wot.getSetting("columnHeaders").length),this.columnFilter=new w(o,this.wot.getSetting("totalColumns"),this.wot.getSetting("rowHeaders").length),this._doDraw(),this.alignOverlaysWithTrimmingContainer()}return this.refreshSelections(e),this.isWorkingOnClone()||(this.wot.wtOverlays.topOverlay.resetFixedPosition(),this.wot.wtOverlays.bottomOverlay.clone&&this.wot.wtOverlays.bottomOverlay.resetFixedPosition(),this.wot.wtOverlays.leftOverlay.resetFixedPosition(),this.wot.wtOverlays.topLeftCornerOverlay&&this.wot.wtOverlays.topLeftCornerOverlay.resetFixedPosition(),this.instance.wtOverlays.bottomLeftCornerOverlay&&this.instance.wtOverlays.bottomLeftCornerOverlay.clone&&this.wot.wtOverlays.bottomLeftCornerOverlay.resetFixedPosition()),this.wot.drawn=!0,this},_doDraw:function(){var e=new b(this);e.render()},removeClassFromCells:function(e){for(var t=this.TABLE.querySelectorAll("."+e),n=0,o=t.length;o>n;n++)g(t[n],e)},refreshSelections:function(e){if(this.wot.selections){var t=this.wot.selections.length;if(e)for(var n=0;t>n;n++)this.wot.selections[n].settings.className&&this.removeClassFromCells(this.wot.selections[n].settings.className),this.wot.selections[n].settings.highlightRowClassName&&this.removeClassFromCells(this.wot.selections[n].settings.highlightRowClassName),this.wot.selections[n].settings.highlightColumnClassName&&this.removeClassFromCells(this.wot.selections[n].settings.highlightColumnClassName);for(var o=0;t>o;o++)this.wot.selections[o].draw(this.wot,e)}},getCell:function(e){if(this.isRowBeforeRenderedRows(e.row))return-1;if(this.isRowAfterRenderedRows(e.row))return-2;var t=this.TBODY.childNodes[this.rowFilter.sourceToRendered(e.row)];return t?t.childNodes[this.columnFilter.sourceColumnToVisibleRowHeadedColumn(e.col)]:void 0},getColumnHeader:function(e){var t=void 0!==arguments[1]?arguments[1]:0,n=this.THEAD.childNodes[t];return n?n.childNodes[this.columnFilter.sourceColumnToVisibleRowHeadedColumn(e)]:void 0},getRowHeader:function(e){if(0===this.columnFilter.sourceColumnToVisibleRowHeadedColumn(0))return null;var t=this.TBODY.childNodes[this.rowFilter.sourceToRendered(e)];return t?t.childNodes[0]:void 0},getCoords:function(e){var t=e.parentNode,n=f(t);n=t.parentNode===this.THEAD?this.rowFilter.visibleColHeadedRowToSourceRow(n):this.rowFilter.renderedToSource(n);var o=this.columnFilter.visibleRowHeadedColumnToSourceColumn(e.cellIndex);return new v(n,o)},getTrForRow:function(e){return this.TBODY.childNodes[this.rowFilter.sourceToRendered(e)]},getFirstRenderedRow:function(){return this.wot.wtViewport.rowsRenderCalculator.startRow},getFirstVisibleRow:function(){return this.wot.wtViewport.rowsVisibleCalculator.startRow},getFirstRenderedColumn:function(){return this.wot.wtViewport.columnsRenderCalculator.startColumn},getFirstVisibleColumn:function(){return this.wot.wtViewport.columnsVisibleCalculator.startColumn},getLastRenderedRow:function(){return this.wot.wtViewport.rowsRenderCalculator.endRow},getLastVisibleRow:function(){return this.wot.wtViewport.rowsVisibleCalculator.endRow},getLastRenderedColumn:function(){return this.wot.wtViewport.columnsRenderCalculator.endColumn},getLastVisibleColumn:function(){return this.wot.wtViewport.columnsVisibleCalculator.endColumn},isRowBeforeRenderedRows:function(e){return this.rowFilter.sourceToRendered(e)<0&&e>=0},isRowAfterViewport:function(e){return this.rowFilter.sourceToRendered(e)>this.getLastVisibleRow()},isRowAfterRenderedRows:function(e){return this.rowFilter.sourceToRendered(e)>this.getLastRenderedRow()},isColumnBeforeViewport:function(e){return this.columnFilter.sourceToRendered(e)<0&&e>=0},isColumnAfterViewport:function(e){return this.columnFilter.sourceToRendered(e)>this.getLastVisibleColumn()},isLastRowFullyVisible:function(){return this.getLastVisibleRow()===this.getLastRenderedRow()},isLastColumnFullyVisible:function(){return this.getLastVisibleColumn()===this.getLastRenderedColumn()},getRenderedColumnsCount:function(){return WalkontableOverlay.isOverlayTypeOf(this.wot.cloneOverlay,WalkontableOverlay.CLONE_DEBUG)?this.wot.getSetting("totalColumns"):WalkontableOverlay.isOverlayTypeOf(this.wot.cloneOverlay,WalkontableOverlay.CLONE_LEFT)||WalkontableOverlay.isOverlayTypeOf(this.wot.cloneOverlay,WalkontableOverlay.CLONE_TOP_LEFT_CORNER)||WalkontableOverlay.isOverlayTypeOf(this.wot.cloneOverlay,WalkontableOverlay.CLONE_BOTTOM_LEFT_CORNER)?this.wot.getSetting("fixedColumnsLeft"):this.wot.wtViewport.columnsRenderCalculator.count},getRenderedRowsCount:function(){return WalkontableOverlay.isOverlayTypeOf(this.wot.cloneOverlay,WalkontableOverlay.CLONE_DEBUG)?this.wot.getSetting("totalRows"):WalkontableOverlay.isOverlayTypeOf(this.wot.cloneOverlay,WalkontableOverlay.CLONE_TOP)||WalkontableOverlay.isOverlayTypeOf(this.wot.cloneOverlay,WalkontableOverlay.CLONE_TOP_LEFT_CORNER)?this.wot.getSetting("fixedRowsTop"):WalkontableOverlay.isOverlayTypeOf(this.wot.cloneOverlay,WalkontableOverlay.CLONE_BOTTOM)||WalkontableOverlay.isOverlayTypeOf(this.wot.cloneOverlay,WalkontableOverlay.CLONE_BOTTOM_LEFT_CORNER)?this.instance.getSetting("fixedRowsBottom"):this.wot.wtViewport.rowsRenderCalculator.count},getVisibleRowsCount:function(){return this.wot.wtViewport.rowsVisibleCalculator.count},allRowsInViewport:function(){return this.wot.getSetting("totalRows")==this.getVisibleRowsCount()},getRowHeight:function(e){var t=this.wot.wtSettings.settings.rowHeight(e),n=this.wot.wtViewport.oversizedRows[e];return void 0!==n&&(t=void 0===t?n:Math.max(t,n)),t},getColumnHeaderHeight:function(e){var t=this.wot.wtSettings.settings.defaultRowHeight,n=this.wot.wtViewport.oversizedColumnHeaders[e];return void 0!==n&&(t=t?Math.max(t,n):n),t},getVisibleColumnsCount:function(){return this.wot.wtViewport.columnsVisibleCalculator.count},allColumnsInViewport:function(){return this.wot.getSetting("totalColumns")==this.getVisibleColumnsCount()},getColumnWidth:function(e){var t=this.wot.wtSettings.settings.columnWidth;return"function"==typeof t?t=t(e):"object"==typeof t&&(t=t[e]),t||this.wot.wtSettings.settings.defaultColumnWidth},getStretchedColumnWidth:function(e){var t=this.getColumnWidth(e),n=-1===[void 0,null].indexOf(t)?t:this.instance.wtSettings.settings.defaultColumnWidth,o=this.wot.wtViewport.columnsRenderCalculator;if(o){var r=o.getStretchedColumnWidth(e,n);r&&(n=r)}return n}},{}),window.WalkontableTable=C},{"cell/coords":5,"cell/range":6,"filter/column":9,"filter/row":10,"helpers/dom/element":45,tableRenderer:21}],21:[function(e,t,n){"use strict";function o(e,t){var n=document.createElement("TH");return t.insertBefore(n,e),t.removeChild(e),n}function r(e,t){var n=document.createElement("TD");return t.insertBefore(n,e),t.removeChild(e),n}Object.defineProperties(n,{WalkontableTableRenderer:{get:function(){return h}},__esModule:{value:!0}});var i,s=(i=e("helpers/dom/element"),i&&i.__esModule&&i||{"default":i}),a=s.addClass,l=s.empty,u=s.getScrollbarWidth,c=s.hasClass,d=s.innerHeight,h=function(e){this.wtTable=e,this.wot=e.instance,this.instance=e.instance,this.rowFilter=e.rowFilter,this.columnFilter=e.columnFilter,this.TABLE=e.TABLE,this.THEAD=e.THEAD,this.TBODY=e.TBODY,this.COLGROUP=e.COLGROUP,this.rowHeaders=[],this.rowHeaderCount=0,this.columnHeaders=[],this.columnHeaderCount=0,this.fixedRowsTop=0,this.fixedRowsBottom=0};$traceurRuntime.createClass(h,{render:function(){this.wtTable.isWorkingOnClone()||this.wot.getSetting("beforeDraw",!0),this.rowHeaders=this.wot.getSetting("rowHeaders"),this.rowHeaderCount=this.rowHeaders.length,this.fixedRowsTop=this.wot.getSetting("fixedRowsTop"),this.fixedRowsBottom=this.wot.getSetting("fixedRowsBottom"),this.columnHeaders=this.wot.getSetting("columnHeaders"),this.columnHeaderCount=this.columnHeaders.length;var e,t=this.wtTable.getRenderedColumnsCount(),n=this.wtTable.getRenderedRowsCount(),o=this.wot.getSetting("totalColumns"),r=this.wot.getSetting("totalRows"),i=!1;if((WalkontableOverlay.isOverlayTypeOf(this.wot.cloneOverlay,WalkontableOverlay.CLONE_BOTTOM)||WalkontableOverlay.isOverlayTypeOf(this.wot.cloneOverlay,WalkontableOverlay.CLONE_BOTTOM_LEFT_CORNER))&&(this.columnHeaders=[],this.columnHeaderCount=0),o>0&&(this.adjustAvailableNodes(),i=!0,this.renderColumnHeaders(),this.renderRows(r,n,t),this.wtTable.isWorkingOnClone()||(e=this.wot.wtViewport.getWorkspaceWidth(),this.wot.wtViewport.containerWidth=null),this.adjustColumnHeaderHeights(),this.adjustColumnWidths(t),this.markOversizedColumns()),i||this.adjustAvailableNodes(),this.removeRedundantRows(n),this.wtTable.isWorkingOnClone()){if(WalkontableOverlay.isOverlayTypeOf(this.wot.cloneOverlay,WalkontableOverlay.CLONE_BOTTOM)){var s=this.wot.cloneOverlay.instance;this.wot.cloneOverlay.markOversizedFixedBottomRows(),s.wtOverlays.adjustElementsSize()}}else{if(this.markOversizedRows(),this.wot.wtViewport.createVisibleCalculators(),this.wot.wtOverlays.refresh(!1),this.wot.wtOverlays.applyToDOM(),e!==this.wot.wtViewport.getWorkspaceWidth()){this.wot.wtViewport.containerWidth=null;for(var a=this.wtTable.getFirstRenderedColumn(),l=this.wtTable.getLastRenderedColumn(),u=a;l>u;u++){var c=this.wtTable.getStretchedColumnWidth(u),d=this.columnFilter.sourceToRendered(u);this.COLGROUP.childNodes[d+this.rowHeaderCount].style.width=c+"px"}}this.wot.getSetting("onDraw",!0)}},removeRedundantRows:function(e){for(;this.wtTable.tbodyChildrenLength>e;)this.TBODY.removeChild(this.TBODY.lastChild),this.wtTable.tbodyChildrenLength--},renderRows:function(e,t,n){for(var o,r,i=0,s=this.rowFilter.renderedToSource(i),a=this.wtTable.isWorkingOnClone();e>s&&s>=0&&(i>1e3&&console.error("Security brake: Too much TRs. Please define height for your table, which will enforce scrollbars."),void 0===t||i!==t);){if(r=this.getOrCreateTrForRow(i,r),this.renderRowHeaders(s,r),this.adjustColumns(r,n+this.rowHeaderCount),o=this.renderCells(s,r,n),(!a||WalkontableOverlay.isOverlayTypeOf(this.wot.cloneOverlay,WalkontableOverlay.CLONE_BOTTOM))&&this.resetOversizedRow(s),r.firstChild){var l=this.wot.wtTable.getRowHeight(s);l?(l--,r.firstChild.style.height=l+"px"):r.firstChild.style.height=""}i++,s=this.rowFilter.renderedToSource(i)}},resetOversizedRow:function(e){this.wot.getSetting("externalRowCalculator")||this.wot.wtViewport.oversizedRows&&this.wot.wtViewport.oversizedRows[e]&&(this.wot.wtViewport.oversizedRows[e]=void 0)},markOversizedRows:function(){if(!this.wot.getSetting("externalRowCalculator")){var e,t,n,o,r,i=this.instance.wtTable.TBODY.childNodes.length,s=i*this.instance.wtSettings.settings.defaultRowHeight,a=d(this.instance.wtTable.TBODY)-1;this.instance.getSetting("totalRows");if(s!==a||this.instance.getSetting("fixedRowsBottom"))for(;i;)i--,n=this.instance.wtTable.rowFilter.renderedToSource(i),e=this.instance.wtTable.getRowHeight(n),o=this.instance.wtTable.getTrForRow(n),r=o.querySelector("th"),t=r?d(r):d(o)-1,(!e&&this.instance.wtSettings.settings.defaultRowHeighte)&&(this.instance.wtViewport.oversizedRows[n]=++t)}},markOversizedColumns:function(){var e=this.wot.getOverlayName();if(this.columnHeaderCount&&!this.wot.wtViewport.isMarkedOversizedColumn[e]&&!this.wtTable.isWorkingOnClone()){for(var t=this.wtTable.getRenderedColumnsCount(),n=0;no;o++)this.markIfOversizedColumnHeader(o);this.wot.wtViewport.isMarkedOversizedColumn[e]=!0}},adjustColumnHeaderHeights:function(){for(var e=this.wot.getSetting("columnHeaders"),t=this.wot.wtTable.THEAD.childNodes,n=this.wot.wtViewport.oversizedColumnHeaders,o=0,r=e.length;r>o;o++)if(n[o]){if(0===t[o].childNodes.length)return;t[o].childNodes[0].style.height=n[o]+"px"}},markIfOversizedColumnHeader:function(e){for(var t,n,o,r=this.wot.wtTable.columnFilter.renderedToSource(e),i=this.columnHeaderCount,s=this.wot.wtSettings.settings.defaultRowHeight;i;)i--,t=this.wot.wtTable.getColumnHeaderHeight(i),n=this.wot.wtTable.getColumnHeader(r,i),n&&(o=d(n),(!t&&o>s||o>t)&&(this.wot.wtViewport.oversizedColumnHeaders[i]=o))},renderCells:function(e,t,n){for(var o,i,s=0;n>s;s++)i=this.columnFilter.renderedToSource(s),o=0===s?t.childNodes[this.columnFilter.sourceColumnToVisibleRowHeadedColumn(i)]:o.nextSibling,"TH"==o.nodeName&&(o=r(o,t)),c(o,"hide")||(o.className=""),o.removeAttribute("style"),this.wot.wtSettings.settings.cellRenderer(e,i,o);return o},adjustColumnWidths:function(e){var t=0,n=this.wot.cloneSource?this.wot.cloneSource:this.wot,o=n.wtTable.holder;o.offsetHeightr;r++){var i=this.wtTable.getStretchedColumnWidth(this.columnFilter.renderedToSource(r));this.COLGROUP.childNodes[r+this.rowHeaderCount].style.width=i+"px"}},appendToTbody:function(e){this.TBODY.appendChild(e),this.wtTable.tbodyChildrenLength++},getOrCreateTrForRow:function(e,t){var n;return e>=this.wtTable.tbodyChildrenLength?(n=this.createRow(),this.appendToTbody(n)):n=0===e?this.TBODY.firstChild:t.nextSibling,n.className&&n.removeAttribute("class"),n},createRow:function(){for(var e=document.createElement("TR"),t=0;to;o++){var r=this.columnFilter.renderedToSource(o);this.renderColumnHeader(t,r,n.childNodes[o+this.rowHeaderCount])}},adjustColGroups:function(){for(var e=this.wtTable.getRenderedColumnsCount();this.wtTable.colgroupChildrenLengthe+this.rowHeaderCount;)this.COLGROUP.removeChild(this.COLGROUP.lastChild),this.wtTable.colgroupChildrenLength--;this.rowHeaderCount&&a(this.COLGROUP.childNodes[0],"rowHeader")},adjustThead:function(){var e=this.wtTable.getRenderedColumnsCount(),t=this.THEAD.firstChild;if(this.columnHeaders.length){for(var n=0,o=this.columnHeaders.length;o>n;n++){for(t=this.THEAD.childNodes[n],t||(t=document.createElement("TR"),this.THEAD.appendChild(t)),this.theadChildrenLength=t.childNodes.length;this.theadChildrenLengthe+this.rowHeaderCount;)t.removeChild(t.lastChild),this.theadChildrenLength--}var r=this.THEAD.childNodes.length;if(r>this.columnHeaders.length)for(var i=this.columnHeaders.length;r>i;i++)this.THEAD.removeChild(this.THEAD.lastChild)}else t&&l(t)},getTrForColumnHeaders:function(e){return this.THEAD.childNodes[e]},renderColumnHeader:function(e,t,n){return n.className="",n.removeAttribute("style"),this.columnHeaders[e](t,n,e)},adjustColumns:function(e,t){for(var n=e.childNodes.length;t>n;){var o=document.createElement("TD");e.appendChild(o),n++}for(;n>t;)e.removeChild(e.lastChild),n--},removeRedundantColumns:function(e){for(;this.wtTable.tbodyChildrenLength>e;)this.TBODY.removeChild(this.TBODY.lastChild),this.wtTable.tbodyChildrenLength--}},{}),window.WalkontableTableRenderer=h},{"helpers/dom/element":45}],22:[function(e,t,n){"use strict";Object.defineProperties(n,{WalkontableViewport:{get:function(){return v}},__esModule:{value:!0}});var o,r,i,s,a=(o=e("helpers/dom/element"),o&&o.__esModule&&o||{"default":o}),l=a.getScrollbarWidth,u=a.getScrollTop,c=a.getStyle,d=a.offset,h=a.outerHeight,f=a.outerWidth,p=(r=e("eventManager"),r&&r.__esModule&&r||{"default":r}).EventManager,g=(i=e("calculator/viewportColumns"),i&&i.__esModule&&i||{"default":i}).WalkontableViewportColumnsCalculator,m=(s=e("calculator/viewportRows"),s&&s.__esModule&&s||{"default":s}).WalkontableViewportRowsCalculator,v=function(e){var t=this;this.wot=e,this.instance=this.wot,this.oversizedRows=[],this.oversizedColumnHeaders=[],this.isMarkedOversizedColumn={},this.clientHeight=0,this.containerWidth=NaN,this.rowHeaderWidth=NaN,this.rowsVisibleCalculator=null,this.columnsVisibleCalculator=null,this.eventManager=new p(this.wot),this.eventManager.addEventListener(window,"resize",function(){t.clientHeight=t.getWorkspaceHeight()})};$traceurRuntime.createClass(v,{getWorkspaceHeight:function(){var e,t=this.instance.wtOverlays.topOverlay.trimmingContainer,n=0;return t===window?n=document.documentElement.clientHeight:(e=h(t),n=e>0&&t.clientHeight>0?t.clientHeight:1/0),n},getWorkspaceWidth:function(){var e,t,n=this.instance.getSetting("totalColumns"),o=this.instance.wtOverlays.leftOverlay.trimmingContainer,r=this.instance.getSetting("stretchH"),i=document.documentElement.offsetWidth;return e=Handsontable.freezeOverlays?Math.min(i-this.getWorkspaceOffset().left,i):Math.min(this.getContainerFillWidth(),i-this.getWorkspaceOffset().left,i),o===window&&n>0&&this.sumColumnWidths(0,n-1)>e?document.documentElement.clientWidth:o!==window&&(t=c(this.instance.wtOverlays.leftOverlay.trimmingContainer,"overflow"),"scroll"==t||"hidden"==t||"auto"==t)?Math.max(e,o.clientWidth):"none"!==r&&r?e:Math.max(e,f(this.instance.wtTable.TABLE))},hasVerticalScroll:function(){return this.getWorkspaceActualHeight()>this.getWorkspaceHeight()},hasHorizontalScroll:function(){return this.getWorkspaceActualWidth()>this.getWorkspaceWidth()},sumColumnWidths:function(e,t){for(var n=0;t>e;)n+=this.wot.wtTable.getColumnWidth(e),e++;return n},getContainerFillWidth:function(){if(this.containerWidth)return this.containerWidth;var e,t,n=this.instance.wtTable.holder;return t=document.createElement("div"),t.style.width="100%",t.style.height="1px",n.appendChild(t),e=t.offsetWidth,this.containerWidth=e,n.removeChild(t),e},getWorkspaceOffset:function(){return d(this.wot.wtTable.TABLE)},getWorkspaceActualHeight:function(){return h(this.wot.wtTable.TABLE)},getWorkspaceActualWidth:function(){return f(this.wot.wtTable.TABLE)||f(this.wot.wtTable.TBODY)||f(this.wot.wtTable.THEAD)},getColumnHeaderHeight:function(){return isNaN(this.columnHeaderHeight)&&(this.columnHeaderHeight=h(this.wot.wtTable.THEAD)),this.columnHeaderHeight},getViewportHeight:function(){var e,t=this.getWorkspaceHeight();return t===1/0?t:(e=this.getColumnHeaderHeight(),e>0&&(t-=e),t)},getRowHeaderWidth:function(){if(this.wot.cloneSource)return this.wot.cloneSource.wtViewport.getRowHeaderWidth();if(isNaN(this.rowHeaderWidth)){var e=this.instance.getSetting("rowHeaders");if(e.length){var t=this.instance.wtTable.TABLE.querySelector("TH");this.rowHeaderWidth=0;for(var n=0,o=e.length;o>n;n++)t?(this.rowHeaderWidth+=f(t),t=t.nextSibling):this.rowHeaderWidth+=50}else this.rowHeaderWidth=0}return this.rowHeaderWidth},getViewportWidth:function(){var e,t=this.getWorkspaceWidth();return t===1/0?t:(e=this.getRowHeaderWidth(),e>0?t-e:t)},createRowsCalculator:function(){var e,t,n,o,r,i,s,a=void 0!==arguments[0]?arguments[0]:!1,c=this;return this.rowHeaderWidth=NaN,e=this.wot.wtSettings.settings.renderAllRows?1/0:this.getViewportHeight(),t=u(this.wot.wtOverlays.mainTableScrollableElement)-this.wot.wtOverlays.topOverlay.getTableParentOffset(),0>t&&(t=0),n=this.wot.getSetting("fixedRowsTop"),r=this.wot.getSetting("fixedRowsBottom"),s=this.wot.getSetting("totalRows"),n&&(i=this.wot.wtOverlays.topOverlay.sumCellSizes(0,n),t+=i,e-=i),r&&this.wot.wtOverlays.bottomOverlay.clone&&(i=this.wot.wtOverlays.bottomOverlay.sumCellSizes(s-r,s),e-=i),o=this.wot.wtTable.holder.clientHeight===this.wot.wtTable.holder.offsetHeight?0:l(),new m(e,t,this.wot.getSetting("totalRows"),function(e){return c.wot.wtTable.getRowHeight(e)},a?null:this.wot.wtSettings.settings.viewportRowCalculatorOverride,a,o)},createColumnsCalculator:function(){var e,t,n=void 0!==arguments[0]?arguments[0]:!1,o=this,r=this.getViewportWidth();if(this.columnHeaderHeight=NaN,e=this.wot.wtOverlays.leftOverlay.getScrollPosition()-this.wot.wtOverlays.leftOverlay.getTableParentOffset(),0>e&&(e=0),t=this.wot.getSetting("fixedColumnsLeft")){var i=this.wot.wtOverlays.leftOverlay.sumCellSizes(0,t);e+=i,r-=i}return this.wot.wtTable.holder.clientWidth!==this.wot.wtTable.holder.offsetWidth&&(r-=l()),new g(r,e,this.wot.getSetting("totalColumns"),function(e){return o.wot.wtTable.getColumnWidth(e)},n?null:this.wot.wtSettings.settings.viewportColumnCalculatorOverride,n,this.wot.getSetting("stretchH"))},createRenderCalculators:function(){var e=void 0!==arguments[0]?arguments[0]:!1;if(e){var t=this.createRowsCalculator(!0),n=this.createColumnsCalculator(!0);this.areAllProposedVisibleRowsAlreadyRendered(t)&&this.areAllProposedVisibleColumnsAlreadyRendered(n)||(e=!1)}return e||(this.rowsRenderCalculator=this.createRowsCalculator(),this.columnsRenderCalculator=this.createColumnsCalculator()),this.rowsVisibleCalculator=null,this.columnsVisibleCalculator=null,e},createVisibleCalculators:function(){this.rowsVisibleCalculator=this.createRowsCalculator(!0),this.columnsVisibleCalculator=this.createColumnsCalculator(!0)},areAllProposedVisibleRowsAlreadyRendered:function(e){return this.rowsVisibleCalculator?e.startRow0?!1:e.endRow>this.rowsRenderCalculator.endRow||e.endRow===this.rowsRenderCalculator.endRow&&e.endRow0?!1:e.endColumn>this.columnsRenderCalculator.endColumn||e.endColumn===this.columnsRenderCalculator.endColumn&&e.endColumn=0;s--)if(null===e[s])e.splice(s,1);else{var a=e[s][0],l=d.propToCol(e[s][1]),u=m.runHooks("modifyCol",l),c=m.getCellMeta(a,u);if("numeric"===c.type&&"string"==typeof e[s][3]&&e[s][3].length>0&&(/^-?[\d\s]*(\.|\,)?\d*$/.test(e[s][3])||c.format)){var h=e[s][3].length;"undefined"==typeof c.language?R.language("en"):e[s][3].indexOf(".")===h-3&&-1===e[s][3].indexOf(",")?R.language("en"):R.language(c.language),R.validate(e[s][3])&&(e[s][3]=R().unformat(e[s][3]))}m.getCellValidator(c)&&(i.addValidatorToQueue(),m.validateCell(e[s][3],c,function(t,n){return function(o){if("boolean"!=typeof o)throw new Error("Validation error: result is not boolean");o===!1&&n.allowInvalid===!1&&(e.splice(t,1),n.valid=!0,--t),i.removeValidatorFormQueue(); +}}(s,c),t))}i.checkIfQueueIsEmpty()}function r(e,t){var n=e.length-1;if(!(0>n)){for(;n>=0;n--)if(null!==e[n]){if(null!=e[n][2]||null!=e[n][3]){if(c.settings.allowInsertRow)for(;e[n][0]>m.countRows()-1;)d.createRow();if("array"===m.dataType&&c.settings.allowInsertColumn)for(;d.propToCol(e[n][1])>m.countCols()-1;)d.createCol();d.set(e[n][0],e[n][1],e[n][3])}}else e.splice(n,1);m.forceFullRender=!0,f.adjustRowsAndCols(),Handsontable.hooks.run(m,"beforeChangeRender",e,t),p.refreshBorders(null,!0),m.view.wt.wtOverlays.adjustElementsSize(),Handsontable.hooks.run(m,"afterChange",e,t||"edit")}}function i(e,t,n){return"object"==typeof e?e:[[e,t,n]]}function s(e){if(e.hasOwnProperty("type")){var t,n={};if("object"==typeof e.type)t=e.type;else if("string"==typeof e.type&&(t=Handsontable.cellTypes[e.type],void 0===t))throw new Error('You declared cell type "'+e.type+'" as a string that is not mapped to a known object. Cell type must be an object or a string mapped to an object in Handsontable.cellTypes');for(var o in t)t.hasOwnProperty(o)&&!e.hasOwnProperty(o)&&(n[o]=t[o]);return n}}function a(e){return Handsontable.hooks.run(m,"modifyRow",e)}function l(e){return Handsontable.hooks.run(m,"modifyCol",e)}function u(){throw new Error("This method cannot be called because this Handsontable instance has been destroyed")}var c,d,h,f,p,g,m=this,v=function(){},w=D(m);x(v.prototype,Z.prototype),x(v.prototype,t),x(v.prototype,s(t)),this.rootElement=e,this.isHotTableEnv=T(this.rootElement),Handsontable.eventManager.isHotTableEnv=this.isHotTableEnv,this.container=document.createElement("DIV"),this.renderCall=!1,e.insertBefore(this.container,e.firstChild),this.guid="ht_"+B(),this.rootElement.id&&"ht_"!==this.rootElement.id.substring(0,3)||(this.rootElement.id=this.guid),c={cellSettings:[],columnSettings:[],columnsSettingConflicts:["data","width"],settings:new v,selRange:null,isPopulated:null,scrollable:null,firstRun:!0},f={alter:function(e,t,n,o,r){var i;switch(n=n||1,e){case"insert_row":if(m.getSettings().maxRows===m.countSourceRows())return;i=d.createRow(t,n),i&&(p.isSelected()&&c.selRange.from.row>=t?(c.selRange.from.row=c.selRange.from.row+i,p.transformEnd(i,0)):p.refreshBorders());break;case"insert_col":if(i=d.createCol(t,n)){if(Array.isArray(m.getSettings().colHeaders)){var s=[t,0];s.length+=i,Array.prototype.splice.apply(m.getSettings().colHeaders,s)}p.isSelected()&&c.selRange.from.col>=t?(c.selRange.from.col=c.selRange.from.col+i,p.transformEnd(0,i)):p.refreshBorders()}break;case"remove_row":d.removeRow(t,n),c.cellSettings.splice(t,n);var a=m.countRows(),l=m.getSettings().fixedRowsTop;l>=t+1&&(m.getSettings().fixedRowsTop-=Math.min(n,l-t));var u=m.getSettings().fixedRowsBottom;u&&t+1>=a-u&&(m.getSettings().fixedRowsBottom-=Math.min(n,u-t)),f.adjustRowsAndCols(),p.refreshBorders();break;case"remove_col":d.removeCol(t,n);for(var h=0,g=d.getAll().length;g>h;h++)h in c.cellSettings&&c.cellSettings[h].splice(t,n);var v=m.getSettings().fixedColumnsLeft;v>=t+1&&(m.getSettings().fixedColumnsLeft-=Math.min(n,v-t)),Array.isArray(m.getSettings().colHeaders)&&("undefined"==typeof t&&(t=-1),m.getSettings().colHeaders.splice(t,n)),f.adjustRowsAndCols(),p.refreshBorders();break;default:throw new Error('There is no such action "'+e+'"')}r||f.adjustRowsAndCols()},adjustRowsAndCols:function(){if(c.settings.minRows){var e=m.countRows();if(et;t++)d.createRow(m.countRows(),1,!0)}if(c.settings.minSpareRows){var o=m.countEmptyRows(!0);if(oi-1?(l=i-1,a=!0,h>l&&(h=l)):h>i-1&&(h=i-1,a=!0,l>h&&(l=h)),u>s-1?(u=s-1,a=!0,f>u&&(f=u)):f>s-1&&(f=s-1,a=!0,u>f&&(u=f)),a&&m.selectCell(l,u,h,f)}m.view&&m.view.wt.wtOverlays.adjustElementsSize()},populateFromArray:function(e,t,n,o,r,i,s){var a,l,u,d,h=[],f={};if(l=t.length,0===l)return!1;var p,g,v,w;({row:null===n?null:n.row,col:null===n?null:n.col});switch(r){case"shift_down":for(p=n?n.col-e.col+1:0,g=n?n.row-e.row+1:0,t=U(t),u=0,d=t.length,v=Math.max(d,p);v>u;u++)if(d>u){for(a=0,l=t[u].length;g-l>a;a++)t[u].push(t[u][a%l]);t[u].unshift(e.col+u,e.row,0),m.spliceCol.apply(m,t[u])}else t[u%d][0]=e.col+u,m.spliceCol.apply(m,t[u%d]);break;case"shift_right":for(p=n?n.col-e.col+1:0,g=n?n.row-e.row+1:0,a=0,l=t.length,w=Math.max(l,g);w>a;a++)if(l>a){for(u=0,d=t[a].length;p-d>u;u++)t[a].push(t[a][u%d]);t[a].unshift(e.row+a,e.col,0),m.spliceRow.apply(m,t[a])}else t[a%l][0]=e.row+a,m.spliceRow.apply(m,t[a%l]);break;case"overwrite":default:f.row=e.row,f.col=e.col;var y,b={row:n&&e?n.row-e.row+1:1,col:n&&e?n.col-e.col+1:1},C=0,R=0,_=!0,S=function(e){var n=void 0!==arguments[1]?arguments[1]:null,o=t[e%t.length];return null!==n?o[n%o.length]:o},E=t.length,T=n?n.row-e.row+1:0;for(l=n?T:Math.max(E,T),a=0;l>a&&!(n&&f.row>n.row&&T>E||!c.settings.allowInsertRow&&f.row>m.countRows()-1||f.row>=c.settings.maxRows);a++){var O=a-C,M=S(O).length,k=n?n.col-e.col+1:0;if(d=n?k:Math.max(M,k),f.col=e.col,y=m.getCellMeta(f.row,f.col),"paste"!==o&&"autofill"!==o||!y.skipRowOnPaste){for(R=0,u=0;d>u&&!(n&&f.col>n.col&&k>M||!c.settings.allowInsertColumn&&f.col>m.countCols()-1||f.col>=c.settings.maxCols);u++)if(y=m.getCellMeta(f.row,f.col),"paste"!==o&&"autofill"!==o||!y.skipColumnOnPaste)if(y.readOnly)f.col++;else{var H=u-R,D=S(O,H),A=m.getDataAtCell(f.row,f.col),x={row:O,col:H};if("autofill"===o){var W=m.runHooks("beforeAutofillInsidePopulate",x,i,t,s,{},b);W&&(D="undefined"==typeof W.value?D:W.value)}if(null!==D&&"object"==typeof D)if(null===A||"object"!=typeof A)_=!1;else{var I=P(A[0]||A),j=P(D[0]||D);N(I,j)?D=L(D):_=!1}else null!==A&&"object"==typeof A&&(_=!1);_&&h.push([f.row,f.col,D]),_=!0,f.col++}else R++,f.col++,d++;f.row++}else C++,f.row++,l++}m.setDataAtCell(h,null,null,o||"populateFromArray")}}},this.selection=p={inProgress:!1,selectedHeader:{cols:!1,rows:!1},setSelectedHeaders:function(e,t){m.selection.selectedHeader.rows=e,m.selection.selectedHeader.cols=t},begin:function(){m.selection.inProgress=!0},finish:function(){var e=m.getSelected();Handsontable.hooks.run(m,"afterSelectionEnd",e[0],e[1],e[2],e[3]),Handsontable.hooks.run(m,"afterSelectionEndByProp",e[0],m.colToProp(e[1]),e[2],m.colToProp(e[3])),m.selection.inProgress=!1},isInProgress:function(){return m.selection.inProgress},setRangeStart:function(e,t){Handsontable.hooks.run(m,"beforeSetRangeStart",e),c.selRange=new X(e,e,e),p.setRangeEnd(e,null,t)},setRangeEnd:function(e,t,n){if(null!==c.selRange){var o,r=!1,i=!0,s=m.view.wt.wtTable.getFirstVisibleRow(),a=m.view.wt.wtTable.getFirstVisibleColumn(),l={row:null,col:null};Handsontable.hooks.run(m,"beforeSetRangeEnd",e),m.selection.begin(),l.row=e.row<0?s:e.row,l.col=e.col<0?a:e.col,c.selRange.to=new K(l.row,l.col),c.settings.multiSelect||(c.selRange.from=e),m.view.wt.selections.current.clear(),o=m.getCellMeta(c.selRange.highlight.row,c.selRange.highlight.col).disableVisualSelection,"string"==typeof o&&(o=[o]),(o===!1||Array.isArray(o)&&-1===o.indexOf("current"))&&m.view.wt.selections.current.add(c.selRange.highlight),m.view.wt.selections.area.clear(),(o===!1||Array.isArray(o)&&-1===o.indexOf("area"))&&p.isMultiple()&&(m.view.wt.selections.area.add(c.selRange.from),m.view.wt.selections.area.add(c.selRange.to)),(c.settings.currentRowClassName||c.settings.currentColClassName)&&(m.view.wt.selections.highlight.clear(),m.view.wt.selections.highlight.add(c.selRange.from),m.view.wt.selections.highlight.add(c.selRange.to)),Handsontable.hooks.run(m,"afterSelection",c.selRange.from.row,c.selRange.from.col,c.selRange.to.row,c.selRange.to.col),Handsontable.hooks.run(m,"afterSelectionByProp",c.selRange.from.row,d.colToProp(c.selRange.from.col),c.selRange.to.row,d.colToProp(c.selRange.to.col)),(0===c.selRange.from.row&&c.selRange.to.row===m.countRows()-1&&m.countRows()>1||0===c.selRange.from.col&&c.selRange.to.col===m.countCols()-1&&m.countCols()>1)&&(r=!0),(e.row<0||e.col<0)&&(i=!1),t!==!1&&!r&&i&&(c.selRange.from&&!p.isMultiple()?m.view.scrollViewport(c.selRange.from):m.view.scrollViewport(e)),p.refreshBorders(null,n)}},refreshBorders:function(e,t){t||g.destroyEditor(e),m.view.render(),p.isSelected()&&!t&&g.prepareEditor()},isMultiple:function(){var e=!(c.selRange.to.col===c.selRange.from.col&&c.selRange.to.row===c.selRange.from.row),t=Handsontable.hooks.run(m,"afterIsMultipleSelection",e);return e?t:void 0},transformStart:function(e,t,n,o){var r,i,s,a,l=new K(e,t),u=0,d=0;m.runHooks("modifyTransformStart",l),r=m.countRows(),i=m.countCols(),a=m.getSettings().fixedRowsBottom,c.selRange.highlight.row+e>r-1?n&&c.settings.minSpareRows>0&&!(a&&c.selRange.highlight.row>=r-a-1)?(m.alter("insert_row",r),r=m.countRows()):c.settings.autoWrapCol&&(l.row=1-r,l.col=c.selRange.highlight.col+l.col==i-1?1-i:1):c.settings.autoWrapCol&&c.selRange.highlight.row+l.row<0&&c.selRange.highlight.col+l.col>=0&&(l.row=r-1,l.col=c.selRange.highlight.col+l.col==0?i-1:-1),c.selRange.highlight.col+l.col>i-1?n&&c.settings.minSpareCols>0?(m.alter("insert_col",i),i=m.countCols()):c.settings.autoWrapRow&&(l.row=c.selRange.highlight.row+l.row==r-1?1-r:1,l.col=1-i):c.settings.autoWrapRow&&c.selRange.highlight.col+l.col<0&&c.selRange.highlight.row+l.row>=0&&(l.row=c.selRange.highlight.row+l.row==0?r-1:-1,l.col=i-1),s=new K(c.selRange.highlight.row+l.row,c.selRange.highlight.col+l.col),s.row<0?(u=-1,s.row=0):s.row>0&&s.row>=r&&(u=1,s.row=r-1),s.col<0?(d=-1,s.col=0):s.col>0&&s.col>=i&&(d=1,s.col=i-1),m.runHooks("afterModifyTransformStart",s,u,d),p.setRangeStart(s,o)},transformEnd:function(e,t){var n,o,r,i=new K(e,t),s=0,a=0;m.runHooks("modifyTransformEnd",i),n=m.countRows(),o=m.countCols(),r=new K(c.selRange.to.row+i.row,c.selRange.to.col+i.col),r.row<0?(s=-1,r.row=0):r.row>0&&r.row>=n&&(s=1,r.row=n-1),r.col<0?(a=-1,r.col=0):r.col>0&&r.col>=o&&(a=1,r.col=o-1),m.runHooks("afterModifyTransformEnd",r,s,a),p.setRangeEnd(r,!0)},isSelected:function(){return null!==c.selRange},inInSelection:function(e){return p.isSelected()?c.selRange.includes(e):!1},deselect:function(){p.isSelected()&&(m.selection.inProgress=!1,c.selRange=null,m.view.wt.selections.current.clear(),m.view.wt.selections.area.clear(),(c.settings.currentRowClassName||c.settings.currentColClassName)&&m.view.wt.selections.highlight.clear(),g.destroyEditor(),p.refreshBorders(),Handsontable.hooks.run(m,"afterDeselect"))},selectAll:function(){c.settings.multiSelect&&(p.setRangeStart(new K(0,0)),p.setRangeEnd(new K(m.countRows()-1,m.countCols()-1),!1))},empty:function(){if(p.isSelected()){var e,t,n=c.selRange.getTopLeftCorner(),o=c.selRange.getBottomRightCorner(),r=[];for(e=n.row;e<=o.row;e++)for(t=n.col;t<=o.col;t++)m.getCellMeta(e,t).readOnly||r.push([e,t,""]);m.setDataAtCell(r)}}},this.init=function(){h=new z(m,c.settings.data),Handsontable.hooks.run(m,"beforeInit"),Handsontable.mobileBrowser&&S(m.rootElement,"mobile"),this.updateSettings(c.settings,!0),this.view=new V(this),g=new H(m,c,p,d),this.forceFullRender=!0,Handsontable.hooks.run(m,"init"),this.view.render(),"object"==typeof c.firstRun&&(Handsontable.hooks.run(m,"afterChange",c.firstRun[0],c.firstRun[1]),c.firstRun=!1),Handsontable.hooks.run(m,"afterInit")},this.validateCell=function(e,t,n,o){function r(e){var o=t.physicalCol,r=t.physicalRow,i=m.getCell(r,o,!0);i&&m.view.wt.wtSettings.settings.cellRenderer(r,o,i),n(e)}var i=m.getCellValidator(t);"[object RegExp]"===Object.prototype.toString.call(i)&&(i=function(e){return function(t,n){n(e.test(t))}}(i)),"function"==typeof i?(e=Handsontable.hooks.run(m,"beforeValidate",e,t.row,t.prop,o),m._registerTimeout(setTimeout(function(){i.call(t,e,function(n){n=Handsontable.hooks.run(m,"afterValidate",n,e,t.row,t.prop,o),t.valid=n,r(n),Handsontable.hooks.run(m,"postAfterValidate",n,e,t.row,t.prop,o)})},0))):(t.valid=!0,r(t.valid))},this.setDataAtCell=function(e,t,n,s){var a,l,u,c=i(e,t,n),h=[];for(a=0,l=c.length;l>a;a++){if("object"!=typeof c[a])throw new Error("Method `setDataAtCell` accepts row number or changes array of arrays as its first parameter");if("number"!=typeof c[a][1])throw new Error("Method `setDataAtCell` accepts row and column number as its parameters. If you want to use object property name, use method `setDataAtRowProp`");u=d.colToProp(c[a][1]),h.push([c[a][0],u,d.get(c[a][0],u),c[a][2]])}s||"object"!=typeof e||(s=t),o(h,s,function(){r(h,s)})},this.setDataAtRowProp=function(e,t,n,s){var a,l,u=i(e,t,n),c=[];for(a=0,l=u.length;l>a;a++)c.push([u[a][0],u[a][1],d.get(u[a][0],u[a][1]),u[a][2]]);s||"object"!=typeof e||(s=t),o(c,s,function(){r(c,s)})},this.listen=function(){Handsontable.activeGuid=m.guid},this.unlisten=function(){Handsontable.activeGuid=null},this.isListening=function(){return Handsontable.activeGuid===m.guid},this.destroyEditor=function(e){p.refreshBorders(e)},this.populateFromArray=function(e,t,n,o,r,i,s,a,l){var u;if("object"!=typeof n||"object"!=typeof n[0])throw new Error("populateFromArray parameter `input` must be an array of arrays");return u="number"==typeof o?new K(o,r):null,f.populateFromArray(new K(e,t),n,u,i,s,a,l)},this.spliceCol=function(e,t,n){return d.spliceCol.apply(d,arguments)},this.spliceRow=function(e,t,n){return d.spliceRow.apply(d,arguments)},this.getSelected=function(){return p.isSelected()?[c.selRange.from.row,c.selRange.from.col,c.selRange.to.row,c.selRange.to.col]:void 0},this.getSelectedRange=function(){return p.isSelected()?c.selRange:void 0},this.render=function(){m.view&&(m.renderCall=!0,m.forceFullRender=!0,p.refreshBorders(null,!0))},this.loadData=function(e){function t(){c.cellSettings.length=0}if("object"==typeof e&&null!==e)e.push&&e.splice||(e=[e]);else{if(null!==e)throw new Error("loadData only accepts array of objects or array of arrays ("+typeof e+" given)");e=[];for(var n,o=0,r=c.settings.startRows;r>o;o++){n=[];for(var i=0,s=c.settings.startCols;s>i;i++)n.push(null);e.push(n)}}c.isPopulated=!1,v.prototype.data=e,Array.isArray(c.settings.dataSchema)||Array.isArray(e[0])?m.dataType="array":"function"==typeof c.settings.dataSchema?m.dataType="function":m.dataType="object",d=new k(m,c,v),h.data=e,h.dataType=m.dataType,h.colToProp=d.colToProp.bind(d),h.propToCol=d.propToCol.bind(d),t(),f.adjustRowsAndCols(),Handsontable.hooks.run(m,"afterLoadData",c.firstRun),c.firstRun?c.firstRun=[null,"loadData"]:(Handsontable.hooks.run(m,"afterChange",null,"loadData"),m.render()),c.isPopulated=!0},this.getData=function(e,t,n,o){return"undefined"==typeof e?d.getAll():d.getRange(new K(e,t),new K(n,o),d.DESTINATION_RENDERER)},this.getCopyableText=function(e,t,n,o){return d.getCopyableText(new K(e,t),new K(n,o))},this.getCopyableData=function(e,t){return d.getCopyable(e,d.colToProp(t))},this.getSchema=function(){return d.getSchema()},this.updateSettings=function(e,t){var n,o;if("undefined"!=typeof e.rows)throw new Error('"rows" setting is no longer supported. do you mean startRows, minRows or maxRows?');if("undefined"!=typeof e.cols)throw new Error('"cols" setting is no longer supported. do you mean startCols, minCols or maxCols?');for(n in e)"data"!==n&&(Handsontable.hooks.getRegistered().indexOf(n)>-1?("function"==typeof e[n]||Array.isArray(e[n]))&&m.addHook(n,e[n]):!t&&e.hasOwnProperty(n)&&(v.prototype[n]=e[n]));if(void 0===e.data&&void 0===c.settings.data?m.loadData(null):void 0!==e.data?m.loadData(e.data):void 0!==e.columns&&d.createMap(),o=m.countCols(),c.cellSettings.length=0,o>0){var r,i;for(n=0;o>n;n++)c.columnSettings[n]=M(v,c.columnsSettingConflicts),r=c.columnSettings[n].prototype,v.prototype.columns&&(i=v.prototype.columns[n],x(r,i),x(r,s(i)))}if("undefined"!=typeof e.cell)for(n in e.cell)if(e.cell.hasOwnProperty(n)){var a=e.cell[n];m.setCellMetaObject(a.row,a.col,a)}if(Handsontable.hooks.run(m,"afterCellMetaReset"),"undefined"!=typeof e.className&&(v.prototype.className&&O(m.rootElement,v.prototype.className),e.className&&S(m.rootElement,e.className)),"undefined"!=typeof e.height){var l=e.height;"function"==typeof l&&(l=l()),m.rootElement.style.height=l+"px"}if("undefined"!=typeof e.width){var u=e.width;"function"==typeof u&&(u=u()),m.rootElement.style.width=u+"px"}l&&(m.rootElement.style.overflow="hidden"),t||Handsontable.hooks.run(m,"afterUpdateSettings"),f.adjustRowsAndCols(),m.view&&!c.firstRun&&(m.forceFullRender=!0,p.refreshBorders(null,!0))},this.getValue=function(){var e=m.getSelected();if(v.prototype.getValue){if("function"==typeof v.prototype.getValue)return v.prototype.getValue.call(m);if(e)return m.getData()[e[0]][v.prototype.getValue]}else if(e)return m.getDataAtCell(e[0],e[1])},this.getSettings=function(){return c.settings},this.clear=function(){p.selectAll(),p.empty()},this.alter=function(e,t,n,o,r){f.alter(e,t,n,o,r)},this.getCell=function(e,t,n){return m.view.getCellAtCoords(new K(e,t),n)},this.getCoords=function(e){return this.view.wt.wtTable.getCoords.call(this.view.wt.wtTable,e)},this.colToProp=function(e){return d.colToProp(e)},this.propToCol=function(e){return d.propToCol(e)},this.getDataAtCell=function(e,t){return d.get(e,d.colToProp(t))},this.getDataAtRowProp=function(e,t){return d.get(e,t)},this.getDataAtCol=function(e){var t=[];return t.concat.apply(t,d.getRange(new K(0,e),new K(c.settings.data.length-1,e),d.DESTINATION_RENDERER))},this.getDataAtProp=function(e){var t,n=[];return t=d.getRange(new K(0,d.propToCol(e)),new K(c.settings.data.length-1,d.propToCol(e)),d.DESTINATION_RENDERER),n.concat.apply(n,t)},this.getSourceData=function(e,t,n,o){var r;return r=void 0===e?h.getData():h.getByRange(new K(e,t),new K(n,o))},this.getSourceDataAtCol=function(e){return h.getAtColumn(e)},this.getSourceDataAtRow=function(e){return h.getAtRow(e)},this.getSourceDataAtCell=function(e,t){return h.getAtCell(e,t)},this.getDataAtRow=function(e){var t=d.getRange(new K(e,0),new K(e,this.countCols()-1),d.DESTINATION_RENDERER);return t[0]},this.getDataType=function(e,t,n,o){var r=this,i=null,s=null;void 0===e&&(e=0,n=this.countRows(),t=0,o=this.countCols()),void 0===n&&(n=e),void 0===o&&(o=t);var a="mixed";return F(Math.min(e,n),Math.max(e,n),function(e){var n=!0;return F(Math.min(t,o),Math.max(t,o),function(t){var o=r.getCellMeta(e,t);return s=o.type,i?n=i===s:i=s,n}),a=n?s:"mixed",n}),a},this.removeCellMeta=function(e,t,n){var o=m.getCellMeta(e,t);void 0!=o[n]&&delete c.cellSettings[e][t][n]},this.setCellMetaObject=function(e,t,n){if("object"==typeof n)for(var o in n)if(n.hasOwnProperty(o)){var r=n[o];this.setCellMeta(e,t,o,r)}},this.setCellMeta=function(e,t,n,o){c.cellSettings[e]||(c.cellSettings[e]=[]),c.cellSettings[e][t]||(c.cellSettings[e][t]=new c.columnSettings[t]),c.cellSettings[e][t][n]=o,Handsontable.hooks.run(m,"afterSetCellMeta",e,t,n,o)},this.getCellsMeta=function(){return W(c.cellSettings)},this.getCellMeta=function(e,t){var n,o=d.colToProp(t),r=e,i=t;if(e=a(e),t=l(t),c.columnSettings[t]||(c.columnSettings[t]=M(v,c.columnsSettingConflicts)),c.cellSettings[e]||(c.cellSettings[e]=[]),c.cellSettings[e][t]||(c.cellSettings[e][t]=new c.columnSettings[t]),n=c.cellSettings[e][t],n.row=e,n.col=t,n.physicalRow=r,n.physicalCol=i,n.prop=o,n.instance=m,Handsontable.hooks.run(m,"beforeGetCellMeta",e,t,n),x(n,s(n)),n.cells){var u=n.cells.call(n,e,t,o);u&&(x(n,u),x(n,s(u)))}return Handsontable.hooks.run(m,"afterGetCellMeta",e,t,n),n},this.isColumnModificationAllowed=function(){return!("object"===m.dataType||m.getSettings().columns)};var y=G("renderer");this.getCellRenderer=function(e,t){var n=y.call(this,e,t);return j(n)},this.getCellEditor=G("editor"),this.getCellValidator=G("validator"),this.validateCells=function(e){var t=new n;t.onQueueEmpty=e;for(var o=m.countRows()-1;o>=0;){for(var r=m.countCols()-1;r>=0;)t.addValidatorToQueue(),m.validateCell(m.getDataAtCell(o,r),m.getCellMeta(o,r),function(e){if("boolean"!=typeof e)throw new Error("Validation error: result is not boolean");e===!1&&(t.valid=!1),t.removeValidatorFormQueue()},"validateCells"),r--;o--}t.checkIfQueueIsEmpty()},this.getRowHeader=function(e){var t=c.settings.rowHeaders;return void 0!==e&&(e=Handsontable.hooks.run(m,"modifyRowHeader",e)),void 0===e?(t=[],F(m.countRows()-1,function(e){t.push(m.getRowHeader(e))})):Array.isArray(t)&&void 0!==t[e]?t=t[e]:"function"==typeof t?t=t(e):t&&"string"!=typeof t&&"number"!=typeof t&&(t=e+1),t},this.hasRowHeaders=function(){return!!c.settings.rowHeaders},this.hasColHeaders=function(){if(void 0!==c.settings.colHeaders&&null!==c.settings.colHeaders)return!!c.settings.colHeaders;for(var e=0,t=m.countCols();t>e;e++)if(m.getColHeader(e))return!0;return!1},this.getColHeader=function(e){if(e=Handsontable.hooks.run(m,"modifyColHeader",e),void 0===e){for(var t=[],n=0,o=m.countCols();o>n;n++)t.push(m.getColHeader(n));return t}var r=e;return e=Handsontable.hooks.run(m,"modifyCol",e),c.settings.columns&&c.settings.columns[e]&&c.settings.columns[e].title?c.settings.columns[e].title:Array.isArray(c.settings.colHeaders)&&void 0!==c.settings.colHeaders[e]?c.settings.colHeaders[e]:"function"==typeof c.settings.colHeaders?c.settings.colHeaders(e):c.settings.colHeaders&&"string"!=typeof c.settings.colHeaders&&"number"!=typeof c.settings.colHeaders?$(r):c.settings.colHeaders},this._getColWidthFromSettings=function(e){var t=m.getCellMeta(0,e),n=t.width;if((void 0===n||n===c.settings.width)&&(n=t.colWidths),void 0!==n&&null!==n){switch(typeof n){case"object":n=n[e];break;case"function":n=n(e)}"string"==typeof n&&(n=parseInt(n,10))}return n},this.getColWidth=function(e){var t=m._getColWidthFromSettings(e);return t=Handsontable.hooks.run(m,"modifyColWidth",t,e),void 0===t&&(t=q.DEFAULT_WIDTH),t},this._getRowHeightFromSettings=function(e){var t=c.settings.rowHeights;if(void 0!==t&&null!==t){switch(typeof t){case"object":t=t[e];break;case"function":t=t(e)}"string"==typeof t&&(t=parseInt(t,10))}return t},this.getRowHeight=function(e){var t=m._getRowHeightFromSettings(e);return t=Handsontable.hooks.run(m,"modifyRowHeight",t,e)},this.countSourceRows=function(){return m.getSourceData()?m.getSourceData().length:0},this.countRows=function(){return d.getLength()},this.countCols=function(){return"object"===m.dataType||"function"===m.dataType?c.settings.columns&&c.settings.columns.length?c.settings.columns.length:d.colToPropCache.length:"array"===m.dataType?c.settings.columns&&c.settings.columns.length?c.settings.columns.length:c.settings.data&&c.settings.data[0]&&c.settings.data[0].length?c.settings.data[0].length:0:void 0},this.getColspanOffset=function(e,t){var n=0;if(m.colspanArray){for(var o=0;e>o;o++)n+=m.colspanArray[t][o]-1||0;return n}for(var n=0,r=m.view.wt.wtTable.THEAD.childNodes.length-t-1,i=m.view.wt.wtTable.THEAD.querySelector("tr:nth-child("+parseInt(r+1,10)+")"),s=m.view.wt.wtSettings.settings.rowHeaders().length,o=s;s+e>o;o++)i.childNodes[o].hasAttribute("colspan")&&(n+=parseInt(i.childNodes[o].getAttribute("colspan"),10)-1);return n},this.getHeaderColspan=function(e,t){var n=m.view.wt.wtTable.THEAD.childNodes.length-t-1,o=m.view.wt.wtSettings.settings.rowHeaders().length,r=m.view.wt.wtTable.THEAD.querySelector("tr:nth-child("+parseInt(n+1,10)+")"),i=o+e-m.view.wt.wtViewport.columnsRenderCalculator.startColumn;return r.childNodes[i].hasAttribute("colspan")?parseInt(r.childNodes[i].getAttribute("colspan"),10):0},this.rowOffset=function(){return m.view.wt.wtTable.getFirstRenderedRow()},this.colOffset=function(){return m.view.wt.wtTable.getFirstRenderedColumn()},this.countRenderedRows=function(){return m.view.wt.drawn?m.view.wt.wtTable.getRenderedRowsCount():-1},this.countVisibleRows=function(){return m.view.wt.drawn?m.view.wt.wtTable.getVisibleRowsCount():-1},this.countRenderedCols=function(){return m.view.wt.drawn?m.view.wt.wtTable.getRenderedColumnsCount():-1},this.countVisibleCols=function(){return m.view.wt.drawn?m.view.wt.wtTable.getVisibleColumnsCount():-1},this.countEmptyRows=function(e){for(var t,n=m.countRows()-1,o=0;n>=0;){if(t=Handsontable.hooks.run(this,"modifyRow",n),m.isEmptyRow(t))o++;else if(e)break;n--}return o},this.countEmptyCols=function(e){if(m.countRows()<1)return 0;for(var t=m.countCols()-1,n=0;t>=0;){if(m.isEmptyCol(t))n++;else if(e)break;t--}return n},this.isEmptyRow=function(e){return c.settings.isEmptyRow.call(m,e)},this.isEmptyCol=function(e){return c.settings.isEmptyCol.call(m,e)},this.selectCell=function(e,t,n,o,r,i){var s;if(i="undefined"==typeof i||i===!0,"number"!=typeof e||0>e||e>=m.countRows())return!1;if("number"!=typeof t||0>t||t>=m.countCols())return!1;if("undefined"!=typeof n){if("number"!=typeof n||0>n||n>=m.countRows())return!1;if("number"!=typeof o||0>o||o>=m.countCols())return!1}return s=new K(e,t),c.selRange=new X(s,s,s),i&&m.listen(),"undefined"==typeof n?p.setRangeEnd(c.selRange.from,r):p.setRangeEnd(new K(n,o),r),m.selection.finish(),!0},this.selectCellByProp=function(e,t,n,o,r){return arguments[1]=d.propToCol(arguments[1]),"undefined"!=typeof arguments[3]&&(arguments[3]=d.propToCol(arguments[3])),m.selectCell.apply(m,arguments)},this.deselectCell=function(){p.deselect()},this.destroy=function(){m._clearTimeouts(),m.view&&m.view.destroy(),h&&h.destroy(),h=null,E(m.rootElement),w.destroy(),Handsontable.hooks.run(m,"afterDestroy"),Handsontable.hooks.destroy(m);for(var e in m)m.hasOwnProperty(e)&&("function"==typeof m[e]?m[e]=u:"guid"!==e&&(m[e]=null));c=null,d=null,f=null,p=null,g=null,m=null,v=null},this.getActiveEditor=function(){return g.getActiveEditor()},this.getPlugin=function(e){return I(this,e)},this.getInstance=function(){return m},this.addHook=function(e,t){Handsontable.hooks.add(e,t,m)},this.hasHook=function(e){return Handsontable.hooks.has(e,m)},this.addHookOnce=function(e,t){Handsontable.hooks.once(e,t,m)},this.removeHook=function(e,t){Handsontable.hooks.remove(e,t,m)},this.runHooks=function(e,t,n,o,r,i,s){return Handsontable.hooks.run(m,e,t,n,o,r,i,s)},this.timeouts=[],this._registerTimeout=function(e){this.timeouts.push(e)},this._clearTimeouts=function(){for(var e=0,t=this.timeouts.length;t>e;e++)clearTimeout(this.timeouts[e])},this.version=Handsontable.version,Handsontable.hooks.run(m,"construct")};var Z=function(){};Z.prototype={data:void 0,dataSchema:void 0,width:void 0,height:void 0,startRows:5,startCols:5,rowHeaders:null,colHeaders:null,colWidths:void 0,rowHeights:void 0,columns:void 0,cells:void 0,cell:[],comments:!1,customBorders:!1,minRows:0,minCols:0,maxRows:1/0,maxCols:1/0,minSpareRows:0,minSpareCols:0,allowInsertRow:!0,allowInsertColumn:!0,allowRemoveRow:!0,allowRemoveColumn:!0,multiSelect:!0,fillHandle:!0,fixedRowsTop:0,fixedRowsBottom:0,fixedColumnsLeft:0,outsideClickDeselects:!0,enterBeginsEditing:!0,enterMoves:{row:1,col:0},tabMoves:{row:0,col:1},autoWrapRow:!1,autoWrapCol:!1,copyRowsLimit:1e3,copyColsLimit:1e3,pasteMode:"overwrite",persistentState:!1,currentRowClassName:void 0,currentColClassName:void 0,className:void 0,tableClassName:void 0,stretchH:"none",isEmptyRow:function(e){var t,n,o,r;for(t=0,n=this.countCols();n>t;t++)if(o=this.getDataAtCell(e,t),""!==o&&null!==o&&"undefined"!=typeof o)return"object"==typeof o?(r=this.getCellMeta(e,t),N(this.getSchema()[r.prop],o)):!1;return!0},isEmptyCol:function(e){var t,n,o;for(t=0,n=this.countRows();n>t;t++)if(o=this.getDataAtCell(t,e),""!==o&&null!==o&&"undefined"!=typeof o)return!1;return!0},observeDOMVisibility:!0,allowInvalid:!0,invalidCellClassName:"htInvalid",placeholder:!1,placeholderCellClassName:"htPlaceholder",readOnlyCellClassName:"htDimmed",renderer:void 0,commentedCellClassName:"htCommentCell",fragmentSelection:!1,readOnly:!1,skipColumnOnPaste:!1,search:!1,type:"text",copyable:!0,editor:void 0,autoComplete:void 0,visibleRows:10,trimDropdown:!0,debug:!1,wordWrap:!0,noWordWrapClassName:"htNoWrap",contextMenu:void 0,contextMenuCopyPaste:void 0,copyPaste:void 0,undo:void 0,columnSorting:void 0,manualColumnMove:void 0,manualColumnResize:void 0,manualRowMove:void 0,manualRowResize:void 0,mergeCells:!1,viewportRowRenderingOffset:"auto",viewportColumnRenderingOffset:"auto",validator:void 0,disableVisualSelection:!1,sortIndicator:!1,manualColumnFreeze:void 0,trimWhitespace:!0,settings:void 0,source:void 0,title:void 0,checkedTemplate:void 0,uncheckedTemplate:void 0,label:void 0,format:void 0,language:void 0,selectOptions:void 0,autoColumnSize:void 0,autoRowSize:void 0,dateFormat:void 0,correctFormat:!1,defaultDate:void 0,strict:void 0,renderAllRows:void 0},Handsontable.DefaultSettings=Z},{"3rdparty/walkontable/src/calculator/viewportColumns":3,"3rdparty/walkontable/src/cell/coords":5,"3rdparty/walkontable/src/cell/range":6,"3rdparty/walkontable/src/selection":18,dataMap:26,dataSource:27,editorManager:28,eventManager:41,"helpers/array":42,"helpers/data":44,"helpers/dom/element":45,"helpers/number":49,"helpers/object":50,"helpers/setting":51,"helpers/string":52,numeral:"numeral",plugins:57,renderers:88,tableView:97}],26:[function(e,t,n){"use strict";function o(e,t,n){this.instance=e,this.priv=t,this.GridSettings=n,this.dataSource=this.instance.getSettings().data,this.dataSource[0]?this.duckSchema=this.recursiveDuckSchema(this.dataSource[0]):this.duckSchema={},this.createMap()}Object.defineProperties(n,{DataMap:{get:function(){return o}},__esModule:{value:!0}});var r,i,s,a,l,u,c,d=(r=e("SheetClip"),r&&r.__esModule&&r||{"default":r})["default"],h=(i=e("helpers/data"),i&&i.__esModule&&i||{"default":i}).cellMethodLookupFactory,f=(s=e("helpers/setting"),s&&s.__esModule&&s||{"default":s}).columnFactory,p=(a=e("helpers/object"),a&&a.__esModule&&a||{"default":a}),g=p.duckSchema,m=p.deepExtend,v=(l=e("helpers/array"),l&&l.__esModule&&l||{"default":l}),w=v.extendArray,y=v.to2dArray,b=(u=e("helpers/number"),u&&u.__esModule&&u||{"default":u}).rangeEach,C=(c=e("multiMap"),c&&c.__esModule&&c||{"default":c}).MultiMap;o.prototype.DESTINATION_RENDERER=1,o.prototype.DESTINATION_CLIPBOARD_GENERATOR=2,o.prototype.recursiveDuckSchema=function(e){return g(e)},o.prototype.recursiveDuckColumns=function(e,t,n){var o,r;if("undefined"==typeof t&&(t=0,n=""),"object"==typeof e&&!Array.isArray(e))for(r in e)e.hasOwnProperty(r)&&(null===e[r]?(o=n+r,this.colToPropCache.push(o),this.propToColCache.set(o,t),t++):t=this.recursiveDuckColumns(e[r],t,r+"."));return t},o.prototype.createMap=function(){var e,t,n=this.getSchema();if("undefined"==typeof n)throw new Error("trying to create `columns` definition but you didnt' provide `schema` nor `data`");this.colToPropCache=[],this.propToColCache=new C;var o=this.instance.getSettings().columns;if(o)for(e=0,t=o.length;t>e;e++)"undefined"!=typeof o[e].data&&(this.colToPropCache[e]=o[e].data,this.propToColCache.set(o[e].data,e));else this.recursiveDuckColumns(n)},o.prototype.colToProp=function(e){return e=Handsontable.hooks.run(this.instance,"modifyCol",e),this.colToPropCache&&"undefined"!=typeof this.colToPropCache[e]?this.colToPropCache[e]:e},o.prototype.propToCol=function(e){var t;return t="undefined"==typeof this.propToColCache.get(e)?e:this.propToColCache.get(e),t=Handsontable.hooks.run(this.instance,"modifyCol",t)},o.prototype.getSchema=function(){var e=this.instance.getSettings().dataSchema;return e?"function"==typeof e?e():e:this.duckSchema},o.prototype.createRow=function(e,t,n){var o,r,i=this.instance.countCols(),s=0;t||(t=1),("number"!=typeof e||e>=this.instance.countSourceRows())&&(e=this.instance.countSourceRows()),r=e;for(var a=this.instance.getSettings().maxRows;t>s&&this.instance.countSourceRows()l;l++)o.push(null)}else"function"===this.instance.dataType?o=this.instance.getSettings().dataSchema(e):(o={}, +m(o,this.getSchema()));e===this.instance.countSourceRows()?this.dataSource.push(o):this.dataSource.splice(e,0,o),s++,r++}return Handsontable.hooks.run(this.instance,"afterCreateRow",e,s,n),this.instance.forceFullRender=!0,s},o.prototype.createCol=function(e,t,n){if(!this.instance.isColumnModificationAllowed())throw new Error("Cannot create new column. When data source in an object, you can only have as much columns as defined in first data row, data schema or in the 'columns' setting.If you want to be able to add new columns, you have to use array datasource.");var o,r,i=this.instance.countSourceRows(),s=this.dataSource,a=0;t||(t=1),r=e;for(var l=this.instance.getSettings().maxCols;t>a&&this.instance.countCols()=this.instance.countCols()){for(var u=0;i>u;u++)"undefined"==typeof s[u]&&(s[u]=[]),s[u].push(null);this.priv.columnSettings.push(o)}else{for(var u=0;i>u;u++)s[u].splice(r,0,null);this.priv.columnSettings.splice(r,0,o)}a++,r++}return Handsontable.hooks.run(this.instance,"afterCreateCol",e,a,n),this.instance.forceFullRender=!0,a},o.prototype.removeRow=function(e,t){t||(t=1),"number"!=typeof e&&(e=-t),e=(this.instance.countSourceRows()+e)%this.instance.countSourceRows();var n=this.physicalRowsToLogical(e,t),o=Handsontable.hooks.run(this.instance,"beforeRemoveRow",e,t,n);if(o!==!1){var r=this.dataSource,i=r.filter(function(e,t){return-1==n.indexOf(t)});r.length=0,Array.prototype.push.apply(r,i),Handsontable.hooks.run(this.instance,"afterRemoveRow",e,t,n),this.instance.forceFullRender=!0}},o.prototype.removeCol=function(e,t){if("object"===this.instance.dataType||this.instance.getSettings().columns)throw new Error("cannot remove column with object data source or columns option specified");t||(t=1),"number"!=typeof e&&(e=-t),e=(this.instance.countCols()+e)%this.instance.countCols();var n=Handsontable.hooks.run(this.instance,"beforeRemoveCol",e,t);if(n!==!1){for(var o=this.dataSource,r=0,i=this.instance.countSourceRows();i>r;r++)o[r].splice(e,t);this.priv.columnSettings.splice(e,t),Handsontable.hooks.run(this.instance,"afterRemoveCol",e,t),this.instance.forceFullRender=!0}},o.prototype.spliceCol=function(e,t,n){var o=4<=arguments.length?[].slice.call(arguments,3):[],r=this.instance.getDataAtCol(e),i=r.slice(t,t+n),s=r.slice(t+n);w(o,s);for(var a=0;n>a;)o.push(null),a++;return y(o),this.instance.populateFromArray(t,e,o,null,null,"spliceCol"),i},o.prototype.spliceRow=function(e,t,n){var o=4<=arguments.length?[].slice.call(arguments,3):[],r=this.instance.getSourceDataAtRow(e),i=r.slice(t,t+n),s=r.slice(t+n);w(o,s);for(var a=0;n>a;)o.push(null),a++;return this.instance.populateFromArray(e,t,[o],null,null,"spliceRow"),i},o.prototype.get=function(e,t){if(e=Handsontable.hooks.run(this.instance,"modifyRow",e),"string"==typeof t&&t.indexOf(".")>-1){var n=t.split("."),o=this.dataSource[e];if(!o)return null;for(var r=0,i=n.length;i>r;r++)if(o=o[n[r]],"undefined"==typeof o)return null;return o}return"function"==typeof t?t(this.dataSource.slice(e,e+1)[0]):this.dataSource[e]&&this.dataSource[e].hasOwnProperty&&this.dataSource[e].hasOwnProperty(t)?this.dataSource[e][t]:null};var R=h("copyable",!1);o.prototype.getCopyable=function(e,t){return R.call(this.instance,e,this.propToCol(t))?this.get(e,t):""},o.prototype.set=function(e,t,n,o){if(e=Handsontable.hooks.run(this.instance,"modifyRow",e,o||"datamapGet"),"string"==typeof t&&t.indexOf(".")>-1){for(var r=t.split("."),i=this.dataSource[e],s=0,a=r.length-1;a>s;s++)"undefined"==typeof i[r[s]]&&(i[r[s]]={}),i=i[r[s]];i[r[s]]=n}else"function"==typeof t?t(this.dataSource.slice(e,e+1)[0],n):this.dataSource[e][t]=n},o.prototype.physicalRowsToLogical=function(e,t){for(var n,o=this.instance.countSourceRows(),r=(o+e)%o,i=[],s=t;o>r&&s;)n=Handsontable.hooks.run(this.instance,"modifyRow",r),i.push(n),s--,r++;return i},o.prototype.clear=function(){for(var e=0;e=o;o++){a=[];var c=Handsontable.hooks.run(this.instance,"modifyRow",o);for(i=Math.min(e.col,t.col);s>=i;i++){if(null===c)break;a.push(u.call(this,o,this.colToProp(i)))}null!==c&&l.push(a)}return l},o.prototype.getText=function(e,t){return d.stringify(this.getRange(e,t,this.DESTINATION_RENDERER))},o.prototype.getCopyableText=function(e,t){return d.stringify(this.getRange(e,t,this.DESTINATION_CLIPBOARD_GENERATOR))},Handsontable.DataMap=o},{SheetClip:"SheetClip","helpers/array":42,"helpers/data":44,"helpers/number":49,"helpers/object":50,"helpers/setting":51,multiMap:55}],27:[function(e,t,n){"use strict";Object.defineProperties(n,{DataSource:{get:function(){return f}},__esModule:{value:!0}});var o,r,i,s,a,l=((o=e("helpers/data"),o&&o.__esModule&&o||{"default":o}).cellMethodLookupFactory,(r=e("helpers/setting"),r&&r.__esModule&&r||{"default":r}).columnFactory,i=e("helpers/object"),i&&i.__esModule&&i||{"default":i}),u=(l.duckSchema,l.deepExtend,l.getProperty),c=(s=e("helpers/array"),s&&s.__esModule&&s||{"default":s}),d=(c.extendArray,c.arrayEach),h=(a=e("helpers/number"),a&&a.__esModule&&a||{"default":a}).rangeEach,f=function(e,t){this.hot=e,this.data=t,this.dataType="array",this.colToProp=function(){},this.propToCol=function(){}};$traceurRuntime.createClass(f,{getData:function(){return this.data},getAtColumn:function(e){var t=this,n=[];return d(this.data,function(o){var r=t.colToProp(e);o="string"==typeof r?u(o,r):o[r],n.push(o)}),n},getAtRow:function(e){return this.data[e]},getAtCell:function(e,t){return this.data[e][this.colToProp(t)]},getByRange:function(e,t){var n=this,o=Math.min(e.row,t.row),r=Math.min(e.col,t.col),i=Math.max(e.row,t.row),s=Math.max(e.col,t.col),a=[];return h(o,i,function(e){var t,o=n.getAtRow(e);"array"===n.dataType?t=o.slice(r,s):"object"===n.dataType&&(t={},h(r,s,function(e){var r=n.colToProp(e);t[r]=o[r]})),a.push(t)}),a},destroy:function(){this.data=null,this.hot=null}},{})},{"helpers/array":42,"helpers/data":44,"helpers/number":49,"helpers/object":50,"helpers/setting":51}],28:[function(e,t,n){"use strict";function o(e,t,n){function o(e){var o="function"==typeof t.settings.enterMoves?t.settings.enterMoves(event):t.settings.enterMoves;e?n.transformStart(-o.row,-o.col):n.transformStart(o.row,o.col,!0)}function r(e){e?n.transformEnd(-1,0):n.transformStart(-1,0)}function i(e){e?n.transformEnd(1,0):n.transformStart(1,0)}function s(e){e?n.transformEnd(0,1):n.transformStart(0,1)}function a(e){e?n.transformEnd(0,-1):n.transformStart(0,-1)}function l(l){var c,p;if(e.isListening()&&(Handsontable.hooks.run(e,"beforeKeyDown",l),!C&&!v(l)&&(t.lastKeyCode=l.keyCode,n.isSelected()))){if(c=(l.ctrlKey||l.metaKey)&&!l.altKey,y&&!y.isWaiting()&&!(h(l.keyCode)||f(l.keyCode)||c||b.isEditorOpened()))return void b.openEditor("",l);switch(p=l.shiftKey?n.setRangeEnd:n.setRangeStart,l.keyCode){case d.A:!b.isEditorOpened()&&c&&(n.selectAll(),l.preventDefault(),g(l));break;case d.ARROW_UP:b.isEditorOpened()&&!y.isWaiting()&&b.closeEditorAndSaveChanges(c),r(l.shiftKey),l.preventDefault(),g(l);break;case d.ARROW_DOWN:b.isEditorOpened()&&!y.isWaiting()&&b.closeEditorAndSaveChanges(c),i(l.shiftKey),l.preventDefault(),g(l);break;case d.ARROW_RIGHT:b.isEditorOpened()&&!y.isWaiting()&&b.closeEditorAndSaveChanges(c),s(l.shiftKey),l.preventDefault(),g(l);break;case d.ARROW_LEFT:b.isEditorOpened()&&!y.isWaiting()&&b.closeEditorAndSaveChanges(c),a(l.shiftKey),l.preventDefault(),g(l);break;case d.TAB:var w="function"==typeof t.settings.tabMoves?t.settings.tabMoves(l):t.settings.tabMoves;l.shiftKey?n.transformStart(-w.row,-w.col):n.transformStart(w.row,w.col,!0),l.preventDefault(),g(l);break;case d.BACKSPACE:case d.DELETE:n.empty(l),b.prepareEditor(),l.preventDefault();break;case d.F2:b.openEditor(null,l),y&&y.enableFullEditMode(),l.preventDefault();break;case d.ENTER:b.isEditorOpened()?(y&&y.state!==Handsontable.EditorState.WAITING&&b.closeEditorAndSaveChanges(c),o(l.shiftKey)):e.getSettings().enterBeginsEditing?(b.openEditor(null,l),y&&y.enableFullEditMode()):o(l.shiftKey),l.preventDefault(),m(l);break;case d.ESCAPE:b.isEditorOpened()&&b.closeEditorAndRestoreOriginalValue(c),l.preventDefault();break;case d.HOME:p(l.ctrlKey||l.metaKey?new u(0,t.selRange.from.col):new u(t.selRange.from.row,0)),l.preventDefault(),g(l);break;case d.END:p(l.ctrlKey||l.metaKey?new u(e.countRows()-1,t.selRange.from.col):new u(t.selRange.from.row,e.countCols()-1)),l.preventDefault(),g(l);break;case d.PAGE_UP:n.transformStart(-e.countVisibleRows(),0),l.preventDefault(),g(l);break;case d.PAGE_DOWN:n.transformStart(e.countVisibleRows(),0),l.preventDefault(),g(l)}}}function c(){function t(e,t,n){"TD"==n.nodeName&&(b.openEditor(),y&&y.enableFullEditMode())}e.addHook("afterDocumentKeyDown",l),p.addEventListener(document.documentElement,"keydown",function(t){e.runHooks("afterDocumentKeyDown",t)}),e.view.wt.update("onCellDblClick",t),e.addHook("afterDestroy",function(){C=!0})}var p,y,b=this,C=!1;p=w(e),this.destroyEditor=function(e){this.closeEditor(e)},this.getActiveEditor=function(){return y},this.prepareEditor=function(){var n,o,r,i,s,a,l;return y&&y.isWaiting()?void this.closeEditor(!1,!1,function(e){e&&b.prepareEditor()}):(n=t.selRange.highlight.row,o=t.selRange.highlight.col,r=e.colToProp(o),i=e.getCell(n,o),s=e.getDataAtCell(n,o),a=e.getCellMeta(n,o),l=e.getCellEditor(a),void(l?(y=Handsontable.editors.getEditor(l,e),y.prepare(n,o,r,i,s,a)):y=void 0))},this.isEditorOpened=function(){return y&&y.isOpened()},this.openEditor=function(e,t){y&&!y.cellProperties.readOnly?y.beginEditing(e,t):y&&y.cellProperties.readOnly&&t&&t.keyCode===d.ENTER&&o()},this.closeEditor=function(e,t,n){y?y.finishEditing(e,t,n):n&&n(!1)},this.closeEditorAndSaveChanges=function(e){return this.closeEditor(!1,e)},this.closeEditorAndRestoreOriginalValue=function(e){return this.closeEditor(!0,e)},c()}Object.defineProperties(n,{EditorManager:{get:function(){return o}},__esModule:{value:!0}});var r,i,s,a,l,u=(r=e("3rdparty/walkontable/src/cell/coords"),r&&r.__esModule&&r||{"default":r}).WalkontableCellCoords,c=(i=e("helpers/unicode"),i&&i.__esModule&&i||{"default":i}),d=c.KEY_CODES,h=c.isMetaKey,f=c.isCtrlKey,p=(s=e("helpers/dom/event"),s&&s.__esModule&&s||{"default":s}),g=p.stopPropagation,m=p.stopImmediatePropagation,v=p.isImmediatePropagationStopped,w=((a=e("editors"),a&&a.__esModule&&a||{"default":a}).getEditor,(l=e("eventManager"),l&&l.__esModule&&l||{"default":l}).eventManager);Handsontable.EditorManager=o},{"3rdparty/walkontable/src/cell/coords":5,editors:29,eventManager:41,"helpers/dom/event":46,"helpers/unicode":53}],29:[function(e,t,n){"use strict";function o(e){var t,n;n={},t=e,this.getConstructor=function(){return e},this.getInstance=function(e){return e.guid in n||(n[e.guid]=new t(e)),n[e.guid]}}function r(e,t){var n=new o(t);"string"==typeof e&&(c[e]=n,Handsontable.editors[u(e)+"Editor"]=t),d.set(t,n)}function i(e,t){var n;if("function"==typeof e)d.get(e)||r(null,e),n=d.get(e);else{if("string"!=typeof e)throw Error('Only strings and functions can be passed as "editor" parameter ');n=c[e]}if(!n)throw Error('No editor registered under name "'+e+'"');return n.getInstance(t)}function s(e){var t;if("string"!=typeof e)throw Error('Only strings and functions can be passed as "editor" parameter ');if(t=c[e],!t)throw Error('No editor registered under name "'+e+'"');return t.getConstructor()}function a(e){return c[e]?!0:!1}Object.defineProperties(n,{registerEditor:{get:function(){return r}},getEditor:{get:function(){return i}},hasEditor:{get:function(){return a}},getEditorConstructor:{get:function(){return s}},__esModule:{value:!0}});var l,u=(l=e("helpers/string"),l&&l.__esModule&&l||{"default":l}).toUpperCaseFirst,c={},d=new WeakMap;Handsontable.editors=Handsontable.editors||{},Handsontable.editors.registerEditor=r,Handsontable.editors.getEditor=i},{"helpers/string":52}],30:[function(e,t,n){"use strict";function o(e){this.instance=e,this.state=Handsontable.EditorState.VIRGIN,this._opened=!1,this._fullEditMode=!1,this._closeCallback=null,this.init()}Object.defineProperties(n,{BaseEditor:{get:function(){return o}},__esModule:{value:!0}});var r,i,s=(r=e("helpers/mixed"),r&&r.__esModule&&r||{"default":r}).stringify,a=(i=e("3rdparty/walkontable/src/cell/coords"),i&&i.__esModule&&i||{"default":i}).WalkontableCellCoords;Handsontable.editors=Handsontable.editors||{},Handsontable.editors.BaseEditor=o,Handsontable.EditorState={VIRGIN:"STATE_VIRGIN",EDITING:"STATE_EDITING",WAITING:"STATE_WAITING",FINISHED:"STATE_FINISHED"},o.prototype._fireCallbacks=function(e){this._closeCallback&&(this._closeCallback(e),this._closeCallback=null)},o.prototype.init=function(){},o.prototype.getValue=function(){throw Error("Editor getValue() method unimplemented")},o.prototype.setValue=function(e){throw Error("Editor setValue() method unimplemented")},o.prototype.open=function(){throw Error("Editor open() method unimplemented")},o.prototype.close=function(){throw Error("Editor close() method unimplemented")},o.prototype.prepare=function(e,t,n,o,r,i){this.TD=o,this.row=e,this.col=t,this.prop=n,this.originalValue=r,this.cellProperties=i,this.instance.view.isMouseDown()&&document.activeElement&&document.activeElement!==document.body?document.activeElement.blur():document.activeElement||document.body.focus(),this.state=Handsontable.EditorState.VIRGIN},o.prototype.extend=function(){function e(){n.apply(this,arguments)}function t(e,t){function n(){}return n.prototype=t.prototype,e.prototype=new n,e.prototype.constructor=e,e}var n=this.constructor;return t(e,n)},o.prototype.saveValue=function(e,t){var n,o;t?(n=this.instance.getSelected(),n[0]>n[2]&&(o=n[0],n[0]=n[2],n[2]=o),n[1]>n[3]&&(o=n[1],n[1]=n[3],n[3]=o),this.instance.populateFromArray(n[0],n[1],e,n[2],n[3],"edit")):this.instance.populateFromArray(this.row,this.col,e,null,null,"edit")},o.prototype.beginEditing=function(e,t){this.state==Handsontable.EditorState.VIRGIN&&(this.instance.view.scrollViewport(new a(this.row,this.col)),this.instance.view.render(),this.state=Handsontable.EditorState.EDITING,e="string"==typeof e?e:this.originalValue,this.setValue(s(e)),this.open(t),this._opened=!0,this.focus(),this.instance.view.render())},o.prototype.finishEditing=function(e,t,n){var o,r=this;if(n){var i=this._closeCallback;this._closeCallback=function(e){i&&i(e),n(e)}}if(!this.isWaiting()){if(this.state==Handsontable.EditorState.VIRGIN)return void this.instance._registerTimeout(setTimeout(function(){r._fireCallbacks(!0)},0));if(this.state==Handsontable.EditorState.EDITING){if(e)return this.cancelChanges(),void this.instance.view.render();o=this.instance.getSettings().trimWhitespace?[["string"==typeof this.getValue()?String.prototype.trim.call(this.getValue()||""):this.getValue()]]:[[this.getValue()]],this.state=Handsontable.EditorState.WAITING,this.saveValue(o,t),this.instance.getCellValidator(this.cellProperties)?this.instance.addHookOnce("postAfterValidate",function(e){r.state=Handsontable.EditorState.FINISHED,r.discardEditor(e)}):(this.state=Handsontable.EditorState.FINISHED,this.discardEditor(!0))}}},o.prototype.cancelChanges=function(){this.state=Handsontable.EditorState.FINISHED,this.discardEditor()},o.prototype.discardEditor=function(e){this.state===Handsontable.EditorState.FINISHED&&(e===!1&&this.cellProperties.allowInvalid!==!0?(this.instance.selectCell(this.row,this.col),this.focus(),this.state=Handsontable.EditorState.EDITING,this._fireCallbacks(!1)):(this.close(),this._opened=!1,this._fullEditMode=!1,this.state=Handsontable.EditorState.VIRGIN,this._fireCallbacks(!0)))},o.prototype.enableFullEditMode=function(){this._fullEditMode=!0},o.prototype.isInFullEditMode=function(){return this._fullEditMode},o.prototype.isOpened=function(){return this._opened},o.prototype.isWaiting=function(){return this.state===Handsontable.EditorState.WAITING},o.prototype.checkEditorSection=function(){var e=this.instance.countRows(),t="";return this.row=e-this.instance.getSettings().fixedRowsBottom?t=this.col"+a+"")))},autoColumnSize:!0,modifyColWidth:function(e,t){var o=this.getPlugin("autoColumnSize").widths;return o[t]&&(e=o[t]),n?e:e+15}}),this.htEditor.view.wt.wtTable.holder.parentNode.style["padding-right"]=w()+2+"px",T&&(T=!1),t.instance._registerTimeout(setTimeout(function(){t.queryChoices(t.TEXTAREA.value)},0))},E.prototype.close=function(){S.prototype.close.apply(this,arguments)},E.prototype.queryChoices=function(e){if(this.query=e,"function"==typeof this.cellProperties.source){var t=this;this.cellProperties.source(e,function(e){t.updateChoicesList(e)})}else if(Array.isArray(this.cellProperties.source)){var n;if(e&&this.cellProperties.filter!==!1){var o=this.cellProperties.filteringCaseSensitive===!0,r=e.toLowerCase();n=this.cellProperties.source.filter(function(t){return o?-1!=t.indexOf(e):-1!=t.toLowerCase().indexOf(r)})}else n=this.cellProperties.source;this.updateChoicesList(n)}else this.updateChoicesList([])},E.prototype.updateChoicesList=function(e){var t,n=v(this.TEXTAREA),o=y(this.TEXTAREA),r=E.sortByRelevance(this.getValue(),e,this.cellProperties.filteringCaseSensitive);if(0==this.cellProperties.filter)t=r[0];else{for(var i=[],s=0,a=r.length;a>s;s++)i.push(e[r[s]]);t=0,e=i}this.choices=e,this.htEditor.loadData(p([e])),this.updateDropdownHeight(),this.cellProperties.strict===!0&&this.highlightBestMatchingChoice(t),this.instance.listen(),this.TEXTAREA.focus(),C(this.TEXTAREA,n,n==o?void 0:o)},E.prototype.updateDropdownHeight=function(){var e=this.htEditor.getColWidth(0)+w()+2,t=void 0===this.cellProperties.trimDropdown?!0:this.cellProperties.trimDropdown;this.htEditor.updateSettings({height:this.getDropdownHeight(),width:t?void 0:e}),this.htEditor.view.wt.wtTable.alignOverlaysWithTrimmingContainer()},E.prototype.finishEditing=function(e){e||this.instance.removeHook("beforeKeyDown",o),S.prototype.finishEditing.apply(this,arguments)},E.prototype.highlightBestMatchingChoice=function(e){"number"==typeof e?this.htEditor.selectCell(e,0):this.htEditor.deselectCell()},E.sortByRelevance=function(e,t,n){var o,r,i,s,a,l=[],u=e.length,c=[];if(0===u){for(s=0,a=t.length;a>s;s++)c.push(s);return c}for(s=0,a=t.length;a>s;s++)o=f(t[s]),r=n?o.indexOf(e):o.toLowerCase().indexOf(e.toLowerCase()),-1!=r&&(i=o.length-r-u,l.push({baseIndex:s,index:r,charsLeft:i,value:o}));for(l.sort(function(e,t){return-1===t.index?-1:-1===e.index?1:e.indext.charsLeft?1:0:void 0}),s=0,a=l.length;a>s;s++)c.push(l[s].baseIndex);return c},E.prototype.getDropdownHeight=function(){var e=this.htEditor.getInstance().getRowHeight(0)||23,t=this.cellProperties.visibleRows;return this.choices.length>=t?t*e:this.choices.length*e+8},E.prototype.allowKeyEventPropagation=function(e){var t={row:this.htEditor.getSelectedRange()?this.htEditor.getSelectedRange().from.row:-1},n=!1;return e===d.ARROW_DOWN&&t.row-1&&(n=!0),n},_("autocomplete",E)},{editors:29,handsontableEditor:35,"helpers/array":42,"helpers/dom/element":45,"helpers/mixed":48,"helpers/unicode":53}],32:[function(e,t,n){"use strict";Object.defineProperties(n,{CheckboxEditor:{get:function(){return u}},__esModule:{value:!0}});var o,r,i,s=(o=e("editors"),o&&o.__esModule&&o||{"default":o}).registerEditor,a=(r=e("_baseEditor"),r&&r.__esModule&&r||{"default":r}).BaseEditor,l=(i=e("helpers/dom/element"),i&&i.__esModule&&i||{"default":i}).hasClass,u=function(){$traceurRuntime.superConstructor(c).apply(this,arguments)},c=u;$traceurRuntime.createClass(u,{beginEditing:function(){var e=this.TD.querySelector('input[type="checkbox"]');l(e,"htBadValue")||e.click()},finishEditing:function(){},init:function(){},open:function(){},close:function(){},getValue:function(){},setValue:function(){},focus:function(){}},{},a),s("checkbox",u)},{_baseEditor:30,editors:29,"helpers/dom/element":45}],33:[function(e,t,n){"use strict";Object.defineProperties(n,{DateEditor:{get:function(){return S}},__esModule:{value:!0}});var o,r,i,s,a,l,u,c,d,h=(o=e("helpers/dom/element"),o&&o.__esModule&&o||{"default":o}),f=h.addClass,p=h.outerHeight,g=(r=e("helpers/object"),r&&r.__esModule&&r||{"default":r}).deepExtend,m=(i=e("eventManager"),i&&i.__esModule&&i||{"default":i}).EventManager,v=(s=e("editors"),s&&s.__esModule&&s||{"default":s}),w=(v.getEditor,v.registerEditor),y=(a=e("helpers/unicode"),a&&a.__esModule&&a||{"default":a}).isMetaKey,b=(l=e("helpers/dom/event"),l&&l.__esModule&&l||{"default":l}).stopPropagation,C=(u=e("textEditor"),u&&u.__esModule&&u||{"default":u}).TextEditor,R=(c=e("moment"),c&&c.__esModule&&c||{"default":c})["default"],_=(d=e("pikaday"),d&&d.__esModule&&d||{"default":d})["default"];Handsontable.editors=Handsontable.editors||{},Handsontable.editors.DateEditor=S;var S=function(e){this.$datePicker=null,this.datePicker=null,this.datePickerStyle=null,this.defaultDateFormat="DD/MM/YYYY",this.isCellEdited=!1,this.parentDestroyed=!1,$traceurRuntime.superConstructor(E).call(this,e)},E=S;$traceurRuntime.createClass(S,{init:function(){var e=this;if("function"!=typeof R)throw new Error("You need to include moment.js to your project.");if("function"!=typeof _)throw new Error("You need to include Pikaday to your project.");$traceurRuntime.superGet(this,E.prototype,"init").call(this),this.instance.addHook("afterDestroy",function(){e.parentDestroyed=!0,e.destroyElements()})},createElements:function(){$traceurRuntime.superGet(this,E.prototype,"createElements").call(this),this.datePicker=document.createElement("DIV"),this.datePickerStyle=this.datePicker.style,this.datePickerStyle.position="absolute",this.datePickerStyle.top=0,this.datePickerStyle.left=0,this.datePickerStyle.zIndex=9999,f(this.datePicker,"htDatepickerHolder"),document.body.appendChild(this.datePicker),this.$datePicker=new _(this.getDatePickerConfig());var e=new m(this);e.addEventListener(this.datePicker,"mousedown",function(e){return b(e)}),this.hideDatepicker()},destroyElements:function(){this.$datePicker.destroy()},prepare:function(e,t,n,o,r,i){this._opened=!1,$traceurRuntime.superGet(this,E.prototype,"prepare").call(this,e,t,n,o,r,i)},open:function(){var e=void 0!==arguments[0]?arguments[0]:null;$traceurRuntime.superGet(this,E.prototype,"open").call(this),this.showDatepicker(e)},close:function(){var e=this;this._opened=!1,this.instance._registerTimeout(setTimeout(function(){e.instance.selection.refreshBorders()},0)),$traceurRuntime.superGet(this,E.prototype,"close").call(this)},finishEditing:function(){var e=void 0!==arguments[0]?arguments[0]:!1,t=void 0!==arguments[1]?arguments[1]:!1;if(e){var n=this.originalValue;void 0!==n&&this.setValue(n)}this.hideDatepicker(),$traceurRuntime.superGet(this,E.prototype,"finishEditing").call(this,e,t)},showDatepicker:function(e){this.$datePicker.config(this.getDatePickerConfig());var t,n=this.TD.getBoundingClientRect(),o=this.cellProperties.dateFormat||this.defaultDateFormat,r=this.$datePicker.config(),i=this.instance.view.isMouseDown(),s=e?y(e.keyCode):!1;this.datePickerStyle.top=window.pageYOffset+n.top+p(this.TD)+"px",this.datePickerStyle.left=window.pageXOffset+n.left+"px",this.$datePicker._onInputFocus=function(){},r.format=o,this.originalValue?(t=this.originalValue,R(t,o,!0).isValid()&&this.$datePicker.setMoment(R(t,o),!0),s||i||this.setValue("")):this.cellProperties.defaultDate?(t=this.cellProperties.defaultDate,r.defaultDate=t,R(t,o,!0).isValid()&&this.$datePicker.setMoment(R(t,o),!0),s||i||this.setValue("")):this.$datePicker.gotoToday(),this.datePickerStyle.display="block",this.$datePicker.show()},hideDatepicker:function(){this.datePickerStyle.display="none",this.$datePicker.hide()},getDatePickerConfig:function(){var e=this,t=this.TEXTAREA,n={};this.cellProperties&&this.cellProperties.datePickerConfig&&g(n,this.cellProperties.datePickerConfig);var o=n.onSelect,r=n.onClose;return n.field=t,n.trigger=t,n.container=this.datePicker,n.bound=!1,n.format=n.format||this.defaultDateFormat,n.reposition=n.reposition||!1,n.onSelect=function(t){isNaN(t.getTime())||(t=R(t).format(e.cellProperties.dateFormat||e.defaultDateFormat)),e.setValue(t),e.hideDatepicker(),o&&o()},n.onClose=function(){e.parentDestroyed||e.finishEditing(!1),r&&r()},n}},{},C),w("date",S)},{editors:29,eventManager:41,"helpers/dom/element":45,"helpers/dom/event":46,"helpers/object":50,"helpers/unicode":53,moment:"moment",pikaday:"pikaday",textEditor:40}],34:[function(e,t,n){"use strict";Object.defineProperties(n,{DropdownEditor:{get:function(){return l}},__esModule:{value:!0}});var o,r,i=(o=e("editors"),o&&o.__esModule&&o||{"default":o}),s=(i.getEditor,i.registerEditor),a=(r=e("autocompleteEditor"),r&&r.__esModule&&r||{"default":r}).AutocompleteEditor,l=function(){$traceurRuntime.superConstructor(u).apply(this,arguments)},u=l;$traceurRuntime.createClass(l,{prepare:function(e,t,n,o,r,i){$traceurRuntime.superGet(this,u.prototype,"prepare").call(this,e,t,n,o,r,i),this.cellProperties.filter=!1,this.cellProperties.strict=!0}},{},a),Handsontable.hooks.add("beforeValidate",function(e,t,n,o){var r=this.getCellMeta(t,n);r.editor===Handsontable.editors.DropdownEditor&&void 0===r.strict&&(r.filter=!1,r.strict=!0)}),s("dropdown",l)},{autocompleteEditor:31,editors:29}],35:[function(e,t,n){"use strict";Object.defineProperties(n,{HandsontableEditor:{get:function(){return w}},__esModule:{value:!0}});var o,r,i,s,a,l,u=(o=e("helpers/unicode"),o&&o.__esModule&&o||{"default":o}).KEY_CODES,c=(r=e("helpers/object"),r&&r.__esModule&&r||{"default":r}).extend,d=(i=e("helpers/dom/element"),i&&i.__esModule&&i||{"default":i}).setCaretPosition,h=(s=e("helpers/dom/event"),s&&s.__esModule&&s||{"default":s}),f=h.stopImmediatePropagation,p=h.isImmediatePropagationStopped,g=(a=e("editors"),a&&a.__esModule&&a||{"default":a}),m=(g.getEditor,g.registerEditor),v=(l=e("textEditor"),l&&l.__esModule&&l||{"default":l}).TextEditor,w=v.prototype.extend();w.prototype.createElements=function(){v.prototype.createElements.apply(this,arguments);var e=document.createElement("DIV");e.className="handsontableEditor",this.TEXTAREA_PARENT.appendChild(e),this.htContainer=e,this.assignHooks()},w.prototype.prepare=function(e,t,n,o,r,i){v.prototype.prepare.apply(this,arguments);var s=this,a={startRows:0,startCols:0,minRows:0,minCols:0,className:"listbox",copyPaste:!1,autoColumnSize:!1,autoRowSize:!1,readOnly:!0,fillHandle:!1,afterOnCellMouseDown:function(){var e=this.getValue();void 0!==e&&s.setValue(e),s.instance.destroyEditor()}};this.cellProperties.handsontable&&c(a,i.handsontable),this.htOptions=a};var y=function(e){if(!p(e)){var t,n=this.getActiveEditor(),o=n.htEditor.getInstance();if(e.keyCode==u.ARROW_DOWN)if(o.getSelected()){var r=o.getSelected()[0],i=o.countRows()-1;t=Math.min(i,r+1)}else t=0;else if(e.keyCode==u.ARROW_UP&&o.getSelected()){var r=o.getSelected()[0];t=r-1}void 0!==t&&(0>t?o.deselectCell():o.selectCell(t,0),o.getData().length&&(e.preventDefault(),f(e),n.instance.listen(),n.TEXTAREA.focus()))}};w.prototype.open=function(){this.instance.addHook("beforeKeyDown",y),v.prototype.open.apply(this,arguments),this.htEditor&&this.htEditor.destroy(),this.htEditor=new Handsontable(this.htContainer,this.htOptions),this.cellProperties.strict?(this.htEditor.selectCell(0,0),this.TEXTAREA.style.visibility="hidden"):(this.htEditor.deselectCell(),this.TEXTAREA.style.visibility="visible"),d(this.TEXTAREA,0,this.TEXTAREA.value.length)},w.prototype.close=function(){this.instance.removeHook("beforeKeyDown",y),this.instance.listen(),v.prototype.close.apply(this,arguments)},w.prototype.focus=function(){this.instance.listen(),v.prototype.focus.apply(this,arguments)},w.prototype.beginEditing=function(e){var t=this.instance.getSettings().onBeginEditing;t&&t()===!1||v.prototype.beginEditing.apply(this,arguments)},w.prototype.finishEditing=function(e,t){if(this.htEditor&&this.htEditor.isListening()&&this.instance.listen(),this.htEditor&&this.htEditor.getSelected()){var n=this.htEditor.getInstance().getValue();void 0!==n&&this.setValue(n)}return v.prototype.finishEditing.apply(this,arguments)},w.prototype.assignHooks=function(){var e=this;this.instance.addHook("afterDestroy",function(){e.htEditor&&e.htEditor.destroy()})},m("handsontable",w)},{editors:29,"helpers/dom/element":45,"helpers/dom/event":46,"helpers/object":50,"helpers/unicode":53,textEditor:40}],36:[function(e,t,n){"use strict";Object.defineProperties(n,{MobileTextEditor:{get:function(){return M}},__esModule:{value:!0}});var o,r,i,s,a,l,u=(o=e("helpers/unicode"),o&&o.__esModule&&o||{"default":o}).KEY_CODES,c=(r=e("helpers/dom/event"),r&&r.__esModule&&r||{"default":r}),d=c.stopImmediatePropagation,h=c.isImmediatePropagationStopped,f=(i=e("helpers/dom/element"), +i&&i.__esModule&&i||{"default":i}),p=f.addClass,g=f.getScrollLeft,m=f.getScrollTop,v=f.hasClass,w=f.isChildOf,y=f.offset,b=f.outerHeight,C=f.outerWidth,R=f.removeClass,_=f.setCaretPosition,S=(s=e("editors"),s&&s.__esModule&&s||{"default":s}),E=(S.getEditor,S.registerEditor),T=(a=e("_baseEditor"),a&&a.__esModule&&a||{"default":a}).BaseEditor,O=(l=e("eventManager"),l&&l.__esModule&&l||{"default":l}).eventManager,M=T.prototype.extend(),k={},H=function(){this.controls={},this.controls.leftButton=document.createElement("DIV"),this.controls.leftButton.className="leftButton",this.controls.rightButton=document.createElement("DIV"),this.controls.rightButton.className="rightButton",this.controls.upButton=document.createElement("DIV"),this.controls.upButton.className="upButton",this.controls.downButton=document.createElement("DIV"),this.controls.downButton.className="downButton";for(var e in this.controls)this.controls.hasOwnProperty(e)&&this.positionControls.appendChild(this.controls[e])};M.prototype.valueChanged=function(){return this.initValue!=this.getValue()},M.prototype.init=function(){var e=this;this.eventManager=O(this.instance),this.createElements(),this.bindEvents(),this.instance.addHook("afterDestroy",function(){e.destroy()})},M.prototype.getValue=function(){return this.TEXTAREA.value},M.prototype.setValue=function(e){this.initValue=e,this.TEXTAREA.value=e},M.prototype.createElements=function(){this.editorContainer=document.createElement("DIV"),this.editorContainer.className="htMobileEditorContainer",this.cellPointer=document.createElement("DIV"),this.cellPointer.className="cellPointer",this.moveHandle=document.createElement("DIV"),this.moveHandle.className="moveHandle",this.inputPane=document.createElement("DIV"),this.inputPane.className="inputs",this.positionControls=document.createElement("DIV"),this.positionControls.className="positionControls",this.TEXTAREA=document.createElement("TEXTAREA"),p(this.TEXTAREA,"handsontableInput"),this.inputPane.appendChild(this.TEXTAREA),this.editorContainer.appendChild(this.cellPointer),this.editorContainer.appendChild(this.moveHandle),this.editorContainer.appendChild(this.inputPane),this.editorContainer.appendChild(this.positionControls),H.call(this),document.body.appendChild(this.editorContainer)},M.prototype.onBeforeKeyDown=function(e){var t=this,n=t.getActiveEditor();if(e.target===n.TEXTAREA&&!h(e))switch(e.keyCode){case u.ENTER:n.close(),e.preventDefault();break;case u.BACKSPACE:d(e)}},M.prototype.open=function(){this.instance.addHook("beforeKeyDown",this.onBeforeKeyDown),p(this.editorContainer,"active"),R(this.cellPointer,"hidden"),this.updateEditorPosition()},M.prototype.focus=function(){this.TEXTAREA.focus(),_(this.TEXTAREA,this.TEXTAREA.value.length)},M.prototype.close=function(){this.TEXTAREA.blur(),this.instance.removeHook("beforeKeyDown",this.onBeforeKeyDown),R(this.editorContainer,"active")},M.prototype.scrollToView=function(){var e=this.instance.getSelectedRange().highlight;this.instance.view.scrollViewport(e)},M.prototype.hideCellPointer=function(){v(this.cellPointer,"hidden")||p(this.cellPointer,"hidden")},M.prototype.updateEditorPosition=function(e,t){if(e&&t)e=parseInt(e,10),t=parseInt(t,10),this.editorContainer.style.top=t+"px",this.editorContainer.style.left=e+"px";else{var n=this.instance.getSelected(),o=this.instance.getCell(n[0],n[1]);if(k.cellPointer||(k.cellPointer={height:b(this.cellPointer),width:C(this.cellPointer)}),k.editorContainer||(k.editorContainer={width:C(this.editorContainer)}),void 0!==o){var r=this.instance.view.wt.wtOverlays.leftOverlay.trimmingContainer==window?0:g(this.instance.view.wt.wtOverlays.leftOverlay.holder),i=this.instance.view.wt.wtOverlays.topOverlay.trimmingContainer==window?0:m(this.instance.view.wt.wtOverlays.topOverlay.holder),s=y(o),a=C(o),l={x:r,y:i};this.editorContainer.style.top=parseInt(s.top+b(o)-l.y+k.cellPointer.height,10)+"px",this.editorContainer.style.left=parseInt(window.innerWidth/2-k.editorContainer.width/2,10)+"px",s.left+a/2>parseInt(this.editorContainer.style.left,10)+k.editorContainer.width?this.editorContainer.style.left=window.innerWidth-k.editorContainer.width+"px":s.left+a/2n;n++)t[e[n]]=e[n];else"object"==typeof e&&(t=e);return t},S.prototype.getValue=function(){return this.select.value},S.prototype.setValue=function(e){this.select.value=e};var E=function(e){var t=this,n=t.getActiveEditor();switch(e.keyCode){case b.ARROW_UP:var o=n.select.selectedIndex-1;o>=0&&(n.select[o].selected=!0),y(e),e.preventDefault();break;case b.ARROW_DOWN:var r=n.select.selectedIndex+1;r<=n.select.length-1&&(n.select[r].selected=!0),y(e),e.preventDefault()}};S.prototype.open=function(){this._opened=!0,this.refreshDimensions(),this.select.style.display="",this.instance.addHook("beforeKeyDown",E)},S.prototype.close=function(){this._opened=!1,this.select.style.display="none",this.instance.removeHook("beforeKeyDown",E)},S.prototype.focus=function(){this.select.focus()},S.prototype.refreshDimensions=function(){if(this.state===Handsontable.EditorState.EDITING){if(this.TD=this.getEditedCell(),!this.TD)return void this.close();var e,t=v(this.TD)+1,n=m(this.TD)+1,o=g(this.TD),r=g(this.instance.rootElement),i=p(this.TD),s=o.top-r.top-1-(i.scrollTop||0),a=o.left-r.left-1-(i.scrollLeft||0),l=this.checkEditorSection(),u=this.instance.getSettings();u.rowHeaders?1:0,u.colHeaders?1:0;switch(l){case"top":e=f(this.instance.view.wt.wtOverlays.topOverlay.clone.wtTable.holder.parentNode);break;case"left":e=f(this.instance.view.wt.wtOverlays.leftOverlay.clone.wtTable.holder.parentNode);break;case"top-left-corner":e=f(this.instance.view.wt.wtOverlays.topLeftCornerOverlay.clone.wtTable.holder.parentNode);break;case"bottom-left-corner":e=f(this.instance.view.wt.wtOverlays.bottomLeftCornerOverlay.clone.wtTable.holder.parentNode);break;case"bottom":e=f(this.instance.view.wt.wtOverlays.bottomOverlay.clone.wtTable.holder.parentNode)}0===this.instance.getSelected()[0]&&(s+=1),0===this.instance.getSelected()[1]&&(a+=1);var c=this.select.style;e&&-1!=e?c[e[0]]=e[1]:w(this.select);var d=h(this.TD);parseInt(d.borderTopWidth,10)>0&&(n-=1),parseInt(d.borderLeftWidth,10)>0&&(t-=1),c.height=n+"px",c.minWidth=t+"px",c.top=s+"px",c.left=a+"px",c.margin="0px"}},S.prototype.getEditedCell=function(){var e,t=this.checkEditorSection();switch(t){case"top":e=this.instance.view.wt.wtOverlays.topOverlay.clone.wtTable.getCell({row:this.row,col:this.col}),this.select.style.zIndex=101;break;case"corner":e=this.instance.view.wt.wtOverlays.topLeftCornerOverlay.clone.wtTable.getCell({row:this.row,col:this.col}),this.select.style.zIndex=103;break;case"left":e=this.instance.view.wt.wtOverlays.leftOverlay.clone.wtTable.getCell({row:this.row,col:this.col}),this.select.style.zIndex=102;break;default:e=this.instance.getCell(this.row,this.col),this.select.style.zIndex=""}return-1!=e&&-2!=e?e:void 0},R("select",S)},{_baseEditor:30,editors:29,"helpers/dom/element":45,"helpers/dom/event":46,"helpers/unicode":53}],40:[function(e,t,n){"use strict";Object.defineProperties(n,{TextEditor:{get:function(){return H}},__esModule:{value:!0}});var o,r,i,s,a,l,u,c=(o=e("helpers/dom/element"),o&&o.__esModule&&o||{"default":o}),d=c.addClass,h=c.getCaretPosition,f=c.getComputedStyle,p=c.getCssTransform,g=c.getScrollableElement,m=c.innerWidth,v=c.offset,w=c.resetCssTransform,y=c.setCaretPosition,b=(r=e("autoResize"),r&&r.__esModule&&r||{"default":r})["default"],C=(i=e("_baseEditor"),i&&i.__esModule&&i||{"default":i}).BaseEditor,R=(s=e("eventManager"),s&&s.__esModule&&s||{"default":s}).eventManager,_=(a=e("editors"),a&&a.__esModule&&a||{"default":a}),S=(_.getEditor,_.registerEditor),E=(l=e("helpers/unicode"),l&&l.__esModule&&l||{"default":l}).KEY_CODES,T=(u=e("helpers/dom/event"),u&&u.__esModule&&u||{"default":u}),O=T.stopPropagation,M=T.stopImmediatePropagation,k=T.isImmediatePropagationStopped,H=C.prototype.extend();H.prototype.init=function(){var e=this;this.createElements(),this.eventManager=R(this),this.bindEvents(),this.autoResize=b(),this.instance.addHook("afterDestroy",function(){e.destroy()})},H.prototype.getValue=function(){return this.TEXTAREA.value},H.prototype.setValue=function(e){this.TEXTAREA.value=e};var D=function(e){var t,n=this,o=n.getActiveEditor();if(t=(e.ctrlKey||e.metaKey)&&!e.altKey,e.target===o.TEXTAREA&&!k(e)){if(17===e.keyCode||224===e.keyCode||91===e.keyCode||93===e.keyCode)return void M(e);switch(e.keyCode){case E.ARROW_RIGHT:o.isInFullEditMode()&&(!o.isWaiting()&&!o.allowKeyEventPropagation||!o.isWaiting()&&o.allowKeyEventPropagation&&!o.allowKeyEventPropagation(e.keyCode))&&M(e);break;case E.ARROW_LEFT:o.isInFullEditMode()&&(!o.isWaiting()&&!o.allowKeyEventPropagation||!o.isWaiting()&&o.allowKeyEventPropagation&&!o.allowKeyEventPropagation(e.keyCode))&&M(e);break;case E.ARROW_UP:case E.ARROW_DOWN:o.isInFullEditMode()&&(!o.isWaiting()&&!o.allowKeyEventPropagation||!o.isWaiting()&&o.allowKeyEventPropagation&&!o.allowKeyEventPropagation(e.keyCode))&&M(e);break;case E.ENTER:var r=o.instance.getSelected(),i=!(r[0]===r[2]&&r[1]===r[3]);if(t&&!i||e.altKey){if(o.isOpened()){var s=h(o.TEXTAREA),a=o.getValue(),l=a.slice(0,s)+"\n"+a.slice(s);o.setValue(l),y(o.TEXTAREA,s+1)}else o.beginEditing(o.originalValue+"\n");M(e)}e.preventDefault();break;case E.A:case E.X:case E.C:case E.V:t&&M(e);break;case E.BACKSPACE:case E.DELETE:case E.HOME:case E.END:M(e)}-1===[E.ARROW_UP,E.ARROW_RIGHT,E.ARROW_DOWN,E.ARROW_LEFT].indexOf(e.keyCode)&&o.autoResize.resize(String.fromCharCode(e.keyCode))}};H.prototype.open=function(){this.refreshDimensions(),this.instance.addHook("beforeKeyDown",D)},H.prototype.close=function(e){this.textareaParentStyle.display="none",this.autoResize.unObserve(),document.activeElement===this.TEXTAREA&&this.instance.listen(),this.instance.removeHook("beforeKeyDown",D)},H.prototype.focus=function(){this.TEXTAREA.focus(),y(this.TEXTAREA,this.TEXTAREA.value.length)},H.prototype.createElements=function(){this.TEXTAREA=document.createElement("TEXTAREA"),d(this.TEXTAREA,"handsontableInput"),this.textareaStyle=this.TEXTAREA.style,this.textareaStyle.width=0,this.textareaStyle.height=0,this.TEXTAREA_PARENT=document.createElement("DIV"),d(this.TEXTAREA_PARENT,"handsontableInputHolder"),this.textareaParentStyle=this.TEXTAREA_PARENT.style,this.textareaParentStyle.top=0,this.textareaParentStyle.left=0,this.textareaParentStyle.display="none",this.TEXTAREA_PARENT.appendChild(this.TEXTAREA),this.instance.rootElement.appendChild(this.TEXTAREA_PARENT);var e=this;this.instance._registerTimeout(setTimeout(function(){e.refreshDimensions()},0))},H.prototype.getEditedCell=function(){var e,t=this.checkEditorSection();switch(t){case"top":e=this.instance.view.wt.wtOverlays.topOverlay.clone.wtTable.getCell({row:this.row,col:this.col}),this.textareaParentStyle.zIndex=101;break;case"top-left-corner":e=this.instance.view.wt.wtOverlays.topLeftCornerOverlay.clone.wtTable.getCell({row:this.row,col:this.col}),this.textareaParentStyle.zIndex=103;break;case"bottom-left-corner":e=this.instance.view.wt.wtOverlays.bottomLeftCornerOverlay.clone.wtTable.getCell({row:this.row,col:this.col}),this.textareaParentStyle.zIndex=103;break;case"left":e=this.instance.view.wt.wtOverlays.leftOverlay.clone.wtTable.getCell({row:this.row,col:this.col}),this.textareaParentStyle.zIndex=102;break;case"bottom":e=this.instance.view.wt.wtOverlays.bottomOverlay.clone.wtTable.getCell({row:this.row,col:this.col}),this.textareaParentStyle.zIndex=102;break;default:e=this.instance.getCell(this.row,this.col),this.textareaParentStyle.zIndex=""}return-1!=e&&-2!=e?e:void 0},H.prototype.refreshDimensions=function(){if(this.state===Handsontable.EditorState.EDITING){if(this.TD=this.getEditedCell(),!this.TD)return void this.close(!0);var e,t=v(this.TD),n=v(this.instance.rootElement),o=g(this.TD),r=this.instance.countRows(),i=t.top-n.top-1-(o.scrollTop||0),s=t.left-n.left-1-(o.scrollLeft||0),a=this.instance.getSettings(),l=(a.rowHeaders?1:0,a.colHeaders?1:0),u=this.checkEditorSection(),c=this.TD.style.backgroundColor;switch(u){case"top":e=p(this.instance.view.wt.wtOverlays.topOverlay.clone.wtTable.holder.parentNode);break;case"left":e=p(this.instance.view.wt.wtOverlays.leftOverlay.clone.wtTable.holder.parentNode);break;case"top-left-corner":e=p(this.instance.view.wt.wtOverlays.topLeftCornerOverlay.clone.wtTable.holder.parentNode);break;case"bottom-left-corner":e=p(this.instance.view.wt.wtOverlays.bottomLeftCornerOverlay.clone.wtTable.holder.parentNode);break;case"bottom":e=p(this.instance.view.wt.wtOverlays.bottomOverlay.clone.wtTable.holder.parentNode)}(l&&0===this.instance.getSelected()[0]||a.fixedRowsBottom&&this.instance.getSelected()[0]===r-a.fixedRowsBottom)&&(i+=1),0===this.instance.getSelected()[1]&&(s+=1),e&&-1!=e?this.textareaParentStyle[e[0]]=e[1]:w(this.textareaParentStyle),this.textareaParentStyle.top=i+"px",this.textareaParentStyle.left=s+"px";var d=this.TD.offsetTop-this.instance.view.wt.wtOverlays.topOverlay.getScrollPosition(),h=this.TD.offsetLeft-this.instance.view.wt.wtOverlays.leftOverlay.getScrollPosition(),y=m(this.TD)-8,b=this.instance.view.maximumVisibleElementWidth(h)-9,C=this.TD.scrollHeight+1,R=Math.max(this.instance.view.maximumVisibleElementHeight(d)-2,23),_=f(this.TD);this.TEXTAREA.style.fontSize=_.fontSize,this.TEXTAREA.style.fontFamily=_.fontFamily,this.TEXTAREA.style.backgroundColor="",this.TEXTAREA.style.backgroundColor=c?c:f(this.TEXTAREA).backgroundColor,this.autoResize.init(this.TEXTAREA,{minHeight:Math.min(C,R),maxHeight:R,minWidth:Math.min(y,b),maxWidth:b},!0),this.textareaParentStyle.display="block"}},H.prototype.bindEvents=function(){var e=this;this.eventManager.addEventListener(this.TEXTAREA,"cut",function(e){O(e)}),this.eventManager.addEventListener(this.TEXTAREA,"paste",function(e){O(e)}),this.instance.addHook("afterScrollHorizontally",function(){e.refreshDimensions()}),this.instance.addHook("afterScrollVertically",function(){e.refreshDimensions()}),this.instance.addHook("afterColumnResize",function(){e.refreshDimensions(),e.focus()}),this.instance.addHook("afterRowResize",function(){e.refreshDimensions(),e.focus()}),this.instance.addHook("afterDestroy",function(){e.eventManager.destroy()})},H.prototype.destroy=function(){this.eventManager.destroy()},S("text",H)},{_baseEditor:30,autoResize:"autoResize",editors:29,eventManager:41,"helpers/dom/element":45,"helpers/dom/event":46,"helpers/unicode":53}],41:[function(e,t,n){"use strict";function o(e,t){var n,o,r,i,s,a="HOT-TABLE";if(t.isTargetWebComponent=!1,t.realTarget=t.target,!Handsontable.eventManager.isHotTableEnv)return t;for(t=l(t),s=t.path?t.path.length:0;s--;){if(t.path[s].nodeName===a)n=!0;else if(n&&t.path[s].shadowRoot){i=t.path[s];break}0!==s||i||(i=t.path[s])}return i||(i=t.target),t.isTargetWebComponent=!0,c()?t.realTarget=t.srcElement||t.toElement:(e instanceof Handsontable.Core||e instanceof Walkontable)&&(e instanceof Handsontable.Core?o=e.view?e.view.wt.wtTable.TABLE:null:e instanceof Walkontable&&(o=e.wtTable.TABLE.parentNode.parentNode),r=u(t.target,[a],o),r?t.realTarget=o.querySelector(a)||t.target:t.realTarget=t.target),Object.defineProperty(t,"target",{get:function(){return l(i)},enumerable:!0,configurable:!0}),t}function r(e){return new d(e)}Object.defineProperties(n,{EventManager:{get:function(){return d}},eventManager:{get:function(){return r}},__esModule:{value:!0}});var i,s,a=(i=e("helpers/dom/element"),i&&i.__esModule&&i||{"default":i}),l=a.polymerWrap,u=a.closest,c=(s=e("helpers/browser"),s&&s.__esModule&&s||{"default":s}).isWebComponentSupportedNatively,d=function(){var e=void 0!==arguments[0]?arguments[0]:null;this.context=e||this,this.context.eventListeners||(this.context.eventListeners=[])};$traceurRuntime.createClass(d,{addEventListener:function(e,t,n){function r(e){void 0==e.target&&void 0!=e.srcElement&&(e.definePoperty?e.definePoperty("target",{value:e.srcElement}):e.target=e.srcElement),void 0==e.preventDefault&&(e.definePoperty?e.definePoperty("preventDefault",{value:function(){this.returnValue=!1}}):e.preventDefault=function(){this.returnValue=!1}),e=o(s,e),n.call(this,e)}var i=this,s=this.context;return this.context.eventListeners.push({element:e,event:t,callback:n,callbackProxy:r}),window.addEventListener?e.addEventListener(t,r,!1):e.attachEvent("on"+t,r),Handsontable.countEventManagerListeners++,function(){i.removeEventListener(e,t,n)}},removeEventListener:function(e,t,n){for(var o,r=this.context.eventListeners.length;r--;)if(o=this.context.eventListeners[r],o.event==t&&o.element==e){if(n&&n!=o.callback)continue;this.context.eventListeners.splice(r,1),o.element.removeEventListener?o.element.removeEventListener(o.event,o.callbackProxy,!1):o.element.detachEvent("on"+o.event,o.callbackProxy),Handsontable.countEventManagerListeners--}},clearEvents:function(){if(this.context)for(var e=this.context.eventListeners.length;e--;){var t=this.context.eventListeners[e];t&&this.removeEventListener(t.element,t.event,t.callback)}},clear:function(){this.clearEvents()},destroy:function(){this.clearEvents(),this.context=null},fireEvent:function(e,t){var n,o={bubbles:!0,cancelable:"mousemove"!==t,view:window,detail:0,screenX:0,screenY:0,clientX:1,clientY:1,ctrlKey:!1,altKey:!1,shiftKey:!1,metaKey:!1,button:0,relatedTarget:void 0};document.createEvent?(n=document.createEvent("MouseEvents"),n.initMouseEvent(t,o.bubbles,o.cancelable,o.view,o.detail,o.screenX,o.screenY,o.clientX,o.clientY,o.ctrlKey,o.altKey,o.shiftKey,o.metaKey,o.button,o.relatedTarget||document.body.parentNode)):n=document.createEventObject(),e.dispatchEvent?e.dispatchEvent(n):e.fireEvent("on"+t,n)}},{}),window.Handsontable=window.Handsontable||{},Handsontable.countEventManagerListeners=0,Handsontable.eventManager=r},{"helpers/browser":43,"helpers/dom/element":45}],42:[function(e,t,n){"use strict";function o(e){for(var t=0,n=e.length;n>t;)e[t]=[e[t]],t++}function r(e,t){for(var n=0,o=t.length;o>n;)e.push(t[n]),n++}function i(e){var t=[];if(!e||0===e.length||!e[0]||0===e[0].length)return t;for(var n=e.length,o=e[0].length,r=0;n>r;r++)for(var i=0;o>i;i++)t[i]||(t[i]=[]),t[i][r]=e[r][i];return t}function s(e,t,n,o){var r=-1,i=e.length;for(o&&i&&(n=e[++r]);++rt?e:t},Array.isArray(e)?e[0]:void 0)}function h(e){return s(e,function(e,t){return t>e?e:t},Array.isArray(e)?e[0]:void 0)}function f(e){return e.length?c(e)/e.length:0}function p(e){return s(e,function(e,t){return e.concat(Array.isArray(t)?p(t):t)},[])}function g(e){var t=[];return u(e,function(e){-1===t.indexOf(e)&&t.push(e)}),t}Object.defineProperties(n,{to2dArray:{get:function(){return o}},extendArray:{get:function(){return r}},pivot:{get:function(){return i}},arrayReduce:{get:function(){return s}},arrayFilter:{get:function(){return a}},arrayMap:{get:function(){return l}},arrayEach:{get:function(){return u}},arraySum:{get:function(){return c}},arrayMax:{get:function(){return d}},arrayMin:{get:function(){return h}},arrayAvg:{get:function(){return f}},arrayFlatten:{get:function(){return p}},arrayUnique:{get:function(){return g}},__esModule:{value:!0}})},{}],43:[function(e,t,n){"use strict";function o(){return f}function r(){return p}function i(){return g}function s(){return m}function a(e){return e||(e=navigator.userAgent),/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(e)}function l(){return"ontouchstart"in window}function u(){var e=document.createElement("div");return e.createShadowRoot&&e.createShadowRoot.toString().match(/\[native code\]/)?!0:!1}function c(){var e=document.createElement("TABLE");e.style.borderSpacing=0,e.style.borderWidth=0,e.style.padding=0;var t=document.createElement("TBODY");e.appendChild(t),t.appendChild(document.createElement("TR")),t.firstChild.appendChild(document.createElement("TD")),t.firstChild.firstChild.innerHTML="t
t";var n=document.createElement("CAPTION");n.innerHTML="c
c
c
c",n.style.padding=0,n.style.margin=0,e.insertBefore(n,t),document.body.appendChild(e),h=e.offsetHeight<2*e.lastChild.offsetHeight,document.body.removeChild(e)}function d(){return void 0===h&&c(),h}Object.defineProperties(n,{isIE8:{get:function(){return o}},isIE9:{get:function(){return r}},isSafari:{get:function(){return i}},isChrome:{get:function(){return s}},isMobileBrowser:{get:function(){return a}},isTouchSupported:{get:function(){return l}},isWebComponentSupportedNatively:{get:function(){return u}},hasCaptionProblem:{get:function(){return d}},__esModule:{value:!0}});var h,f=!document.createTextNode("test").textContent,p=!!document.documentMode,g=/Safari/.test(navigator.userAgent)&&/Apple Computer/.test(navigator.vendor),m=/Chrome/.test(navigator.userAgent)&&/Google/.test(navigator.vendor)},{}],44:[function(e,t,n){"use strict";function o(e){for(var t,n=e+1,o="";n>0;)t=(n-1)%26,o=String.fromCharCode(65+t)+o,n=parseInt((n-t)/26,10);return o}function r(e,t){e="number"==typeof e?e:100,t="number"==typeof t?t:4;var n,r,i=[];for(n=0;e>n;n++){var s=[];for(r=0;t>r;r++)s.push(o(r)+(n+1));i.push(s)}return i}function i(e,t){e="number"==typeof e?e:100,t="number"==typeof t?t:4;var n,r,i=[];for(n=0;e>n;n++){var s={};for(r=0;t>r;r++)s["prop"+r]=o(r)+(n+1);i.push(s)}return i}function s(e,t){for(var n,o=[],r=0;e>r;r++){n=[];for(var i=0;t>i;i++)n.push("");o.push(n)}return o}function a(e){var t,n,o,r,i=[],s=0;for(t=0,n=e.length;n>t;t++)for(o=0,r=e[t].length;r>o;o++)o==s&&(i.push([]),s++),i[o].push(e[t][o]);return i}function l(e,t){function n(e){var t=Handsontable.cellTypes[e];if("undefined"==typeof t)throw new Error('You declared cell type "'+e+'" as a string that is not mapped to a known object. Cell type must be an object or a string mapped to an object in Handsontable.cellTypes');return t}return t="undefined"==typeof t?!0:t,function(o,r){return function i(o){if(o){if(o.hasOwnProperty(e)&&void 0!==o[e])return o[e];if(o.hasOwnProperty("type")&&o.type){var r;if("string"!=typeof o.type)throw new Error("Cell type must be a string ");if(r=n(o.type),r.hasOwnProperty(e))return r[e];if(t)return}return i(c(o))}}("number"==typeof o?this.getCellMeta(o,r):o)}}Object.defineProperties(n,{spreadsheetColumnLabel:{get:function(){return o}},createSpreadsheetData:{get:function(){return r}},createSpreadsheetObjectData:{get:function(){return i}},createEmptySpreadsheetData:{get:function(){return s}},translateRowsToColumns:{get:function(){return a}},cellMethodLookupFactory:{get:function(){return l}},__esModule:{value:!0}});var u,c=(u=e("object"),u&&u.__esModule&&u||{"default":u}).getPrototypeOf},{object:50}],45:[function(e,t,n){"use strict";function o(e,t,n){for(;null!=e&&e!==n;){if(e.nodeType===Node.ELEMENT_NODE&&(t.indexOf(e.nodeName)>-1||t.indexOf(e)>-1))return e;e=e.host&&e.nodeType===Node.DOCUMENT_FRAGMENT_NODE?e.host:e.parentNode}return null}function r(e,t){var n=e.parentNode,o=[];for("string"==typeof t?o=Array.prototype.slice.call(document.querySelectorAll(t),0):o.push(t);null!=n;){if(o.indexOf(n)>-1)return!0;n=n.parentNode}return!1}function i(e){function t(e){return e.nodeType===Node.ELEMENT_NODE&&e.nodeName===o.toUpperCase()}var n,o="hot-table",r=!1;for(n=s(e);null!=n;){if(t(n)){r=!0;break}if(n.host&&n.nodeType===Node.DOCUMENT_FRAGMENT_NODE){if(r=t(n.host))break;n=n.host}n=n.parentNode}return r}function s(e){return"undefined"!=typeof Polymer&&"function"==typeof wrap?wrap(e):e}function a(e){return"undefined"!=typeof Polymer&&"function"==typeof unwrap?unwrap(e):e}function l(e){var t=0;if(e.previousSibling)for(;e=e.previousSibling;)++t;return t}function u(e,t){var n=document.querySelector(".ht_clone_"+e);return n?n.contains(t):null}function c(e){var t=0,n=[];if(!e||!e.length)return n;for(;e[t];)n.push(e[t]),t++;return n}function d(e,t){return K(e,t)}function h(e,t){return X(e,t)}function f(e,t){return q(e,t)}function p(e,t){if(3===e.nodeType)t.removeChild(e);else if(["TABLE","THEAD","TBODY","TFOOT","TR"].indexOf(e.nodeName)>-1)for(var n=e.childNodes,o=n.length-1;o>=0;o--)p(n[o],e)}function g(e){for(var t;t=e.lastChild;)e.removeChild(t)}function m(e,t){se.test(t)?e.innerHTML=t:v(e,t)}function v(e,t){var n=e.firstChild;n&&3===n.nodeType&&null===n.nextSibling?ae?n.textContent=t:n.data=t:(g(e),e.appendChild(document.createTextNode(t)))}function w(e){for(var t=e;a(t)!==document.documentElement;){if(null===t)return!1;if(t.nodeType===Node.DOCUMENT_FRAGMENT_NODE){if(t.host){if(t.host.impl)return w(t.host.impl);if(t.host)return w(t.host);throw new Error("Lost in Web Components world")}return!1}if("none"===t.style.display)return!1;t=t.parentNode}return!0}function y(e){var t,n,o,r,i;if(r=document.documentElement,te()&&e.firstChild&&"CAPTION"===e.firstChild.nodeName)return i=e.getBoundingClientRect(),{top:i.top+(window.pageYOffset||r.scrollTop)-(r.clientTop||0),left:i.left+(window.pageXOffset||r.scrollLeft)-(r.clientLeft||0)};for(t=e.offsetLeft,n=e.offsetTop,o=e;(e=e.offsetParent)&&e!==document.body;)t+=e.offsetLeft,n+=e.offsetTop,o=e;return o&&"fixed"===o.style.position&&(t+=window.pageXOffset||r.scrollLeft,n+=window.pageYOffset||r.scrollTop),{left:t,top:n}}function b(){var e=window.scrollY;return void 0===e&&(e=document.documentElement.scrollTop),e}function C(){var e=window.scrollX;return void 0===e&&(e=document.documentElement.scrollLeft),e}function R(e){return e===window?b():e.scrollTop}function _(e){return e===window?C():e.scrollLeft}function S(e){for(var t,n,o,r=e.parentNode,i=["auto","scroll"],s="",a="",l="",u="";r&&r.style&&document.body!==r;){if(t=r.style.overflow,n=r.style.overflowX,o=r.style.overflowY,"scroll"==t||"scroll"==n||"scroll"==o)return r; +if(window.getComputedStyle&&(s=window.getComputedStyle(r),a=s.getPropertyValue("overflow"),l=s.getPropertyValue("overflow-y"),u=s.getPropertyValue("overflow-x"),"scroll"===a||"scroll"===u||"scroll"===l))return r;if(r.clientHeight<=r.scrollHeight&&(-1!==i.indexOf(o)||-1!==i.indexOf(t)||-1!==i.indexOf(a)||-1!==i.indexOf(l)))return r;if(r.clientWidth<=r.scrollWidth&&(-1!==i.indexOf(n)||-1!==i.indexOf(t)||-1!==i.indexOf(a)||-1!==i.indexOf(u)))return r;r=r.parentNode}return window}function E(e){for(var t=e.parentNode;t&&t.style&&document.body!==t;){if("visible"!==t.style.overflow&&""!==t.style.overflow)return t;if(window.getComputedStyle){var n=window.getComputedStyle(t);if("visible"!==n.getPropertyValue("overflow")&&""!==n.getPropertyValue("overflow"))return t}t=t.parentNode}return window}function T(e,t){if(e){if(e!==window){var n,o=e.style[t];return""!==o&&void 0!==o?o:(n=O(e),""!==n[t]&&void 0!==n[t]?n[t]:void 0)}if("width"===t)return window.innerWidth+"px";if("height"===t)return window.innerHeight+"px"}}function O(e){return e.currentStyle||document.defaultView.getComputedStyle(e)}function M(e){return e.offsetWidth}function k(e){return te()&&e.firstChild&&"CAPTION"===e.firstChild.nodeName?e.offsetHeight+e.firstChild.offsetHeight:e.offsetHeight}function H(e){return e.clientHeight||e.innerHeight}function D(e){return e.clientWidth||e.innerWidth}function A(e,t,n){window.addEventListener?e.addEventListener(t,n,!1):e.attachEvent("on"+t,n)}function x(e,t,n){window.removeEventListener?e.removeEventListener(t,n,!1):e.detachEvent("on"+t,n)}function P(e){if(e.selectionStart)return e.selectionStart;if(document.selection){e.focus();var t=document.selection.createRange();if(null==t)return 0;var n=e.createTextRange(),o=n.duplicate();return n.moveToBookmark(t.getBookmark()),o.setEndPoint("EndToStart",n),o.text.length}return 0}function N(e){if(e.selectionEnd)return e.selectionEnd;if(document.selection){var t=document.selection.createRange();if(null==t)return 0;var n=e.createTextRange();return n.text.indexOf(t.text)+t.text.length}}function L(){var e="";return window.getSelection?e=window.getSelection().toString():document.selection&&"Control"!==document.selection.type&&(e=document.selection.createRange().text),e}function W(e,t,n){if(void 0===n&&(n=t),e.setSelectionRange){e.focus();try{e.setSelectionRange(t,n)}catch(o){var r=e.parentNode,i=r.style.display;r.style.display="block",e.setSelectionRange(t,n),r.style.display=i}}else if(e.createTextRange){var s=e.createTextRange();s.collapse(!0),s.moveEnd("character",n),s.moveStart("character",t),s.select()}}function I(){var e=document.createElement("p");e.style.width="100%",e.style.height="200px";var t=document.createElement("div");t.style.position="absolute",t.style.top="0px",t.style.left="0px",t.style.visibility="hidden",t.style.width="200px",t.style.height="150px",t.style.overflow="hidden",t.appendChild(e),(document.body||document.documentElement).appendChild(t);var n=e.offsetWidth;t.style.overflow="scroll";var o=e.offsetWidth;return n==o&&(o=t.clientWidth),(document.body||document.documentElement).removeChild(t),n-o}function j(){return void 0===ie&&(ie=I()),ie}function B(e,t,n){J()||Q()?(e.style.top=n,e.style.left=t):ee()?e.style["-webkit-transform"]="translate3d("+t+","+n+",0)":e.style.transform="translate3d("+t+","+n+",0)"}function F(e){var t;return e.style.transform&&""!==(t=e.style.transform)?["transform",t]:e.style["-webkit-transform"]&&""!==(t=e.style["-webkit-transform"])?["-webkit-transform",t]:-1}function V(e){e.transform&&""!==e.transform?e.transform="":e["-webkit-transform"]&&""!==e["-webkit-transform"]&&(e["-webkit-transform"]="")}function z(e){var t=["INPUT","SELECT","TEXTAREA"];return t.indexOf(e.nodeName)>-1||"true"===e.contentEditable}function Y(e){return z(e)&&-1==e.className.indexOf("handsontableInput")&&-1==e.className.indexOf("copyPaste")}function U(e){return ce.call(window,e)}function G(e){de.call(window,e)}Object.defineProperties(n,{closest:{get:function(){return o}},isChildOf:{get:function(){return r}},isChildOfWebComponentTable:{get:function(){return i}},polymerWrap:{get:function(){return s}},polymerUnwrap:{get:function(){return a}},index:{get:function(){return l}},overlayContainsElement:{get:function(){return u}},hasClass:{get:function(){return d}},addClass:{get:function(){return h}},removeClass:{get:function(){return f}},removeTextNodes:{get:function(){return p}},empty:{get:function(){return g}},HTML_CHARACTERS:{get:function(){return se}},fastInnerHTML:{get:function(){return m}},fastInnerText:{get:function(){return v}},isVisible:{get:function(){return w}},offset:{get:function(){return y}},getWindowScrollTop:{get:function(){return b}},getWindowScrollLeft:{get:function(){return C}},getScrollTop:{get:function(){return R}},getScrollLeft:{get:function(){return _}},getScrollableElement:{get:function(){return S}},getTrimmingContainer:{get:function(){return E}},getStyle:{get:function(){return T}},getComputedStyle:{get:function(){return O}},outerWidth:{get:function(){return M}},outerHeight:{get:function(){return k}},innerHeight:{get:function(){return H}},innerWidth:{get:function(){return D}},addEvent:{get:function(){return A}},removeEvent:{get:function(){return x}},getCaretPosition:{get:function(){return P}},getSelectionEndPosition:{get:function(){return N}},getSelectionText:{get:function(){return L}},setCaretPosition:{get:function(){return W}},getScrollbarWidth:{get:function(){return j}},setOverlayPosition:{get:function(){return B}},getCssTransform:{get:function(){return F}},resetCssTransform:{get:function(){return V}},isInput:{get:function(){return z}},isOutsideInput:{get:function(){return Y}},requestAnimationFrame:{get:function(){return U}},cancelAnimationFrame:{get:function(){return G}},__esModule:{value:!0}});var $,K,X,q,Z=($=e("../browser"),$&&$.__esModule&&$||{"default":$}),J=Z.isIE8,Q=Z.isIE9,ee=Z.isSafari,te=Z.hasCaptionProblem,ne=document.documentElement.classList?!0:!1;if(ne){var oe=function(){var e=document.createElement("div");return e.classList.add("test","test2"),e.classList.contains("test2")}();K=function(e,t){return""===t?!1:e.classList.contains(t)},X=function(e,t){var n=0;if("string"==typeof t&&(t=t.split(" ")),t=c(t),oe)e.classList.add.apply(e.classList,t);else for(;t&&t[n];)e.classList.add(t[n]),n++},q=function(e,t){var n=0;if("string"==typeof t&&(t=t.split(" ")),t=c(t),oe)e.classList.remove.apply(e.classList,t);else for(;t&&t[n];)e.classList.remove(t[n]),n++}}else{var re=function(e){return new RegExp("(\\s|^)"+e+"(\\s|$)")};K=function(e,t){return e.className.match(re(t))?!0:!1},X=function(e,t){var n=0,o=e.className;if("string"==typeof t&&(t=t.split(" ")),""===o)o=t.join(" ");else for(;t&&t[n];)re(t[n]).test(o)||(o+=" "+t[n]),n++;e.className=o},q=function(e,t){var n=0,o=e.className;for("string"==typeof t&&(t=t.split(" "));t&&t[n];)o=o.replace(re(t[n])," ").trim(),n++;e.className!==o&&(e.className=o)}}for(var ie,se=/(<(.*)>|&(.*);)/,ae=document.createTextNode("test").textContent?!0:!1,le=0,ue=["ms","moz","webkit","o"],ce=window.requestAnimationFrame,de=window.cancelAnimationFrame,he=0;he=t&&n(o)!==!1;);}function s(e,t){return t=parseInt(t.toString().replace("%",""),10),t=parseInt(e*t/100)}Object.defineProperties(n,{isNumeric:{get:function(){return o}},rangeEach:{get:function(){return r}},rangeEachReverse:{get:function(){return i}},valueAccordingPercent:{get:function(){return s}},__esModule:{value:!0}})},{}],50:[function(e,t,n){"use strict";function o(e){var t;return Array.isArray(e)?t=[]:(t={},p(e,function(e,n){e&&"object"==typeof e&&!Array.isArray(e)?t[n]=o(e):Array.isArray(e)?e.length&&"object"==typeof e[0]&&!Array.isArray(e[0])?t[n]=[o(e[0])]:t[n]=[]:t[n]=null})),t}function r(e,t){return t.prototype.constructor=t,e.prototype=new t,e.prototype.constructor=e,e}function i(e,t){return p(t,function(t,n){e[n]=t}),e}function s(e,t){p(t,function(n,o){t[o]&&"object"==typeof t[o]?(e[o]||(Array.isArray(t[o])?e[o]=[]:e[o]={}),s(e[o],t[o])):e[o]=t[o]})}function a(e){return"object"==typeof e?JSON.parse(JSON.stringify(e)):e}function l(e){var t={};return p(e,function(e,n){t[n]=e}),t}function u(e){for(var t=[],n=1;no;o++)n.prototype[t[o]]=void 0;return n}Object.defineProperties(n,{columnFactory:{get:function(){return o}},__esModule:{value:!0}});var r,i=(r=e("object"),r&&r.__esModule&&r||{"default":r}).inherit},{object:50}],52:[function(e,t,n){"use strict";function o(e){return e[0].toUpperCase()+e.substr(1)}function r(e,t){var n=!0;return p(t.length-1,function(o){return e.charAt(o)!==t.charAt(o)?(n=!1,!1):void 0}),n}function i(e,t){var n=!0,o=t.length-1,r=e.length-1;return p(o,function(i){var s=r-i,a=o-i;return e.charAt(s)!==t.charAt(a)?(n=!1,!1):void 0}),n}function s(){for(var e=[],t=0;t=t)return e;n=String(n);var o=n.length;o||(n=" ");var r=t-e.length,i=Math.ceil(r/n.length),s="";return p(i,function(e){s+=n}),s=s.slice(0,r),s+e}Object.defineProperties(n,{toUpperCaseFirst:{get:function(){return o}},startsWith:{get:function(){return r}},endsWith:{get:function(){return i}},equalsIgnoreCase:{get:function(){return s}},randomString:{get:function(){return a}},isPercentValue:{get:function(){return l}},substitute:{get:function(){return u}},padStart:{get:function(){return c}},__esModule:{value:!0}});var d,h,f=(d=e("mixed"),d&&d.__esModule&&d||{"default":d}).stringify,p=(h=e("number"),h&&h.__esModule&&h||{"default":h}).rangeEach},{mixed:48,number:49}],53:[function(e,t,n){"use strict";function o(e){return 32==e||e>=48&&57>=e||e>=96&&111>=e||e>=186&&192>=e||e>=219&&222>=e||e>=226||e>=65&&90>=e}function r(e){var t=[u.ARROW_DOWN,u.ARROW_UP,u.ARROW_LEFT,u.ARROW_RIGHT,u.HOME,u.END,u.DELETE,u.BACKSPACE,u.F1,u.F2,u.F3,u.F4,u.F5,u.F6,u.F7,u.F8,u.F9,u.F10,u.F11,u.F12,u.TAB,u.PAGE_DOWN,u.PAGE_UP,u.ENTER,u.ESCAPE,u.SHIFT,u.CAPS_LOCK,u.ALT];return-1!==t.indexOf(e)}function i(e){return-1!==[u.CONTROL_LEFT,224,u.COMMAND_LEFT,u.COMMAND_RIGHT].indexOf(e)}function s(e,t){var n=t.split("|"),o=!1;return l(n,function(t){return e===u[t]?(o=!0,!1):void 0}),o}Object.defineProperties(n,{KEY_CODES:{get:function(){return u}},isPrintableChar:{get:function(){return o}},isMetaKey:{get:function(){return r}},isCtrlKey:{get:function(){return i}},isKey:{get:function(){return s}},__esModule:{value:!0}});var a,l=(a=e("array"),a&&a.__esModule&&a||{"default":a}).arrayEach,u={MOUSE_LEFT:1,MOUSE_RIGHT:3,MOUSE_MIDDLE:2,BACKSPACE:8,COMMA:188,INSERT:45,DELETE:46,END:35,ENTER:13,ESCAPE:27,CONTROL_LEFT:91,COMMAND_LEFT:17,COMMAND_RIGHT:93,ALT:18,HOME:36,PAGE_DOWN:34,PAGE_UP:33,PERIOD:190,SPACE:32,SHIFT:16,CAPS_LOCK:20,TAB:9,ARROW_RIGHT:39,ARROW_LEFT:37,ARROW_UP:38,ARROW_DOWN:40,F1:112,F2:113,F3:114,F4:115,F5:116,F6:117,F7:118,F8:119,F9:120,F10:121,F11:122,F12:123,A:65,X:88,C:67,V:86}},{array:42}],54:[function(e,t,n){"use strict";Object.defineProperties(n,{localHooks:{get:function(){return l}},__esModule:{value:!0}});var o,r,i=(o=e("helpers/array"),o&&o.__esModule&&o||{"default":o}).arrayEach,s=(r=e("helpers/object"),r&&r.__esModule&&r||{"default":r}).defineGetter,a="localHooks",l={_localHooks:Object.create(null),addLocalHook:function(e,t){this._localHooks[e]||(this._localHooks[e]=[]),this._localHooks[e].push(t)},runLocalHooks:function(e){for(var t=[],n=1;n=0?(t.skip=!0,!0):!1},has:function(e){var t=void 0!==arguments[1]?arguments[1]:null,n=this.getBucket(t);return void 0!==n[e]&&n[e].length?!0:!1},run:function(e,t,n,o,r,i,s,a){var l=this.globalBucket[t],u=-1,c=l?l.length:0;if(c)for(;++u=0},getRegistered:function(){return i}},{}),Handsontable.utils=Handsontable.utils||{},Handsontable.utils.Hooks=l},{"helpers/array":42,"helpers/object":50}],57:[function(e,t,n){"use strict";function o(e,t){e=c(e),Handsontable.plugins[e]=t,Handsontable.hooks.add("construct",function(){var n;d.has(this)||d.set(this,{}),n=d.get(this),n[e]||(n[e]=new t(this))}),Handsontable.hooks.add("afterDestroy",function(){if(d.has(this)){var e=d.get(this);u(e,function(e){return e.destroy()}),d["delete"](this)}})}function r(e,t){if("string"!=typeof t)throw Error('Only strings can be passed as "plugin" parameter');var n=c(t);if(d.has(e)&&d.get(e)[n])return d.get(e)[n]}function i(e){return d.has(e)?Object.keys(d.get(e)):[]}function s(e,t){var n=null;return d.has(e)&&u(d.get(e),function(e,o){e===t&&(n=o)}),n}Object.defineProperties(n,{registerPlugin:{get:function(){return o}},getPlugin:{get:function(){return r}},getRegistredPluginNames:{get:function(){return i}},getPluginName:{get:function(){return s}},__esModule:{value:!0}});var a,l,u=(a=e("helpers/object"),a&&a.__esModule&&a||{"default":a}).objectEach,c=(l=e("helpers/string"),l&&l.__esModule&&l||{"default":l}).toUpperCaseFirst,d=new WeakMap;Handsontable.plugins=Handsontable.plugins||{},Handsontable.plugins.utils=Handsontable.plugins.utils||{},Handsontable.plugins.registerPlugin=o},{"helpers/object":50,"helpers/string":52}],58:[function(e,t,n){"use strict";Object.defineProperties(n,{"default":{get:function(){return m}},__esModule:{value:!0}});var o,r,i,s=(o=e("helpers/object"),o&&o.__esModule&&o||{"default":o}),a=s.defineGetter,l=s.objectEach,u=(r=e("helpers/array"),r&&r.__esModule&&r||{"default":r}).arrayEach,c=(i=e("plugins"),i&&i.__esModule&&i||{"default":i}),d=c.getRegistredPluginNames,h=c.getPluginName,f=new WeakMap,p=null,g=function(e){var t=this;a(this,"hot",e,{writable:!1}),f.set(this,{hooks:{}}),p=null,this.pluginName=null,this.pluginsInitializedCallbacks=[],this.isPluginsReady=!1,this.enabled=!1,this.initialized=!1,this.hot.addHook("afterPluginsInitialized",function(){return t.onAfterPluginsInitialized()}),this.hot.addHook("afterUpdateSettings",function(){return t.onUpdateSettings()}),this.hot.addHook("beforeInit",function(){return t.init()})};$traceurRuntime.createClass(g,{init:function(){this.pluginName=h(this.hot,this),this.isEnabled&&this.isEnabled()&&this.enablePlugin(),p||(p=d(this.hot)),p.indexOf(this.pluginName)>=0&&p.splice(p.indexOf(this.pluginName),1),p.length||this.hot.runHooks("afterPluginsInitialized"),this.initialized=!0},enablePlugin:function(){this.enabled=!0},disablePlugin:function(){this.eventManager&&this.eventManager.clear(),this.clearHooks(),this.enabled=!1},addHook:function(e,t){var n=f.get(this).hooks[e]=f.get(this).hooks[e]||[];this.hot.addHook(e,t),n.push(t),f.get(this).hooks[e]=n},removeHooks:function(e){var t=this;u(f.get(this).hooks[e]||[],function(n){t.hot.removeHook(e,n)})},clearHooks:function(){var e=this,t=f.get(this).hooks;l(t,function(t,n){return e.removeHooks(n)}),t.length=0},callOnPluginsReady:function(e){this.isPluginsReady?e():this.pluginsInitializedCallbacks.push(e)},onAfterPluginsInitialized:function(){u(this.pluginsInitializedCallbacks,function(e){return e()}),this.pluginsInitializedCallbacks.length=0,this.isPluginsReady=!0},onUpdateSettings:function(){this.isEnabled&&(this.enabled&&!this.isEnabled()&&this.disablePlugin(),!this.enabled&&this.isEnabled()&&this.enablePlugin(),this.enabled&&this.isEnabled()&&this.updatePlugin())},updatePlugin:function(){},destroy:function(){var e=this;this.eventManager&&this.eventManager.destroy(),this.clearHooks(),l(this,function(t,n){"hot"!==n&&(e[n]=null)}),delete this.hot}},{});var m=g;Handsontable.plugins.BasePlugin=g},{"helpers/array":42,"helpers/object":50,plugins:57}],59:[function(e,t,n){"use strict";Object.defineProperties(n,{AutoColumnSize:{get:function(){return D}},__esModule:{value:!0}});var o,r,i,s,a,l,u,c,d,h,f=(o=e("_base"),o&&o.__esModule&&o||{"default":o})["default"],p=(r=e("helpers/array"),r&&r.__esModule&&r||{"default":r}),g=p.arrayEach,m=p.arrayFilter,v=(i=e("helpers/dom/element"),i&&i.__esModule&&i||{"default":i}),w=v.cancelAnimationFrame,y=v.requestAnimationFrame,b=v.isVisible,C=(s=e("utils/ghostTable"),s&&s.__esModule&&s||{"default":s}).GhostTable,R=(a=e("helpers/object"),a&&a.__esModule&&a||{"default":a}),_=R.isObject,S=(R.objectEach,l=e("helpers/number"),l&&l.__esModule&&l||{"default":l}),E=S.valueAccordingPercent,T=S.rangeEach,O=(u=e("plugins"),u&&u.__esModule&&u||{"default":u}).registerPlugin,M=(c=e("utils/samplesGenerator"),c&&c.__esModule&&c||{"default":c}).SamplesGenerator,k=(d=e("helpers/string"),d&&d.__esModule&&d||{"default":d}).isPercentValue,H=(h=e("3rdparty/walkontable/src/calculator/viewportColumns"),h&&h.__esModule&&h||{"default":h}).WalkontableViewportColumnsCalculator,D=function(e){var t=this;$traceurRuntime.superConstructor(A).call(this,e),this.widths=[],this.ghostTable=new C(this.hot),this.samplesGenerator=new M(function(e,n){return t.hot.getDataAtCell(e,n)}),this.firstCalculation=!0,this.inProgress=!1,this.addHook("beforeColumnResize",function(e,n,o){return t.onBeforeColumnResize(e,n,o)})},A=D;$traceurRuntime.createClass(D,{isEnabled:function(){return this.hot.getSettings().autoColumnSize!==!1&&!this.hot.getSettings().colWidths},enablePlugin:function(){var e=this;this.enabled||(this.addHook("afterLoadData",function(){return e.onAfterLoadData()}),this.addHook("beforeChange",function(t){return e.onBeforeChange(t)}),this.addHook("beforeRender",function(t){return e.onBeforeRender(t)}),this.addHook("modifyColWidth",function(t,n){return e.getColumnWidth(n,t)}),$traceurRuntime.superGet(this,A.prototype,"enablePlugin").call(this))},disablePlugin:function(){$traceurRuntime.superGet(this,A.prototype,"disablePlugin").call(this)},calculateColumnsWidth:function(){var e=void 0!==arguments[0]?arguments[0]:{from:0,to:this.hot.countCols()-1},t=void 0!==arguments[1]?arguments[1]:{from:0,to:this.hot.countRows()-1},n=void 0!==arguments[2]?arguments[2]:!1,o=this;"number"==typeof e&&(e={from:e,to:e}),"number"==typeof t&&(t={from:t,to:t}),T(e.from,e.to,function(e){if(n||void 0===o.widths[e]&&!o.hot._getColWidthFromSettings(e)){var r=o.samplesGenerator.generateColumnSamples(e,t);r.forEach(function(e,t){return o.ghostTable.addColumn(t,e)})}}),this.ghostTable.columns.length&&(this.ghostTable.getWidths(function(e,t){return o.widths[e]=t}),this.ghostTable.clean())},calculateAllColumnsWidth:function(){var e=void 0!==arguments[0]?arguments[0]:{from:0,to:this.hot.countRows()-1},t=this,n=0,o=this.hot.countCols()-1,r=null;this.inProgress=!0;var i=function(){return t.hot?(t.calculateColumnsWidth({from:n,to:Math.min(n+A.CALCULATION_STEP,o)},e),n=n+A.CALCULATION_STEP+1,void(o>n?r=y(i):(w(r),t.inProgress=!1,t.hot.view.wt.wtOverlays.adjustElementsSize(!0),t.hot.view.wt.wtOverlays.leftOverlay.needFullRender&&t.hot.view.wt.wtOverlays.leftOverlay.clone.draw()))):(w(r),void(t.inProgress=!1))};this.firstCalculation&&this.getSyncCalculationLimit()&&(this.calculateColumnsWidth({from:0,to:this.getSyncCalculationLimit()},e),this.firstCalculation=!1,n=this.getSyncCalculationLimit()+1),o>n?i():this.inProgress=!1},recalculateAllColumnsWidth:function(){this.hot.view&&b(this.hot.view.wt.wtTable.TABLE)&&(this.clearCache(),this.calculateAllColumnsWidth())},getSyncCalculationLimit:function(){var e=A.SYNC_CALCULATION_LIMIT,t=this.hot.countCols()-1;return _(this.hot.getSettings().autoColumnSize)&&(e=this.hot.getSettings().autoColumnSize.syncLimit,k(e)?e=E(t,e):e>>=0),Math.min(e,t)},getColumnWidth:function(e){var t=arguments[1],n=void 0!==arguments[2]?arguments[2]:!0,o=t;return void 0===o&&(o=this.widths[e],n&&"number"==typeof o&&(o=Math.max(o,H.DEFAULT_WIDTH))),o},getFirstVisibleColumn:function(){var e=this.hot.view.wt;return e.wtViewport.columnsVisibleCalculator?e.wtTable.getFirstVisibleColumn():e.wtViewport.columnsRenderCalculator?e.wtTable.getFirstRenderedColumn():-1},getLastVisibleColumn:function(){var e=this.hot.view.wt;return e.wtViewport.columnsVisibleCalculator?e.wtTable.getLastVisibleColumn():e.wtViewport.columnsRenderCalculator?e.wtTable.getLastRenderedColumn():-1},clearCache:function(){this.widths.length=0},isNeedRecalculate:function(){return m(this.widths,function(e){return void 0===e}).length?!0:!1},onBeforeRender:function(){var e=this.hot.renderCall;this.calculateColumnsWidth({from:this.getFirstVisibleColumn(),to:this.getLastVisibleColumn()},void 0,e),this.isNeedRecalculate()&&!this.inProgress&&this.calculateAllColumnsWidth()},onAfterLoadData:function(){var e=this;this.hot.view?this.recalculateAllColumnsWidth():setTimeout(function(){e.hot&&e.recalculateAllColumnsWidth()},0)},onBeforeChange:function(e){var t=this;g(e,function(e){return t.widths[e[1]]=void 0})},onBeforeColumnResize:function(e,t,n){return n&&(this.calculateColumnsWidth(e,void 0,!0),t=this.getColumnWidth(e,void 0,!1)),t},destroy:function(){this.ghostTable.clean(),$traceurRuntime.superGet(this,A.prototype,"destroy").call(this)}},{get CALCULATION_STEP(){return 50},get SYNC_CALCULATION_LIMIT(){return 50}},f),O("autoColumnSize",D)},{"3rdparty/walkontable/src/calculator/viewportColumns":3,_base:58,"helpers/array":42,"helpers/dom/element":45,"helpers/number":49,"helpers/object":50,"helpers/string":52,plugins:57,"utils/ghostTable":98,"utils/samplesGenerator":99}],60:[function(e,t,n){"use strict";Object.defineProperties(n,{AutoRowSize:{get:function(){return M}},__esModule:{value:!0}});var o,r,i,s,a,l,u,c,d,h=(o=e("_base"),o&&o.__esModule&&o||{"default":o})["default"],f=(r=e("helpers/array"),r&&r.__esModule&&r||{"default":r}),p=(f.arrayEach,f.arrayFilter),g=(i=e("helpers/dom/element"),i&&i.__esModule&&i||{"default":i}),m=g.cancelAnimationFrame,v=g.requestAnimationFrame,w=g.isVisible,y=(s=e("utils/ghostTable"),s&&s.__esModule&&s||{"default":s}).GhostTable,b=(a=e("helpers/object"),a&&a.__esModule&&a||{"default":a}),C=b.isObject,R=(b.objectEach,l=e("helpers/number"),l&&l.__esModule&&l||{"default":l}),_=R.valueAccordingPercent,S=R.rangeEach,E=(u=e("plugins"),u&&u.__esModule&&u||{"default":u}).registerPlugin,T=(c=e("utils/samplesGenerator"),c&&c.__esModule&&c||{"default":c}).SamplesGenerator,O=(d=e("helpers/string"),d&&d.__esModule&&d||{"default":d}).isPercentValue,M=function(e){var t=this;$traceurRuntime.superConstructor(k).call(this,e),this.heights=[],this.ghostTable=new y(this.hot),this.samplesGenerator=new T(function(e,n){return t.hot.getDataAtCell(e,n)}),this.firstCalculation=!0,this.inProgress=!1,this.addHook("beforeRowResize",function(e,n,o){return t.onBeforeRowResize(e,n,o)})},k=M;$traceurRuntime.createClass(M,{isEnabled:function(){return this.hot.getSettings().autoRowSize===!0||C(this.hot.getSettings().autoRowSize)},enablePlugin:function(){var e=this;this.enabled||(this.addHook("afterLoadData",function(){return e.onAfterLoadData()}),this.addHook("beforeChange",function(t){return e.onBeforeChange(t)}),this.addHook("beforeColumnMove",function(){return e.recalculateAllRowsHeight()}),this.addHook("beforeColumnResize",function(){return e.recalculateAllRowsHeight()}),this.addHook("beforeColumnSort",function(){return e.clearCache()}),this.addHook("beforeRender",function(t){ +return e.onBeforeRender(t)}),this.addHook("beforeRowMove",function(t,n){return e.onBeforeRowMove(t,n)}),this.addHook("modifyRowHeight",function(t,n){return e.getRowHeight(n,t)}),$traceurRuntime.superGet(this,k.prototype,"enablePlugin").call(this))},disablePlugin:function(){$traceurRuntime.superGet(this,k.prototype,"disablePlugin").call(this)},calculateRowsHeight:function(){var e=void 0!==arguments[0]?arguments[0]:{from:0,to:this.hot.countRows()-1},t=void 0!==arguments[1]?arguments[1]:{from:0,to:this.hot.countCols()-1},n=void 0!==arguments[2]?arguments[2]:!1,o=this;"number"==typeof e&&(e={from:e,to:e}),"number"==typeof t&&(t={from:t,to:t}),S(e.from,e.to,function(e){if(n||void 0===o.heights[e]){var r=o.samplesGenerator.generateRowSamples(e,t);r.forEach(function(e,t){return o.ghostTable.addRow(t,e)})}}),this.ghostTable.rows.length&&(this.ghostTable.getHeights(function(e,t){return o.heights[e]=t}),this.ghostTable.clean())},calculateAllRowsHeight:function(){var e=void 0!==arguments[0]?arguments[0]:{from:0,to:this.hot.countCols()-1},t=this,n=0,o=this.hot.countRows()-1,r=null;this.inProgress=!0;var i=function(){return t.hot?(t.calculateRowsHeight({from:n,to:Math.min(n+k.CALCULATION_STEP,o)},e),n=n+k.CALCULATION_STEP+1,void(o>n?r=v(i):(m(r),t.inProgress=!1,t.hot.view.wt.wtOverlays.adjustElementsSize(!0),t.hot.view.wt.wtOverlays.leftOverlay.needFullRender&&t.hot.view.wt.wtOverlays.leftOverlay.clone.draw()))):(m(r),void(t.inProgress=!1))};this.firstCalculation&&this.getSyncCalculationLimit()&&(this.calculateRowsHeight({from:0,to:this.getSyncCalculationLimit()},e),this.firstCalculation=!1,n=this.getSyncCalculationLimit()+1),o>n?i():this.inProgress=!1},recalculateAllRowsHeight:function(){w(this.hot.view.wt.wtTable.TABLE)&&(this.clearCache(),this.calculateAllRowsHeight())},getSyncCalculationLimit:function(){var e=k.SYNC_CALCULATION_LIMIT,t=this.hot.countRows()-1;return C(this.hot.getSettings().autoRowSize)&&(e=this.hot.getSettings().autoRowSize.syncLimit,O(e)?e=_(t,e):e>>=0),Math.min(e,t)},getRowHeight:function(e){var t=arguments[1],n=t;return void 0!==this.heights[e]&&this.heights[e]>(t||0)&&(n=this.heights[e]),n},getFirstVisibleRow:function(){var e=this.hot.view.wt;return e.wtViewport.rowsVisibleCalculator?e.wtTable.getFirstVisibleRow():e.wtViewport.rowsRenderCalculator?e.wtTable.getFirstRenderedRow():-1},getLastVisibleRow:function(){var e=this.hot.view.wt;return e.wtViewport.rowsVisibleCalculator?e.wtTable.getLastVisibleRow():e.wtViewport.rowsRenderCalculator?e.wtTable.getLastRenderedRow():-1},clearCache:function(){this.heights.length=0},clearCacheByRange:function(e){var t=this;"number"==typeof e&&(e={from:e,to:e}),S(Math.min(e.from,e.to),Math.max(e.from,e.to),function(e){return t.heights[e]=void 0})},isNeedRecalculate:function(){return p(this.heights,function(e){return void 0===e}).length?!0:!1},onBeforeRender:function(){var e=this.hot.renderCall;this.calculateRowsHeight({from:this.getFirstVisibleRow(),to:this.getLastVisibleRow()},void 0,e),this.isNeedRecalculate()&&!this.inProgress&&this.calculateAllRowsHeight()},onBeforeRowMove:function(e,t){this.clearCacheByRange({from:e,to:t}),this.calculateAllRowsHeight()},onBeforeRowResize:function(e,t,n){return n&&(this.calculateRowsHeight(e,void 0,!0),t=this.getRowHeight(e)),t},onAfterLoadData:function(){var e=this;this.hot.view?this.recalculateAllRowsHeight():setTimeout(function(){e.hot&&e.recalculateAllRowsHeight()},0)},onBeforeChange:function(e){var t=null;1===e.length?t=e[0][0]:e.length>1&&(t={from:e[0][0],to:e[e.length-1][0]}),null!==t&&this.clearCacheByRange(t)},destroy:function(){this.ghostTable.clean(),$traceurRuntime.superGet(this,k.prototype,"destroy").call(this)}},{get CALCULATION_STEP(){return 50},get SYNC_CALCULATION_LIMIT(){return 500}},h),E("autoRowSize",M)},{_base:58,"helpers/array":42,"helpers/dom/element":45,"helpers/number":49,"helpers/object":50,"helpers/string":52,plugins:57,"utils/ghostTable":98,"utils/samplesGenerator":99}],61:[function(e,t,n){"use strict";function o(e,t,n,o){var r,i,s,a,l,u=n.length,c=n?n[0].length:0,d=[],h=[];if(r=t.row-e.row,i=t.col-e.col,-1!==["down","up"].indexOf(o)){for(var f=0;i>=f;f++)s=parseInt(n[0][f],10),a=parseInt(n[u-1][f],10),l=("down"===o?a-s:s-a)/(u-1)||0,h.push(l);d.push(h)}if(-1!==["right","left"].indexOf(o))for(var p=0;r>=p;p++)s=parseInt(n[p][0],10),a=parseInt(n[p][c-1],10),l=("right"===o?a-s:s-a)/(c-1)||0,h=[],h.push(l),d.push(h);return d}function r(e){function t(t){return e.autofill?void(e.autofill.handle&&e.autofill.handle.isDragged&&(e.autofill.handle.isDragged>1&&e.autofill.apply(),e.autofill.handle.isDragged=0,a=!1)):!0}function n(e){var t,n;return s.instance.autofill?(t=c(s.instance.table).top-(window.pageYOffset||document.documentElement.scrollTop)+d(s.instance.table),n=c(s.instance.table).left-(window.pageXOffset||document.documentElement.scrollLeft)+h(s.instance.table),s.addingStarted===!1&&s.instance.autofill.handle.isDragged>0&&e.clientY>t&&e.clientX<=n?(s.instance.mouseDragOutside=!0,s.addingStarted=!0):s.instance.mouseDragOutside=!1,void(s.instance.mouseDragOutside&&setTimeout(function(){s.addingStarted=!1,s.instance.alter("insert_row")},200))):!1}var o,r,i,s=this,a=!1;this.instance=e,this.addingStarted=!1,i=f(e),i.addEventListener(document,"mouseup",t),i.addEventListener(document,"mousemove",n),o=this.instance.view.wt.wtSettings.settings.onCellCornerMouseDown,this.instance.view.wt.wtSettings.settings.onCellCornerMouseDown=function(t){e.autofill.handle.isDragged=1,a=!0,o(t)},r=this.instance.view.wt.wtSettings.settings.onCellMouseOver,this.instance.view.wt.wtSettings.settings.onCellMouseOver=function(t,n,o,i){e.autofill&&a&&!e.view.isMouseDown()&&e.autofill.handle&&e.autofill.handle.isDragged&&(e.autofill.handle.isDragged++,e.autofill.showBorder(n),e.autofill.checkIfNewRowNeeded()),r(t,n,o,i)},this.instance.view.wt.wtSettings.settings.onCellCornerDblClick=function(){e.autofill.selectAdjacent()}}Object.defineProperties(n,{Autofill:{get:function(){return r}},__esModule:{value:!0}});var i,s,a,l,u=(i=e("helpers/dom/element"),i&&i.__esModule&&i||{"default":i}),c=u.offset,d=u.outerHeight,h=u.outerWidth,f=(s=e("eventManager"),s&&s.__esModule&&s||{"default":s}).eventManager,p=((a=e("plugins"),a&&a.__esModule&&a||{"default":a}).registerPlugin,(l=e("3rdparty/walkontable/src/cell/coords"),l&&l.__esModule&&l||{"default":l}).WalkontableCellCoords);r.prototype.init=function(){this.handle={}},r.prototype.disable=function(){this.handle.disabled=!0},r.prototype.selectAdjacent=function(){var e,t,n,o,r;e=this.instance.selection.isMultiple()?this.instance.view.wt.selections.area.getCorners():this.instance.view.wt.selections.current.getCorners(),t=this.instance.getData();e:for(n=e[2]+1;nt[3]?(s="right",n=new p(e[0],t[3]+1),r=new p(e[2],e[3])):e[0]t[2]&&e[1]===t[1]&&(s="down",n=new p(t[2]+1,e[1]),r=new p(e[2],e[3])),n&&n.row>-1&&n.col>-1?(l={from:this.instance.getSelectedRange().from,to:this.instance.getSelectedRange().to},i=this.instance.getData(l.from.row,l.from.col,l.to.row,l.to.col),a=o(n,r,i,s),Handsontable.hooks.run(this.instance,"beforeAutofill",n,r,i),this.instance.populateFromArray(n.row,n.col,i,r.row,r.col,"autofill",null,s,a),this.instance.selection.setRangeStart(new p(e[0],e[1])),this.instance.selection.setRangeEnd(new p(e[2],e[3]))):this.instance.selection.refreshBorders())},r.prototype.showBorder=function(e){var t=this.instance.getSelectedRange().getTopLeftCorner(),n=this.instance.getSelectedRange().getBottomRightCorner();if("horizontal"!==this.instance.getSettings().fillHandle&&(n.rowe.row))e=new p(e.row,n.col);else{if("vertical"===this.instance.getSettings().fillHandle)return;e=new p(n.row,e.col)}this.instance.view.wt.selections.fill.clear(),this.instance.view.wt.selections.fill.add(this.instance.getSelectedRange().from),this.instance.view.wt.selections.fill.add(this.instance.getSelectedRange().to),this.instance.view.wt.selections.fill.add(e),this.instance.view.render()},r.prototype.checkIfNewRowNeeded=function(){var e,t,n=this.instance.countRows(),o=this;this.instance.view.wt.selections.fill.cellRange&&this.addingStarted===!1&&(t=this.instance.getSelected(),e=this.instance.view.wt.selections.fill.getCorners(),t[2]n[1]?e?1:-1:0}},dateSort:function(e){return function(t,n){if(t[1]===n[1])return 0;if(null===t[1]||""===t[1])return 1;if(null===n[1]||""===n[1])return-1;var o=new Date(t[1]),r=new Date(n[1]);return r>o?e?-1:1:o>r?e?1:-1:0}},sort:function(){if("undefined"==typeof this.hot.sortOrder)return void(this.hot.sortIndex.length=0);var e,t;this.hot.sortingEnabled=!1,this.hot.sortIndex.length=0;for(var n=this.hot.colOffset(),o=0,r=this.hot.countRows()-this.hot.getSettings().minSpareRows;r>o;o++)this.hot.sortIndex.push([o,this.hot.getDataAtCell(o,this.hot.sortColumn+n)]);switch(e=this.hot.getCellMeta(0,this.hot.sortColumn),this.sortIndicators[this.hot.sortColumn]=e.sortIndicator,e.type){case"date":t=this.dateSort;break;default:t=this.defaultSort}this.hot.sortIndex.sort(t(this.hot.sortOrder));for(var o=this.hot.sortIndex.length;o=0&&-1===r&&u(n,"columnSorting"),f(n,"descending"),f(n,"ascending"),this.sortIndicators[e]&&e===this.hot.sortColumn&&("ascending"===this.sortOrderClass?u(n,"ascending"):"descending"===this.sortOrderClass&&u(n,"descending")))},isSorted:function(){return"undefined"!=typeof this.hot.sortColumn},afterCreateRow:function(e,t){if(this.isSorted()){for(var n=0;n=e&&(this.hot.sortIndex[n][0]+=t);for(var n=0;t>n;n++)this.hot.sortIndex.splice(e+n,0,[e+n,this.hot.getSourceData()[e+n][this.hot.sortColumn+this.hot.colOffset()]]);this.saveSortingState()}},afterRemoveRow:function(e,t){function n(e){return m(o,function(t,n){return e>n&&t++,t},0)}if(this.isSorted()){var o=this.hot.sortIndex.splice(e,t);o=g(o,function(e){return e[0]}),this.hot.sortIndex=g(this.hot.sortIndex,function(e,t){var o=n(e[0]);return o&&(e[0]-=o),e}),this.saveSortingState()}}},{},w),y("columnSorting",b)},{_base:58,eventManager:41,"helpers/array":42,"helpers/dom/element":45,plugins:57}],63:[function(e,t,n){"use strict";Object.defineProperties(n,{CommentEditor:{get:function(){return i}},__esModule:{value:!0}});var o,r=(o=e("helpers/dom/element"),o&&o.__esModule&&o||{"default":o}).addClass,i=function(){this.editor=this.createEditor(),this.editorStyle=this.editor.style,this.editorStyle.position="absolute",this.editorStyle.zIndex=100,this.hide()},s=i;$traceurRuntime.createClass(i,{setPosition:function(e,t){this.editorStyle.left=e+"px",this.editorStyle.top=t+"px"},show:function(){this.editorStyle.display="block"},hide:function(){this.editorStyle.display="none"},isVisible:function(){return"block"===this.editorStyle.display},setValue:function(){var e=void 0!==arguments[0]?arguments[0]:"";e=e||"",this.getInputElement().value=e},getValue:function(){return this.getInputElement().value},isFocused:function(){return document.activeElement===this.getInputElement()},focus:function(){this.getInputElement().focus()},createEditor:function(){var e,t,n=document.querySelector("."+s.CLASS_EDITOR_CONTAINER);return n||(n=document.createElement("div"),r(n,s.CLASS_EDITOR_CONTAINER),document.body.appendChild(n)),e=document.createElement("div"),r(e,s.CLASS_EDITOR),t=document.createElement("textarea"),r(t,s.CLASS_INPUT),e.appendChild(t),n.appendChild(e),e},getInputElement:function(){return this.editor.querySelector("."+s.CLASS_INPUT)},destroy:function(){this.editor.parentNode.removeChild(this.editor),this.editor=null,this.editorStyle=null}},{get CLASS_EDITOR_CONTAINER(){return"htCommentsContainer"},get CLASS_EDITOR(){return"htComments"},get CLASS_INPUT(){return"htCommentTextArea"},get CLASS_CELL(){return"htCommentCell"}})},{"helpers/dom/element":45}],64:[function(e,t,n){"use strict";Object.defineProperties(n,{Comments:{get:function(){return R}},__esModule:{value:!0}});var o,r,i,s,a,l,u=(o=e("helpers/dom/element"),o&&o.__esModule&&o||{"default":o}),c=u.addClass,d=u.closest,h=u.getWindowScrollLeft,f=u.getWindowScrollTop,p=u.hasClass,g=u.offset,m=(r=e("eventManager"),r&&r.__esModule&&r||{"default":r}).EventManager,v=(i=e("3rdparty/walkontable/src/cell/coords"),i&&i.__esModule&&i||{"default":i}).WalkontableCellCoords,w=(s=e("plugins"),s&&s.__esModule&&s||{"default":s}),y=w.registerPlugin,b=(w.getPlugin,(a=e("_base"),a&&a.__esModule&&a||{"default":a})["default"]),C=(l=e("commentEditor"),l&&l.__esModule&&l||{"default":l}).CommentEditor,R=function(e){$traceurRuntime.superConstructor(_).call(this,e),this.editor=null,this.eventManager=null,this.range={},this.mouseDown=!1,this.contextMenuEvent=!1,this.timer=null},_=R;$traceurRuntime.createClass(R,{isEnabled:function(){return this.hot.getSettings().comments},enablePlugin:function(){var e=this;this.enabled||(this.editor||(this.editor=new C),this.eventManager||(this.eventManager=new m(this)),this.addHook("afterContextMenuDefaultOptions",function(t){return e.addToContextMenu(t)}),this.addHook("afterRenderer",function(t,n,o,r,i,s){return e.onAfterRenderer(t,s)}),this.addHook("afterScrollHorizontally",function(){return e.refreshEditorPosition()}),this.addHook("afterScrollVertically",function(){return e.refreshEditorPosition()}),this.addHook("afterColumnResize",function(){return e.refreshEditorPosition()}),this.addHook("afterRowResize",function(){return e.refreshEditorPosition()}),this.registerListeners(),$traceurRuntime.superGet(this,_.prototype,"enablePlugin").call(this))},disablePlugin:function(){$traceurRuntime.superGet(this,_.prototype,"disablePlugin").call(this)},registerListeners:function(){var e=this;this.eventManager.addEventListener(document,"mouseover",function(t){return e.onMouseOver(t)}),this.eventManager.addEventListener(document,"mousedown",function(t){return e.onMouseDown(t)}),this.eventManager.addEventListener(document,"mousemove",function(t){return e.onMouseMove(t)}),this.eventManager.addEventListener(document,"mouseup",function(t){return e.onMouseUp(t)}),this.eventManager.addEventListener(this.editor.getInputElement(),"blur",function(t){return e.onEditorBlur(t)})},setRange:function(e){this.range=e},clearRange:function(){this.range={}},targetIsCellWithComment:function(e){return p(e.target,"htCommentCell")&&d(e.target,[this.hot.rootElement])?!0:!1},targetIsCommentTextArea:function(e){return this.editor.getInputElement()===e.target},saveComment:function(){if(!this.range.from)throw new Error('Before using this method, first set cell range (hot.getPlugin("comment").setRange())');var e=this.editor.getValue(),t=this.range.from.row,n=this.range.from.col;this.hot.setCellMeta(t,n,"comment",e),this.hot.render()},saveCommentAtCell:function(e,t){this.setRange({from:new v(e,t)}),this.saveComment()},removeComment:function(){if(!this.range.from)throw new Error('Before using this method, first set cell range (hot.getPlugin("comment").setRange())');this.hot.removeCellMeta(this.range.from.row,this.range.from.col,"comment"),this.hot.render(),this.hide()},removeCommentAtCell:function(e,t){this.setRange({from:new v(e,t)}),this.removeComment()},show:function(){if(!this.range.from)throw new Error('Before using this method, first set cell range (hot.getPlugin("comment").setRange())');var e=this.hot.getCellMeta(this.range.from.row,this.range.from.col);return this.refreshEditorPosition(!0),this.editor.setValue(e.comment||""),this.editor.show(),!0},showAtCell:function(e,t){return this.setRange({from:new v(e,t)}),this.show()},hide:function(){this.editor.hide()},refreshEditorPosition:function(){var e=void 0!==arguments[0]?arguments[0]:!1;if(e||this.range.from&&this.editor.isVisible()){var t=this.hot.view.wt.wtTable.getCell(this.range.from),n=g(t),o=this.hot.getColWidth(this.range.from.col),r=n.top,i=n.left,s=0,a=0;this.hot.view.wt.wtViewport.hasVerticalScroll()&&(r-=this.hot.view.wt.wtOverlays.topOverlay.getScrollPosition(),s=20),this.hot.view.wt.wtViewport.hasHorizontalScroll()&&(i-=this.hot.view.wt.wtOverlays.leftOverlay.getScrollPosition(),a=20);var l=i+o,u=r,c=this.hot.view.wt.wtTable.holder.getBoundingClientRect(),d={left:c.left+h()+a,right:c.right+h()-15,top:c.top+f()+s,bottom:c.bottom+f()};l<=d.left||l>d.right||u<=d.top||u>d.bottom?this.hide():this.editor.setPosition(l,u)}},onMouseDown:function(e){this.mouseDown=!0,this.hot.view&&this.hot.view.wt&&(this.contextMenuEvent||this.targetIsCommentTextArea(e)||this.targetIsCellWithComment(e)||this.hide(),this.contextMenuEvent=!1)},onMouseOver:function(e){if(!this.mouseDown&&!this.editor.isFocused())if(this.targetIsCellWithComment(e)){var t=this.hot.view.wt.wtTable.getCoords(e.target),n={from:new v(t.row,t.col)};this.setRange(n),this.show()}else this.targetIsCommentTextArea(e)||this.editor.isFocused()||this.hide()},onMouseMove:function(e){var t=this;this.targetIsCommentTextArea(e)&&(this.mouseDown=!0,clearTimeout(this.timer),this.timer=setTimeout(function(){t.mouseDown=!1},200))},onMouseUp:function(e){this.mouseDown=!1},onAfterRenderer:function(e,t){t.comment&&c(e,t.commentedCellClassName)},onEditorBlur:function(e){this.saveComment()},checkSelectionCommentsConsistency:function(){var e=this.hot.getSelectedRange();if(!e)return!1;var t=!1,n=e.from;return this.hot.getCellMeta(n.row,n.col).comment&&(t=!0),t},onContextMenuAddComment:function(){var e=this,t=this.hot.getSelectedRange();this.contextMenuEvent=!0,this.setRange({from:t.from}),this.show(),setTimeout(function(){e.hot&&(e.hot.deselectCell(),e.editor.focus())},10)},onContextMenuRemoveComment:function(e,t){this.contextMenuEvent=!0,this.removeCommentAtCell(t.start.row,t.start.col)},addToContextMenu:function(e){var t=this;e.items.push(Handsontable.plugins.ContextMenu.SEPARATOR,{key:"commentsAddEdit",name:function(){return t.checkSelectionCommentsConsistency()?"Edit Comment":"Add Comment"},callback:function(){return t.onContextMenuAddComment()},disabled:function(){return this.getSelected()?!1:!0}},{key:"commentsRemove",name:function(){return"Delete Comment"},callback:function(e,n){return t.onContextMenuRemoveComment(e,n)},disabled:function(){return!t.checkSelectionCommentsConsistency()}})},destroy:function(){this.editor&&this.editor.destroy(),$traceurRuntime.superGet(this,_.prototype,"destroy").call(this)}},{},b),y("comments",R)},{"3rdparty/walkontable/src/cell/coords":5,_base:58,commentEditor:63,eventManager:41,"helpers/dom/element":45,plugins:57}],65:[function(e,t,n){"use strict";function o(e,t){var n;return i(t,function(t){var o=t.key?t.key.split(":"):null;return Array.isArray(o)&&o[1]===e?(n=t,!1):void 0}),n}Object.defineProperties(n,{CommandExecutor:{get:function(){return s}},__esModule:{value:!0}});var r,i=(r=e("helpers/array"),r&&r.__esModule&&r||{"default":r}).arrayEach,s=function(e){this.hot=e,this.commands={},this.commonCallback=null};$traceurRuntime.createClass(s,{registerCommand:function(e,t){this.commands[e]=t},setCommonCallback:function(e){this.commonCallback=e},execute:function(e){for(var t=[],n=1;n0;if(s)return}}else if(!(t(i)||w(i,"current")&&w(i,"wtBorder")))return;this.open(e)},onMenuAfterOpen:function(){this.hot.runHooks("afterContextMenuShow",this)},onMenuAfterClose:function(){this.hot.listen(),this.hot.runHooks("afterContextMenuHide",this)},destroy:function(){this.close(),this.menu&&this.menu.destroy(),$traceurRuntime.superGet(this,W.prototype,"destroy").call(this)}},{get DEFAULT_ITEMS(){return[E,T,N,O,M,N,k,H,N,D,A,N,x,N,P]}},p),L.SEPARATOR={name:N},Handsontable.hooks.register("afterContextMenuDefaultOptions"),Handsontable.hooks.register("afterContextMenuShow"),Handsontable.hooks.register("afterContextMenuHide"),Handsontable.hooks.register("afterContextMenuExecute"),R("contextMenu",L)},{_base:58,commandExecutor:65,eventManager:41,"helpers/array":42,"helpers/dom/element":45,"helpers/dom/event":46,"helpers/object":50,itemsFactory:68,menu:69,plugins:57,predefinedItems:70}],67:[function(e,t,n){"use strict";Object.defineProperties(n,{Cursor:{get:function(){return d}},__esModule:{value:!0}});var o,r,i=(o=e("helpers/dom/element"),o&&o.__esModule&&o||{"default":o}),s=i.getWindowScrollLeft,a=i.getWindowScrollTop,l=(r=e("helpers/dom/event"),r&&r.__esModule&&r||{"default":r}),u=l.pageX,c=l.pageY,d=function(e){var t,n,o,r,i,l,d,h,f=a(),p=s();this.type=this.getSourceType(e),"literal"===this.type?(t=parseInt(e.top,10),o=parseInt(e.left,10),d=e.height,h=e.width):"event"===this.type&&(t=parseInt(c(e),10),o=parseInt(u(e),10),d=e.target.clientHeight,h=e.target.clientWidth),n=t-f,r=o-p,i=f,l=p,this.top=t,this.topRelative=n,this.left=o,this.leftRelative=r,this.scrollTop=i,this.scrollLeft=l,this.cellHeight=d,this.cellWidth=h};$traceurRuntime.createClass(d,{getSourceType:function(e){var t="literal";return e instanceof Event&&(t="event"),t},fitsAbove:function(e){return this.topRelative>=e.offsetHeight},fitsBelow:function(e){var t=void 0!==arguments[1]?arguments[1]:window.innerHeight;return this.topRelative+e.offsetHeight<=t},fitsOnRight:function(e){var t=void 0!==arguments[1]?arguments[1]:window.innerWidth;return this.leftRelative+this.cellWidth+e.offsetWidth<=t},fitsOnLeft:function(e){return this.leftRelative>=e.offsetWidth}},{}),Handsontable.plugins.utils=Handsontable.plugins.utils||{},Handsontable.plugins.utils.Cursor=d},{"helpers/dom/element":45,"helpers/dom/event":46}],68:[function(e,t,n){"use strict";function o(){var e=void 0!==arguments[0]?arguments[0]:null,t=void 0!==arguments[1]?arguments[1]:[],n=void 0!==arguments[2]?arguments[2]:{},o=[];return e&&e.items?e=e.items:Array.isArray(e)||(e=t),u(e)?l(e,function(e,t){var r=n["string"==typeof e?e:t];r||(r=e), +u(e)?c(r,e):"string"==typeof r&&(r={name:r}),void 0===r.key&&(r.key=t),o.push(r)}):d(e,function(e,t){var r=n[e];!r&&p.indexOf(e)>=0||(r||(r={name:e,key:t+""}),u(e)&&c(r,e),void 0===r.key&&(r.key=t),o.push(r))}),o[0].name===f&&o.shift(),o}Object.defineProperties(n,{ItemsFactory:{get:function(){return m}},__esModule:{value:!0}});var r,i,s,a=(r=e("helpers/object"),r&&r.__esModule&&r||{"default":r}),l=a.objectEach,u=a.isObject,c=a.extend,d=(i=e("helpers/array"),i&&i.__esModule&&i||{"default":i}).arrayEach,h=(s=e("predefinedItems"),s&&s.__esModule&&s||{"default":s}),f=h.SEPARATOR,p=h.ITEMS,g=h.predefinedItems,m=function(e){var t=void 0!==arguments[1]?arguments[1]:null;this.hot=e,this.predefinedItems=g(),this.defaultOrderPattern=t};$traceurRuntime.createClass(m,{setPredefinedItems:function(e){var t=this,n={};this.defaultOrderPattern.length=0,l(e,function(e,o){var r="";e.name===f?(n[f]=e,r=f):isNaN(parseInt(o,10))?(e.key=void 0===e.key?o:e.key,n[o]=e,r=e.key):(n[e.key]=e,r=e.key),t.defaultOrderPattern.push(r)}),this.predefinedItems=n},getVisibleItems:function(){var e=void 0!==arguments[0]?arguments[0]:null,t=this,n={};return l(this.predefinedItems,function(e,o){(!e.hidden||e.hidden&&!e.hidden.apply(t.hot))&&(n[o]=e)}),o(e,this.defaultOrderPattern,n)},getItems:function(){var e=void 0!==arguments[0]?arguments[0]:null;return o(e,this.defaultOrderPattern,this.predefinedItems)}},{})},{"helpers/array":42,"helpers/object":50,predefinedItems:70}],69:[function(e,t,n){"use strict";Object.defineProperties(n,{Menu:{get:function(){return W}},__esModule:{value:!0}});var o,r,i,s,a,l,u,c,d,h,f=(o=e("helpers/dom/element"),o&&o.__esModule&&o||{"default":o}),p=f.addClass,g=f.empty,m=f.fastInnerHTML,v=(f.getComputedStyle,f.getScrollbarWidth),w=(f.getWindowScrollLeft,f.getWindowScrollTop,f.hasClass,f.isChildOf),y=f.removeClass,b=(r=e("helpers/array"),r&&r.__esModule&&r||{"default":r}).arrayEach,C=(i=e("cursor"),i&&i.__esModule&&i||{"default":i}).Cursor,R=(s=e("eventManager"),s&&s.__esModule&&s||{"default":s}).EventManager,_=(a=e("helpers/object"),a&&a.__esModule&&a||{"default":a}),S=(_.extend,_.isObject,_.objectEach,_.mixin),E=(l=e("utils"),l&&l.__esModule&&l||{"default":l}),T=E.isSeparator,O=E.isDisabled,M=E.isSelectionDisabled,k=E.hasSubMenu,H=E.normalizeSelection,D=(u=e("helpers/unicode"),u&&u.__esModule&&u||{"default":u}).KEY_CODES,A=(c=e("mixins/localHooks"),c&&c.__esModule&&c||{"default":c}).localHooks,x=(d=e("predefinedItems"),d&&d.__esModule&&d||{"default":d}),P=x.SEPARATOR,N=(x.predefinedItems,h=e("helpers/dom/event"),h&&h.__esModule&&h||{"default":h}),L=(N.stopPropagation,N.stopImmediatePropagation),W=(N.pageX,N.pageY,function(e){var t=void 0!==arguments[1]?arguments[1]:{parent:null,name:null,className:"",keepInViewport:!0};this.hot=e,this.options=t,this.eventManager=new R(this),this.container=this.createContainer(this.options.name),this.hotMenu=null,this.hotSubMenus={},this.parentMenu=this.options.parent||null,this.menuItems=null,this.origOutsideClickDeselects=null,this._afterScrollCallback=null,this.registerEvents()}),I=W;$traceurRuntime.createClass(W,{registerEvents:function(){var e=this;this.eventManager.addEventListener(document.documentElement,"mousedown",function(t){return e.onDocumentMouseDown(t)})},setMenuItems:function(e){this.menuItems=e},isSubMenu:function(){return null!==this.parentMenu},open:function(){var e=this;this.container.removeAttribute("style"),this.container.style.display="block";var t={data:this.menuItems,colHeaders:!1,colWidths:[200],autoRowSize:!1,readOnly:!0,copyPaste:!1,columns:[{data:"name",renderer:function(t,n,o,r,i,s){return e.menuItemRenderer(t,n,o,r,i,s)}}],renderAllRows:!0,fragmentSelection:"cell",beforeKeyDown:function(t){return e.onBeforeKeyDown(t)},afterOnCellMouseOver:function(t,n,o){return e.openSubMenu(n.row)}};this.origOutsideClickDeselects=this.hot.getSettings().outsideClickDeselects,this.hot.getSettings().outsideClickDeselects=!1,this.hotMenu=new Handsontable.Core(this.container,t),this.hotMenu.addHook("afterInit",function(){return e.onAfterInit()}),this.hotMenu.init(),this.hotMenu.listen(),this.blockMainTableCallbacks(),this.runLocalHooks("afterOpen")},close:function(){var e=void 0!==arguments[0]?arguments[0]:!1;this.isOpened()&&(e&&this.parentMenu?this.parentMenu.close():(this.closeAllSubMenus(),this.container.style.display="none",this.releaseMainTableCallbacks(),this.hotMenu.destroy(),this.hotMenu=null,this.hot.getSettings().outsideClickDeselects=this.origOutsideClickDeselects,this.runLocalHooks("afterClose")))},openSubMenu:function(e){var t=this.hotMenu.getCell(e,0);if(this.closeAllSubMenus(),!t||!k(t))return!1;var n=this.hotMenu.getSourceDataAtRow(e),o=new I(this.hot,{parent:this,name:n.name,className:this.options.className});return o.setMenuItems(n.submenu.items),o.open(),o.setPosition(t.getBoundingClientRect()),this.hotSubMenus[n.key]=o,o},closeSubMenu:function(e){var t=this.hotMenu.getSourceDataAtRow(e),n=this.hotSubMenus[t.key];n&&(n.destroy(),delete this.hotSubMenus[t.key])},closeAllSubMenus:function(){var e=this;b(this.hotMenu.getData(),function(t,n){return e.closeSubMenu(n)})},isAllSubMenusClosed:function(){return 0===Object.keys(this.hotSubMenus).length},destroy:function(){this.clearLocalHooks(),this.close(),this.parentMenu=null,this.eventManager.destroy()},isOpened:function(){return null!==this.hotMenu},executeCommand:function(e){if(this.isOpened()&&this.hotMenu.getSelected()){var t=this.hotMenu.getSourceDataAtRow(this.hotMenu.getSelected()[0]);if(this.runLocalHooks("select",t,e),t.isCommand!==!1){var n=this.hot.getSelectedRange(),o=n?H(n):{};this.runLocalHooks("executeCommand",t.key,o,e),this.isSubMenu()&&this.parentMenu.runLocalHooks("executeCommand",t.key,o,e),this.close(!0)}}},setPosition:function(e){var t=new C(e);this.options.keepInViewport?(t.fitsBelow(this.container)?this.setPositionBelowCursor(t):t.fitsAbove(this.container)?this.setPositionAboveCursor(t):this.setPositionBelowCursor(t),t.fitsOnRight(this.container)?this.setPositionOnRightOfCursor(t):this.setPositionOnLeftOfCursor(t)):(this.setPositionBelowCursor(t),this.setPositionOnRightOfCursor(t))},setPositionAboveCursor:function(e){var t=e.top-this.container.offsetHeight;this.isSubMenu()&&(t=window.scrollY+e.top+e.cellHeight-this.container.offsetHeight+3),this.container.style.top=t+"px"},setPositionBelowCursor:function(e){var t=e.top-1;this.isSubMenu()&&(t=e.top+window.scrollY-1),this.container.style.top=t+"px"},setPositionOnRightOfCursor:function(e){var t;t=this.isSubMenu()?window.scrollX+1+e.left+e.cellWidth:1+e.left,this.container.style.left=t+"px"},setPositionOnLeftOfCursor:function(e){this.container.style.left=e.left-this.container.offsetWidth+v()+4+"px"},selectFirstCell:function(){var e=this.hotMenu.getCell(0,0);T(e)||O(e)||M(e)?this.selectNextCell(0,0):this.hotMenu.selectCell(0,0)},selectLastCell:function(){var e=this.hotMenu.countRows()-1,t=this.hotMenu.getCell(e,0);T(t)||O(t)||M(t)?this.selectPrevCell(e,0):this.hotMenu.selectCell(e,0)},selectNextCell:function(e,t){var n=e+1,o=n=0?this.hotMenu.getCell(n,t):null;o&&(T(o)||O(o)||M(o)?this.selectPrevCell(n,t):this.hotMenu.selectCell(n,t))},menuItemRenderer:function(e,t,n,o,r,i){var s=this,a=e.getSourceDataAtRow(n),l=document.createElement("div"),u=function(e){return e.hasOwnProperty("submenu")},c=function(e){return new RegExp(P,"i").test(e.name)},d=function(e){return e.disabled===!0||"function"==typeof e.disabled&&e.disabled.call(s.hot)===!0},h=function(e){return"function"==typeof e.hidden&&e.hidden.call(s.hot)===!0},f=function(e){return e.disableSelection},v=h(a);"function"==typeof i&&(i=i.call(this.hot)),g(t),p(l,"htItemWrapper"),t.appendChild(l),c(a)?p(t,"htSeparator"):v||"function"!=typeof a.renderer?m(l,i):(p(t,"htCustomMenuRenderer"),t.appendChild(a.renderer(e,l,n,o,r,i))),v?t.parentNode&&p(t.parentNode,"htHidden"):d(a)?(p(t,"htDisabled"),this.eventManager.addEventListener(l,"mouseenter",function(){return e.deselectCell()})):f(a)?(p(t,"htSelectionDisabled"),this.eventManager.addEventListener(l,"mouseenter",function(){return e.deselectCell()})):u(a)?(p(t,"htSubmenu"),f(a)?this.eventManager.addEventListener(l,"mouseenter",function(){return e.deselectCell()}):this.eventManager.addEventListener(l,"mouseenter",function(){return e.selectCell(n,o,void 0,void 0,void 0,!1)})):(y(t,"htSubmenu"),y(t,"htDisabled"),f(a)?this.eventManager.addEventListener(l,"mouseenter",function(){return e.deselectCell()}):this.eventManager.addEventListener(l,"mouseenter",function(){return e.selectCell(n,o,void 0,void 0,void 0,!1)}))},createContainer:function(){var e=void 0!==arguments[0]?arguments[0]:null;e&&(e=e.replace(/ /g,"_"),e=this.options.className+"Sub_"+e);var t;return t=e?document.querySelector("."+this.options.className+"."+e):document.querySelector("."+this.options.className),t||(t=document.createElement("div"),p(t,"htMenu "+this.options.className),e&&p(t,e),document.getElementsByTagName("body")[0].appendChild(t)),t},blockMainTableCallbacks:function(){this._afterScrollCallback=function(){},this.hot.addHook("afterScrollVertically",this._afterScrollCallback),this.hot.addHook("afterScrollHorizontally",this._afterScrollCallback)},releaseMainTableCallbacks:function(){this._afterScrollCallback&&(this.hot.removeHook("afterScrollVertically",this._afterScrollCallback),this.hot.removeHook("afterScrollHorizontally",this._afterScrollCallback),this._afterScrollCallback=null)},onBeforeKeyDown:function(e){var t=this.hotMenu.getSelected(),n=!1;switch(e.keyCode){case D.ESCAPE:this.close(),n=!0;break;case D.ENTER:t&&(this.hotMenu.getSourceDataAtRow(t[0]).submenu?n=!0:(this.executeCommand(e),this.close(!0)));break;case D.ARROW_DOWN:t?this.selectNextCell(t[0],t[1]):this.selectFirstCell(),n=!0;break;case D.ARROW_UP:t?this.selectPrevCell(t[0],t[1]):this.selectLastCell(),n=!0;break;case D.ARROW_RIGHT:if(t){var o=this.openSubMenu(t[0]);o&&o.selectFirstCell()}n=!0;break;case D.ARROW_LEFT:t&&this.isSubMenu()&&(this.close(),this.parentMenu&&this.parentMenu.hotMenu.listen(),n=!0)}n&&(e.preventDefault(),L(e))},onAfterInit:function(){var e=this.hotMenu.getSettings().data,t=this.hotMenu.view.wt.wtTable.hider.style,n=this.hotMenu.view.wt.wtTable.holder.style,o=parseInt(t.width,10),r=0;b(e,function(e){return r+=e.name===P?1:26}),n.width=o+22+"px",n.height=r+4+"px"},onDocumentMouseDown:function(e){this.isOpened()&&(this.container&&w(e.target,this.container)&&this.executeCommand(e),(this.isAllSubMenusClosed()||this.isSubMenu())&&!w(e.target,".htMenu")&&w(e.target,document)&&this.close(!0))}},{}),S(W,A)},{cursor:67,eventManager:41,"helpers/array":42,"helpers/dom/element":45,"helpers/dom/event":46,"helpers/object":50,"helpers/unicode":53,"mixins/localHooks":54,predefinedItems:70,utils:71}],70:[function(e,t,n){"use strict";function o(){var e={};return c(D,function(t,n){return e[n]=d(t)}),e}function r(e,t){-1===H.indexOf(e)&&(D[e]=t)}var i;Object.defineProperties(n,{ROW_ABOVE:{get:function(){return w}},ROW_BELOW:{get:function(){return y}},COLUMN_LEFT:{get:function(){return b}},COLUMN_RIGHT:{get:function(){return C}},CLEAR_COLUMN:{get:function(){return R}},REMOVE_ROW:{get:function(){return _}},REMOVE_COLUMN:{get:function(){return S}},UNDO:{get:function(){return E}},REDO:{get:function(){return T}},READ_ONLY:{get:function(){return O}},ALIGNMENT:{get:function(){return M}},SEPARATOR:{get:function(){return k}},ITEMS:{get:function(){return H}},predefinedItems:{get:function(){return o}},addItem:{get:function(){return r}},__esModule:{value:!0}});var s,a,l,u=(s=e("helpers/object"),s&&s.__esModule&&s||{"default":s}),c=u.objectEach,d=u.clone,h=((a=e("helpers/number"),a&&a.__esModule&&a||{"default":a}).rangeEach,l=e("utils"),l&&l.__esModule&&l||{"default":l}),f=h.align,p=h.getAlignmentClasses,g=h.getValidSelection,m=h.checkSelectionConsistency,v=h.markLabelAsSelected,w="row_above",y="row_below",b="col_left",C="col_right",R="clear_column",_="remove_row",S="remove_col",E="undo",T="redo",O="make_read_only",M="alignment",k="---------",H=[w,y,b,C,R,_,S,E,T,O,M,k],D=(i={},Object.defineProperty(i,k,{value:{name:k},configurable:!0,enumerable:!0,writable:!0}),Object.defineProperty(i,w,{value:{key:w,name:"Insert row above",callback:function(e,t){this.alter("insert_row",t.start.row)},disabled:function(){var e=g(this);if(!e)return!0;var t=this.countRows(),n=[0,e[1],t-1,e[1]];return n.join(",")===e.join(",")&&t>1},hidden:function(){return!this.getSettings().allowInsertRow}},configurable:!0,enumerable:!0,writable:!0}),Object.defineProperty(i,y,{value:{key:y,name:"Insert row below",callback:function(e,t){this.alter("insert_row",t.end.row+1)},disabled:function(){var e=g(this);if(!e)return!0;var t=this.countRows(),n=[0,e[1],t-1,e[1]];return n.join(",")===e.join(",")&&t>1},hidden:function(){return!this.getSettings().allowInsertRow}},configurable:!0,enumerable:!0,writable:!0}),Object.defineProperty(i,b,{value:{key:b,name:"Insert column on the left",callback:function(e,t){this.alter("insert_col",t.start.col)},disabled:function(){var e=g(this);if(!e)return!0;if(!this.isColumnModificationAllowed())return!0;var t=[e[0],0,e[0],this.countCols()-1],n=t.join(",")==e.join(",");return e[1]<0||this.countCols()>=this.getSettings().maxCols||n},hidden:function(){return!this.getSettings().allowInsertColumn}},configurable:!0,enumerable:!0,writable:!0}),Object.defineProperty(i,C,{value:{key:C,name:"Insert column on the right",callback:function(e,t){this.alter("insert_col",t.end.col+1)},disabled:function(){var e=g(this);if(!e)return!0;if(!this.isColumnModificationAllowed())return!0;var t=[e[0],0,e[0],this.countCols()-1],n=t.join(",")==e.join(",");return e[1]<0||this.countCols()>=this.getSettings().maxCols||n},hidden:function(){return!this.getSettings().allowInsertColumn}},configurable:!0,enumerable:!0,writable:!0}),Object.defineProperty(i,R,{value:{key:R,name:"Clear column",callback:function(e,t){var n=t.start.col;this.countRows()&&this.populateFromArray(0,n,[[null]],Math.max(t.start.row,t.end.row),n)},disabled:function(){var e=g(this);if(!e)return!0;var t=[e[0],0,e[0],this.countCols()-1],n=t.join(",")==e.join(",");return e[1]<0||this.countCols()>=this.getSettings().maxCols||n}},configurable:!0,enumerable:!0,writable:!0}),Object.defineProperty(i,_,{value:{key:_,name:"Remove row",callback:function(e,t){var n=t.end.row-t.start.row+1;this.alter("remove_row",t.start.row,n)},disabled:function(){var e=g(this);if(!e)return!0;var t=[0,e[1],this.countRows()-1,e[1]];return t.join(",")===e.join(",")},hidden:function(){return!this.getSettings().allowRemoveRow}},configurable:!0,enumerable:!0,writable:!0}),Object.defineProperty(i,S,{value:{key:S,name:"Remove column",callback:function(e,t){var n=t.end.col-t.start.col+1;this.alter("remove_col",t.start.col,n)},disabled:function(){var e=g(this);if(!e)return!0;if(!this.isColumnModificationAllowed())return!0;var t=[e[0],0,e[0],this.countCols()-1],n=t.join(",")==e.join(",");return e[1]<0||n},hidden:function(){return!this.getSettings().allowRemoveColumn}},configurable:!0,enumerable:!0,writable:!0}),Object.defineProperty(i,E,{value:{key:E,name:"Undo",callback:function(){this.undo()},disabled:function(){return this.undoRedo&&!this.undoRedo.isUndoAvailable()}},configurable:!0,enumerable:!0,writable:!0}),Object.defineProperty(i,T,{value:{key:T,name:"Redo",callback:function(){this.redo()},disabled:function(){return this.undoRedo&&!this.undoRedo.isRedoAvailable()}},configurable:!0,enumerable:!0,writable:!0}),Object.defineProperty(i,O,{value:{key:O,name:function(){var e=this,t="Read only",n=m(this.getSelectedRange(),function(t,n){return e.getCellMeta(t,n).readOnly});return n&&(t=v(t)),t},callback:function(){var e=this,t=this.getSelectedRange(),n=m(t,function(t,n){return e.getCellMeta(t,n).readOnly});t.forAll(function(t,o){e.getCellMeta(t,o).readOnly=n?!1:!0}),this.render()},disabled:function(){return this.getSelectedRange()?!1:!0}},configurable:!0,enumerable:!0,writable:!0}),Object.defineProperty(i,M,{value:{key:M,name:"Alignment",disabled:function(){return this.getSelectedRange()?!1:!0},submenu:{items:[{key:M+":left",name:function(){var e=this,t="Left",n=m(this.getSelectedRange(),function(t,n){var o=e.getCellMeta(t,n).className;return o&&-1!==o.indexOf("htLeft")?!0:void 0});return n&&(t=v(t)),t},callback:function(){var e=this,t=this.getSelectedRange(),n=p(t,function(t,n){return e.getCellMeta(t,n).className}),o="horizontal",r="htLeft";this.runHooks("beforeCellAlignment",n,t,o,r),f(t,o,r,function(t,n){return e.getCellMeta(t,n)}),this.render()},disabled:!1},{key:M+":center",name:function(){var e=this,t="Center",n=m(this.getSelectedRange(),function(t,n){var o=e.getCellMeta(t,n).className;return o&&-1!==o.indexOf("htCenter")?!0:void 0});return n&&(t=v(t)),t},callback:function(){var e=this,t=this.getSelectedRange(),n=p(t,function(t,n){return e.getCellMeta(t,n).className}),o="horizontal",r="htCenter";this.runHooks("beforeCellAlignment",n,t,o,r),f(t,o,r,function(t,n){return e.getCellMeta(t,n)}),this.render()},disabled:!1},{key:M+":right",name:function(){var e=this,t="Right",n=m(this.getSelectedRange(),function(t,n){var o=e.getCellMeta(t,n).className;return o&&-1!==o.indexOf("htRight")?!0:void 0});return n&&(t=v(t)),t},callback:function(){var e=this,t=this.getSelectedRange(),n=p(t,function(t,n){return e.getCellMeta(t,n).className}),o="horizontal",r="htRight";this.runHooks("beforeCellAlignment",n,t,o,r),f(t,o,r,function(t,n){return e.getCellMeta(t,n)}),this.render()},disabled:!1},{key:M+":justify",name:function(){var e=this,t="Justify",n=m(this.getSelectedRange(),function(t,n){var o=e.getCellMeta(t,n).className;return o&&-1!==o.indexOf("htJustify")?!0:void 0});return n&&(t=v(t)),t},callback:function(){var e=this,t=this.getSelectedRange(),n=p(t,function(t,n){return e.getCellMeta(t,n).className}),o="horizontal",r="htJustify";this.runHooks("beforeCellAlignment",n,t,o,r),f(t,o,r,function(t,n){return e.getCellMeta(t,n)}),this.render()},disabled:!1},{name:k},{key:M+":top",name:function(){var e=this,t="Top",n=m(this.getSelectedRange(),function(t,n){var o=e.getCellMeta(t,n).className;return o&&-1!==o.indexOf("htTop")?!0:void 0});return n&&(t=v(t)),t},callback:function(){var e=this,t=this.getSelectedRange(),n=p(t,function(t,n){return e.getCellMeta(t,n).className}),o="vertical",r="htTop";this.runHooks("beforeCellAlignment",n,t,o,r),f(t,o,r,function(t,n){return e.getCellMeta(t,n)}),this.render()},disabled:!1},{key:M+":middle",name:function(){var e=this,t="Middle",n=m(this.getSelectedRange(),function(t,n){var o=e.getCellMeta(t,n).className;return o&&-1!==o.indexOf("htMiddle")?!0:void 0});return n&&(t=v(t)),t},callback:function(){var e=this,t=this.getSelectedRange(),n=p(t,function(t,n){return e.getCellMeta(t,n).className}),o="vertical",r="htMiddle";this.runHooks("beforeCellAlignment",n,t,o,r),f(t,o,r,function(t,n){return e.getCellMeta(t,n)}),this.render()},disabled:!1},{key:M+":bottom",name:function(){var e=this,t="Bottom",n=m(this.getSelectedRange(),function(t,n){var o=e.getCellMeta(t,n).className;return o&&-1!==o.indexOf("htBottom")?!0:void 0});return n&&(t=v(t)),t},callback:function(){var e=this,t=this.getSelectedRange(),n=p(t,function(t,n){return e.getCellMeta(t,n).className}),o="vertical",r="htBottom";this.runHooks("beforeCellAlignment",n,t,o,r),f(t,o,r,function(t,n){return e.getCellMeta(t,n)}),this.render()},disabled:!1}]}},configurable:!0,enumerable:!0,writable:!0}),i)},{"helpers/number":49,"helpers/object":50,utils:71}],71:[function(e,t,n){"use strict";function o(e){return{start:e.getTopLeftCorner(),end:e.getBottomRightCorner()}}function r(e){return v(e,"htSeparator")}function i(e){return v(e,"htSubmenu")}function s(e){return v(e,"htDisabled")}function a(e){return v(e,"htSelectionDisabled")}function l(e){var t=e.getSelected();return t?t[0]<0?null:e.countRows()>=e.getSettings().maxRows?null:t:null}function u(e,t){return-1!=e.indexOf(t)?e:(e=e.replace("htTop","").replace("htMiddle","").replace("htBottom","").replace(" ",""),e+=" "+t)}function c(e,t){return-1!=e.indexOf(t)?e:(e=e.replace("htLeft","").replace("htCenter","").replace("htRight","").replace("htJustify","").replace(" ",""),e+=" "+t)}function d(e,t){for(var n={},o=e.from.row;o<=e.to.row;o++)for(var r=e.from.col;r<=e.to.col;r++)n[o]||(n[o]=[]),n[o][r]=t(o,r);return n}function h(e,t,n,o){if(e.from.row==e.to.row&&e.from.col==e.to.col)f(e.from.row,e.from.col,t,n,o);else for(var r=e.from.row;r<=e.to.row;r++)for(var i=e.from.col;i<=e.to.col;i++)f(r,i,t,n,o)}function f(e,t,n,o,r){var i=r(e,t),s=o;i.className&&(s="vertical"===n?u(i.className,o):c(i.className,o)),i.className=s}function p(e,t){var n=!1;return e&&e.forAll(function(e,o){return t(e,o)?(n=!0,!1):void 0}),n}function g(e){return''+String.fromCharCode(10003)+""+e}Object.defineProperties(n,{normalizeSelection:{get:function(){return o}},isSeparator:{get:function(){return r}},hasSubMenu:{get:function(){return i}},isDisabled:{get:function(){return s}},isSelectionDisabled:{get:function(){return a}},getValidSelection:{get:function(){return l}},prepareVerticalAlignClass:{get:function(){return u}},prepareHorizontalAlignClass:{get:function(){return c}},getAlignmentClasses:{get:function(){return d}},align:{get:function(){return h}},checkSelectionConsistency:{get:function(){return p}},markLabelAsSelected:{get:function(){return g}},__esModule:{value:!0}});var m,v=(m=e("helpers/dom/element"),m&&m.__esModule&&m||{"default":m}).hasClass},{"helpers/dom/element":45}],72:[function(e,t,n){"use strict";Object.defineProperties(n,{ContextMenuCopyPaste:{get:function(){return g}},__esModule:{value:!0}});var o,r,i,s,a,l,u=(o=e("helpers/dom/element"),o&&o.__esModule&&o||{"default":o}).removeClass,c=(r=e("helpers/array"),r&&r.__esModule&&r||{"default":r}).arrayEach,d=(i=e("eventManager"),i&&i.__esModule&&i||{"default":i}).EventManager,h=(s=e("plugins"),s&&s.__esModule&&s||{"default":s}).registerPlugin,f=(a=e("_base"),a&&a.__esModule&&a||{"default":a})["default"],p=(l=e("zeroclipboard"),l&&l.__esModule&&l||{"default":l})["default"],g=function(e){$traceurRuntime.superConstructor(m).call(this,e),this.eventManager=new d(this),this.swfPath=null,this.outsideClickDeselectsCache=null},m=g;$traceurRuntime.createClass(g,{isEnabled:function(){return this.hot.getSettings().contextMenuCopyPaste},enablePlugin:function(){var e=this;if(!this.enabled){"object"==typeof this.hot.getSettings().contextMenuCopyPaste&&(this.swfPath=this.hot.getSettings().contextMenuCopyPaste.swfPath),"undefined"==typeof p&&console.error("To be able to use the Copy/Paste feature from the context menu, you need to manually include ZeroClipboard.js file to your website.");try{new ActiveXObject("ShockwaveFlash.ShockwaveFlash")}catch(t){"undefined"==typeof navigator.mimeTypes["application/x-shockwave-flash"]&&console.error("To be able to use the Copy/Paste feature from the context menu, your browser needs to have Flash Plugin installed.")}this.swfPath&&p.config({swfPath:this.swfPath}),this.hot.addHook("afterContextMenuShow",function(){return e.onAfterContextMenuShow()}),this.hot.addHook("afterContextMenuDefaultOptions",function(t){return e.onAfterContextMenuDefaultOptions(t)}),this.registerEvents(),$traceurRuntime.superGet(this,m.prototype,"enablePlugin").call(this)}},disablePlugin:function(){$traceurRuntime.superGet(this,m.prototype,"disablePlugin").call(this)},registerEvents:function(){var e=this;this.eventManager.addEventListener(document,"mouseenter",function(){return e.removeCurrentClass()}),this.eventManager.addEventListener(document,"mouseleave",function(){return e.removeZeroClipboardClass()})},getCopyValue:function(){return this.hot.copyPaste.setCopyableText(),this.hot.copyPaste.copyPasteInstance.elTextarea.value},onAfterContextMenuDefaultOptions:function(e){e.items.unshift({key:"copy",name:"Copy"},{key:"paste",name:"Paste",callback:function(){this.copyPaste.triggerPaste()}},Handsontable.plugins.ContextMenu.SEPARATOR)},onAfterContextMenuShow:function(){var e=this,t=this.hot.getPlugin("contextMenu"),n=t.menu.hotMenu.getSourceData();c(n,function(n,o){if("copy"===n.key){var r=new p(t.menu.hotMenu.getCell(o,0));return r.off(),r.on("copy",function(t){var n=t.clipboardData;n.setData("text/plain",e.getCopyValue()),e.hot.getSettings().outsideClickDeselects=e.outsideClickDeselectsCache}),!1}})},removeCurrentClass:function(){var e=this.hot.getPlugin("contextMenu");if(e.menu.isOpened()){var t=e.menu.hotMenu.rootElement.querySelector("td.current");t&&u(t,"current")}this.outsideClickDeselectsCache=this.hot.getSettings().outsideClickDeselects,this.hot.getSettings().outsideClickDeselects=!1},removeZeroClipboardClass:function(){var e=this.hot.getPlugin("contextMenu");if(e.menu.isOpened()){var t=e.menu.hotMenu.rootElement.querySelector("td.zeroclipboard-is-hover");t&&u(t,"zeroclipboard-is-hover")}this.hot.getSettings().outsideClickDeselects=this.outsideClickDeselectsCache}},{},f),h("contextMenuCopyPaste",g)},{_base:58,eventManager:41,"helpers/array":42,"helpers/dom/element":45,plugins:57,zeroclipboard:"zeroclipboard"}],73:[function(e,t,n){"use strict";function o(e){function t(){e.isListening()&&e.selection.empty()}function n(t){var n,o,r,i,s,a,l,u,c,d;if(e.isListening()&&e.selection.isSelected()){n=t,o=v.parse(n),r=e.getSelected(),i=new M(r[0],r[1]),s=new M(r[2],r[3]),a=new k(i,i,s),l=a.getTopLeftCorner(),u=a.getBottomRightCorner(),c=l,d=new M(Math.max(u.row,o.length-1+l.row),Math.max(u.col,o[0].length-1+l.col));var h=s.row-i.row>=o.length-1,f=s.col-i.col>=o[0].length-1;e.addHookOnce("afterChange",function(t,n){var o=t?t.length:0;if(o){var r={row:0,col:0},i=-1;C(t,function(e,n){var s=o>n+1?t[n+1]:null;s&&(h||(r.row=r.row+Math.max(s[0]-e[0]-1,0)),!f&&e[1]>i&&(i=e[1],r.col=r.col+Math.max(s[1]-e[1]-1,0)))}),e.selectCell(c.row,c.col,d.row+r.row,d.col+r.col)}}),e.populateFromArray(c.row,c.col,o,d.row,d.col,"paste",e.getSettings().pasteMode)}}function o(t){if(e.getSelected()&&!(e.getActiveEditor()&&e.getActiveEditor().isOpened()||E(t))){if(b(t.keyCode)){if(e.getSettings().fragmentSelection&&T())return;return r.setCopyableText(),void S(t)}var n=(t.ctrlKey||t.metaKey)&&!t.altKey;t.keyCode==y.A&&n&&e._registerTimeout(setTimeout(O(r.setCopyableText,r),0))}}var r=this;this.copyPasteInstance=m(),this.copyPasteInstance.onCut(t),this.copyPasteInstance.onPaste(n),this.onPaste=n,e.addHook("beforeKeyDown",o),this.destroy=function(){this.copyPasteInstance&&(this.copyPasteInstance.removeCallback(t),this.copyPasteInstance.removeCallback(n),this.copyPasteInstance.destroy(),this.copyPasteInstance=null),e.removeHook("beforeKeyDown",o)},e.addHook("afterDestroy",O(this.destroy,this)),this.triggerPaste=O(this.copyPasteInstance.triggerPaste,this.copyPasteInstance),this.triggerCut=O(this.copyPasteInstance.triggerCut,this.copyPasteInstance),this.setCopyableText=function(){var t=e.getSettings(),n=t.copyRowsLimit,o=t.copyColsLimit,r=e.getSelectedRange(),i=r.getTopLeftCorner(),s=r.getBottomRightCorner(),a=i.row,l=i.col,u=s.row,c=s.col,d=Math.min(u,a+n-1),h=Math.min(c,l+o-1),f=[];f.push({startRow:a,startCol:l,endRow:d,endCol:h}),f=Handsontable.hooks.run(e,"modifyCopyableRange",f);var p=this.getRangedCopyableData(f);e.copyPaste.copyPasteInstance.copyable(p),(u!==d||c!==h)&&Handsontable.hooks.run(e,"afterCopyLimit",u-a+1,c-l+1,n,o)},this.getRangedCopyableData=function(t){var n=[],o=[],r=[];return C(t,function(e){R(e.startRow,e.endRow,function(e){-1===o.indexOf(e)&&o.push(e)}),R(e.startCol,e.endCol,function(e){-1===r.indexOf(e)&&r.push(e)})}),C(o,function(t){var o=[];C(r,function(n){o.push(e.getCopyableData(t,n))}),n.push(o)}),v.stringify(n)}}function r(){var e=this,t=e.getSettings().copyPaste!==!1;t&&!e.copyPaste?e.copyPaste=new o(e):!t&&e.copyPaste&&(e.copyPaste.destroy(),e.copyPaste=null)}Object.defineProperties(n,{CopyPastePlugin:{get:function(){return o}},__esModule:{value:!0}});var i,s,a,l,u,c,d,h,f,p,g,m=(i=e("copyPaste"),i&&i.__esModule&&i||{"default":i})["default"],v=(s=e("SheetClip"),s&&s.__esModule&&s||{"default":s})["default"],w=(a=e("helpers/unicode"),a&&a.__esModule&&a||{"default":a}),y=w.KEY_CODES,b=w.isCtrlKey,C=(l=e("helpers/array"),l&&l.__esModule&&l||{"default":l}).arrayEach,R=(u=e("helpers/number"),u&&u.__esModule&&u||{"default":u}).rangeEach,_=(c=e("helpers/dom/event"),c&&c.__esModule&&c||{"default":c}),S=_.stopImmediatePropagation,E=_.isImmediatePropagationStopped,T=(d=e("helpers/dom/element"),d&&d.__esModule&&d||{"default":d}).getSelectionText,O=(h=e("helpers/function"),h&&h.__esModule&&h||{"default":h}).proxy,M=((f=e("plugins"),f&&f.__esModule&&f||{"default":f}).registerPlugin,(p=e("3rdparty/walkontable/src/cell/coords"),p&&p.__esModule&&p||{"default":p}).WalkontableCellCoords),k=(g=e("3rdparty/walkontable/src/cell/range"),g&&g.__esModule&&g||{"default":g}).WalkontableCellRange;Handsontable.hooks.add("afterInit",r),Handsontable.hooks.add("afterUpdateSettings",r),Handsontable.hooks.register("afterCopyLimit"),Handsontable.hooks.register("modifyCopyableRange")},{"3rdparty/walkontable/src/cell/coords":5,"3rdparty/walkontable/src/cell/range":6,SheetClip:"SheetClip",copyPaste:"copyPaste","helpers/array":42,"helpers/dom/element":45,"helpers/dom/event":46,"helpers/function":47,"helpers/number":49,"helpers/unicode":53,plugins:57}],74:[function(e,t,n){"use strict";function o(){}var r,i,s,a,l=((r=e("plugins"),r&&r.__esModule&&r||{"default":r}).registerPlugin,(i=e("3rdparty/walkontable/src/cell/range"),i&&i.__esModule&&i||{"default":i}).WalkontableCellRange),u=(s=e("3rdparty/walkontable/src/selection"),s&&s.__esModule&&s||{"default":s}).WalkontableSelection,c=function(e){return"boolean"==typeof e&&e===!0?!0:"object"==typeof e&&e.length>0?!0:!1},d=function(){c(this.getSettings().customBorders)&&(this.customBorders||(a=this,this.customBorders=new o))},h=function(e){for(var t=0;t=0?a.view.wt.selections[o]=n:a.view.wt.selections.push(n)},p=function(e,t,n){var o=b(e,t);o=C(o,n),this.setCellMeta(e,t,"borders",o),f(o)},g=function(e){for(var t=e.range,n=t.from.row;n<=t.to.row;n++)for(var o=t.from.col;o<=t.to.col;o++){var r=b(n,o),i=0;n==t.from.row&&(i++,e.hasOwnProperty("top")&&(r.top=e.top)),n==t.to.row&&(i++,e.hasOwnProperty("bottom")&&(r.bottom=e.bottom)),o==t.from.col&&(i++,e.hasOwnProperty("left")&&(r.left=e.left)),o==t.to.col&&(i++,e.hasOwnProperty("right")&&(r.right=e.right)),i>0&&(this.setCellMeta(n,o,"borders",r),f(r))}},m=function(e,t){return"border_row"+e+"col"+t},v=function(){return{width:1,color:"#000"}},w=function(){return{hide:!0}},y=function(){return{width:1,color:"#000",cornerVisible:!1}},b=function(e,t){return{className:m(e,t),border:y(),row:e,col:t,top:w(),right:w(),bottom:w(),left:w()}},C=function(e,t){return t.hasOwnProperty("border")&&(e.border=t.border),t.hasOwnProperty("top")&&(e.top=t.top),t.hasOwnProperty("right")&&(e.right=t.right),t.hasOwnProperty("bottom")&&(e.bottom=t.bottom),t.hasOwnProperty("left")&&(e.left=t.left),e},R=function(e){for(var t=document.querySelectorAll("."+e),n=0;n'+String.fromCharCode(10003)+""+e},M=function(e){this.getSettings().customBorders&&(e.items.push(Handsontable.plugins.ContextMenu.SEPARATOR),e.items.push({key:"borders",name:"Borders",submenu:{items:[{key:"borders:top",name:function(){var e="Top",t=T(this,"top");return t&&(e=O(e)),e},callback:function(){var e=T(this,"top");E.call(this,this.getSelectedRange(),"top",e)},disabled:!1},{key:"borders:right",name:function(){var e="Right",t=T(this,"right");return t&&(e=O(e)),e},callback:function(){var e=T(this,"right");E.call(this,this.getSelectedRange(),"right",e)},disabled:!1},{key:"borders:bottom",name:function(){var e="Bottom",t=T(this,"bottom");return t&&(e=O(e)),e},callback:function(){var e=T(this,"bottom");E.call(this,this.getSelectedRange(),"bottom",e)},disabled:!1},{key:"borders:left",name:function(){var e="Left",t=T(this,"left");return t&&(e=O(e)),e},callback:function(){var e=T(this,"left");E.call(this,this.getSelectedRange(),"left",e)},disabled:!1},{key:"borders:no_borders",name:"Remove border(s)",callback:function(){E.call(this,this.getSelectedRange(),"noBorders")},disabled:function(){return!T(this)}}]}}))};Handsontable.hooks.add("beforeInit",d),Handsontable.hooks.add("afterContextMenuDefaultOptions",M),Handsontable.hooks.add("afterInit",function(){var e=this.getSettings().customBorders;if(e){for(var t=0;tthis.boundaries.bottom&&(o=t-this.boundaries.bottom),ethis.boundaries.right&&(n=e-this.boundaries.right),this.callback(n,o)};var a,l=function(e){e.dragToScrollListening=!1;var t=e.view.wt.wtTable.holder;a=new o,t!==window&&(a.setBoundaries(t.getBoundingClientRect()),a.setCallback(function(e,n){0>e?t.scrollLeft-=50:e>0&&(t.scrollLeft+=50),0>n?t.scrollTop-=20:n>0&&(t.scrollTop+=20)}),e.dragToScrollListening=!0)};Handsontable.hooks.add("afterInit",function(){var e=this,t=s(this);t.addEventListener(document,"mouseup",function(){e.dragToScrollListening=!1}),t.addEventListener(document,"mousemove",function(t){e.dragToScrollListening&&a.check(t.clientX,t.clientY)})}),Handsontable.hooks.add("afterDestroy",function(){s(this).clear()}),Handsontable.hooks.add("afterOnCellMouseDown",function(){l(this)}),Handsontable.hooks.add("afterOnCellCornerMouseDown",function(){l(this)}),Handsontable.plugins.DragToScroll=o},{eventManager:41,plugins:57}],76:[function(e,t,n){"use strict";Object.defineProperties(n,{ManualColumnFreeze:{get:function(){return a}},__esModule:{value:!0}});var o,r,i=(o=e("_base"),o&&o.__esModule&&o||{"default":o})["default"],s=(r=e("plugins"),r&&r.__esModule&&r||{"default":r}).registerPlugin,a=function(e){$traceurRuntime.superConstructor(l).call(this,e)},l=a;$traceurRuntime.createClass(a,{isEnabled:function(){return!!this.hot.getSettings().manualColumnFreeze},enablePlugin:function(){var e=this;this.enabled||(this.addHook("modifyCol",function(t){return e.onModifyCol(t)}),this.addHook("afterContextMenuDefaultOptions",function(t){return e.addContextMenuEntry(t)}),$traceurRuntime.superGet(this,l.prototype,"enablePlugin").call(this))},disablePlugin:function(){$traceurRuntime.superGet(this,l.prototype,"disablePlugin").call(this)},init:function(){$traceurRuntime.superGet(this,l.prototype,"init").call(this),"undefined"==typeof this.hot.manualColumnPositionsPluginUsages?this.hot.manualColumnPositionsPluginUsages=["manualColumnFreeze"]:this.hot.manualColumnPositionsPluginUsages.push("manualColumnFreeze"),this.fixedColumnsCount=this.hot.getSettings().fixedColumnsLeft},onModifyCol:function(e){return this.hot.manualColumnPositionsPluginUsages.length>1?e:this.getModifiedColumnIndex(e)},getModifiedColumnIndex:function(e){return this.hot.manualColumnPositions[e]},addContextMenuEntry:function(e){var t=this;e.items.push(Handsontable.plugins.ContextMenu.SEPARATOR,{key:"freeze_column",name:function(){var e=t.hot.getSelected()[1];return e>t.fixedColumnsCount-1?"Freeze this column":"Unfreeze this column"},disabled:function(){var e=t.hot.getSelected();return e[1]!==e[3]},callback:function(){var e=t.hot.getSelected()[1];e>t.fixedColumnsCount-1?t.freezeColumn(e):t.unfreezeColumn(e)}})},freezeColumn:function(e){if(!(e<=this.fixedColumnsCount-1)){var t=this.getModifiedColumnIndex(e)||e;this.checkPositionData(t),this.modifyColumnOrder(t,e,null,"freeze"),this.addFixedColumn(),this.hot.view.wt.wtOverlays.leftOverlay.refresh(),this.hot.view.wt.wtOverlays.adjustElementsSize()}},unfreezeColumn:function(e){if(!(e>this.fixedColumnsCount-1)){var t=this.getBestColumnReturnPosition(e),n=this.getModifiedColumnIndex(e)||e;this.checkPositionData(n),this.modifyColumnOrder(n,e,t,"unfreeze"),this.removeFixedColumn(),this.hot.view.wt.wtOverlays.leftOverlay.refresh(),this.hot.view.wt.wtOverlays.adjustElementsSize()}},addFixedColumn:function(){this.hot.updateSettings({fixedColumnsLeft:this.fixedColumnsCount+1}),this.fixedColumnsCount++},removeFixedColumn:function(){this.hot.updateSettings({fixedColumnsLeft:this.fixedColumnsCount-1}),this.fixedColumnsCount--},checkPositionData:function(e){this.hot.manualColumnPositions&&0!==this.hot.manualColumnPositions.length||this.hot.manualColumnPositions||(this.hot.manualColumnPositions=[]),e?this.hot.manualColumnPositions[e]||this.createPositionData(e+1):this.createPositionData(this.hot.countCols())},createPositionData:function(e){if(this.hot.manualColumnPositions.lengtht;t++)this.hot.manualColumnPositions[t]=t},modifyColumnOrder:function(e,t,n,o){null==n&&(n=e),"freeze"===o?this.hot.manualColumnPositions.splice(this.fixedColumnsCount,0,this.hot.manualColumnPositions.splice(t,1)[0]):"unfreeze"===o&&this.hot.manualColumnPositions.splice(n,0,this.hot.manualColumnPositions.splice(t,1)[0])},getBestColumnReturnPosition:function(e){for(var t=this.fixedColumnsCount,n=this.getModifiedColumnIndex(t),o=this.getModifiedColumnIndex(e);o>n;)t++,n=this.getModifiedColumnIndex(t);return t-1}},{},i),s("manualColumnFreeze",a)},{_base:58,plugins:57}],77:[function(e,t,n){"use strict";function o(){function e(e){g=this,m=e;var t=this.view.wt.wtTable.getCoords(e).col;if(t>=0){f=t;var n=m.getBoundingClientRect();l=n.left,v.style.top=n.top+"px",v.style.left=l+"px",g.rootElement.appendChild(v)}}function t(e,t){var n=e.getBoundingClientRect(),o=6;t>0?v.style.left=n.left+n.width-o+"px":v.style.left=n.left+"px"}function n(){var e=this;u(v,"active"),u(w,"active");var t=m.getBoundingClientRect();w.style.width=t.width+"px",w.style.height=e.view.maximumVisibleElementHeight(0)+"px",w.style.top=v.style.top,w.style.left=l+"px",e.rootElement.appendChild(w)}function o(e){w.style.left=l+e+"px"}function r(){d(v,"active"),d(w,"active")}var i,s,a,l,f,g,m,v=document.createElement("DIV"),w=document.createElement("DIV"),y=h(this);v.className="manualColumnMover",w.className="manualColumnMoverGuide";var b=function(){var e=this;Handsontable.hooks.run(e,"persistentStateSave","manualColumnPositions",e.manualColumnPositions)},C=function(){var e=this,t={};return Handsontable.hooks.run(e,"persistentStateLoad","manualColumnPositions",t),t.value},R=function(e){return"BODY"!=e.tagName?"THEAD"==e.parentNode.tagName?!0:(e=e.parentNode,R(e)):!1},_=function(e){return"TABLE"!=e.tagName?"TH"==e.tagName?e:_(e.parentNode):null},S=function(){var l,u=this;y.addEventListener(u.rootElement,"mouseover",function(n){if(R(n.target)){var o=_(n.target);if(o)if(l){var r=u.view.wt.wtTable.getCoords(o).col;r>=0&&(s=r,t(n.target,s-i))}else e.call(u,o)}}),y.addEventListener(u.rootElement,"mousedown",function(e){c(e.target,"manualColumnMover")&&(a=p(e),n.call(u),l=u,i=f,s=f)}),y.addEventListener(window,"mousemove",function(e){l&&o(p(e)-a)}),y.addEventListener(window,"mouseup",function(t){l&&(r(),l=!1,T(u.manualColumnPositions,u.countCols()),u.manualColumnPositions.splice(s,0,u.manualColumnPositions.splice(i,1)[0]),Handsontable.hooks.run(u,"beforeColumnMove",i,s),u.forceFullRender=!0,u.view.render(),b.call(u),Handsontable.hooks.run(u,"afterColumnMove",i,s),e.call(u,m))}),u.addHook("afterDestroy",E)},E=function(){y.clear()},T=function(e,t){if(e.lengthn;n++)e[n]=n};this.beforeInit=function(){this.manualColumnPositions=[]},this.init=function(e){var t=this,n=!!this.getSettings().manualColumnMove;if(n){var o=this.getSettings().manualColumnMove,r=C.call(t);"undefined"!=typeof r?this.manualColumnPositions=r:Array.isArray(o)?this.manualColumnPositions=o:this.manualColumnPositions=[],("afterInit"===e||"afterUpdateSettings"===e&&0===y.context.eventListeners.length)&&("undefined"==typeof t.manualColumnPositionsPluginUsages?t.manualColumnPositionsPluginUsages=["manualColumnMove"]:t.manualColumnPositionsPluginUsages.push("manualColumnMove"),S.call(this),this.manualColumnPositions.length>0&&(this.forceFullRender=!0,this.render()))}else{var i=t.manualColumnPositionsPluginUsages?t.manualColumnPositionsPluginUsages.indexOf("manualColumnMove"):-1;i>-1&&(E.call(this),this.manualColumnPositions=[],t.manualColumnPositionsPluginUsages[i]=void 0)}},this.modifyCol=function(e){return this.getSettings().manualColumnMove?("undefined"==typeof this.manualColumnPositions[e]&&T(this.manualColumnPositions,e+1),this.manualColumnPositions[e]):e},this.afterRemoveCol=function(e,t){if(this.getSettings().manualColumnMove){var n,o=this.manualColumnPositions;n=o.splice(e,t),o=o.map(function(e){var t,o=e;for(t=0;tn[t]&&o--;return o}),this.manualColumnPositions=o}},this.afterCreateCol=function(e,t){if(this.getSettings().manualColumnMove){var n=this.manualColumnPositions;if(n.length){for(var o=[],r=0;t>r;r++)o.push(e+r);e>=n.length?n.concat(o):(n=n.map(function(n){return n>=e?n+t:n}),n.splice.apply(n,[e,0].concat(o))),this.manualColumnPositions=n}}}}Object.defineProperties(n,{ManualColumnMove:{get:function(){return o}},__esModule:{value:!0}});var r,i,s,a,l=(r=e("helpers/dom/element"),r&&r.__esModule&&r||{"default":r}),u=l.addClass,c=l.hasClass,d=l.removeClass,h=(i=e("eventManager"),i&&i.__esModule&&i||{"default":i}).eventManager,f=(s=e("helpers/dom/event"),s&&s.__esModule&&s||{"default":s}),p=f.pageX,g=(f.pageY,(a=e("plugins"),a&&a.__esModule&&a||{"default":a}).registerPlugin,new o);Handsontable.hooks.add("beforeInit",g.beforeInit),Handsontable.hooks.add("afterInit",function(){g.init.call(this,"afterInit")}),Handsontable.hooks.add("afterUpdateSettings",function(){g.init.call(this,"afterUpdateSettings")}),Handsontable.hooks.add("modifyCol",g.modifyCol),Handsontable.hooks.add("afterRemoveCol",g.afterRemoveCol),Handsontable.hooks.add("afterCreateCol",g.afterCreateCol),Handsontable.hooks.register("beforeColumnMove"),Handsontable.hooks.register("afterColumnMove")},{eventManager:41,"helpers/dom/element":45,"helpers/dom/event":46,plugins:57}],78:[function(e,t,n){"use strict";Object.defineProperties(n,{ManualColumnResize:{get:function(){return v}},__esModule:{value:!0}});var o,r,i,s,a,l=(o=e("_base.js"),o&&o.__esModule&&o||{"default":o})["default"],u=(r=e("helpers/dom/element"),r&&r.__esModule&&r||{"default":r}),c=u.addClass,d=u.hasClass,h=u.removeClass,f=(i=e("eventManager"),i&&i.__esModule&&i||{"default":i}).eventManager,p=(s=e("helpers/dom/event"),s&&s.__esModule&&s||{"default":s}),g=p.pageX,m=(p.pageY,(a=e("plugins"),a&&a.__esModule&&a||{"default":a}).registerPlugin),v=function(e){$traceurRuntime.superConstructor(w).call(this,e),this.currentTH=null,this.currentCol=null,this.currentWidth=null,this.newSize=null,this.startY=null,this.startWidth=null,this.startOffset=null,this.handle=document.createElement("DIV"),this.guide=document.createElement("DIV"),this.eventManager=f(this),this.pressed=null,this.dblclick=0,this.autoresizeTimeout=null,this.manualColumnWidths=[],c(this.handle,"manualColumnResizer"),c(this.guide,"manualColumnResizerGuide")},w=v;$traceurRuntime.createClass(v,{isEnabled:function(){return this.hot.getSettings().manualColumnResize},enablePlugin:function(){var e=this;if(!this.enabled){this.manualColumnWidths=[];var t=this.hot.getSettings().manualColumnResize,n=this.loadManualColumnWidths();this.addHook("modifyColWidth",function(t,n){return e.onModifyColWidth(t,n)}),"undefined"!=typeof n?this.manualColumnWidths=n:Array.isArray(t)?this.manualColumnWidths=t:this.manualColumnWidths=[],Handsontable.hooks.register("beforeColumnResize"),Handsontable.hooks.register("afterColumnResize"),this.bindEvents(),$traceurRuntime.superGet(this,w.prototype,"enablePlugin").call(this)}},updatePlugin:function(){var e=this.hot.getSettings().manualColumnResize;Array.isArray(e)?this.manualColumnWidths=e:this.manualColumnWidths=[]},disablePlugin:function(){$traceurRuntime.superGet(this,w.prototype,"disablePlugin").call(this)},saveManualColumnWidths:function(){this.hot.runHooks("persistentStateSave","manualColumnWidths",this.manualColumnWidths)},loadManualColumnWidths:function(){var e={};return this.hot.runHooks("persistentStateLoad","manualColumnWidths",e),e.value},setupHandlePosition:function(e){this.currentTH=e;var t=this.hot.view.wt.wtTable.getCoords(e).col;if(t>=0){var n=this.currentTH.getBoundingClientRect();this.currentCol=t,this.startOffset=n.left-6,this.startWidth=parseInt(n.width,10),this.handle.style.top=n.top+"px",this.handle.style.left=this.startOffset+this.startWidth+"px",this.hot.rootElement.appendChild(this.handle)}},refreshHandlePosition:function(){this.handle.style.left=this.startOffset+this.currentWidth+"px"},setupGuidePosition:function(){c(this.handle,"active"),c(this.guide,"active"),this.guide.style.top=this.handle.style.top,this.guide.style.left=this.handle.style.left,this.guide.style.height=this.hot.view.maximumVisibleElementHeight(0)+"px",this.hot.rootElement.appendChild(this.guide)},refreshGuidePosition:function(){this.guide.style.left=this.handle.style.left},hideHandleAndGuide:function(){h(this.handle,"active"),h(this.guide,"active")},checkIfColumnHeader:function(e){return"BODY"!=e.tagName?"THEAD"==e.parentNode.tagName?!0:(e=e.parentNode,this.checkIfColumnHeader(e)):!1},getTHFromTargetElement:function(e){return"TABLE"!=e.tagName?"TH"==e.tagName?e:this.getTHFromTargetElement(e.parentNode):null},onMouseOver:function(e){if(this.checkIfColumnHeader(e.target)){var t=this.getTHFromTargetElement(e.target);if(!t)return;var n=t.getAttribute("colspan");!t||null!==n&&1!==n||this.pressed||this.setupHandlePosition(t)}},afterMouseDownTimeout:function(){if(this.dblclick>=2){var e=this.hot.runHooks("beforeColumnResize",this.currentCol,this.newSize,!0);void 0!==e&&(this.newSize=e),this.setManualSize(this.currentCol,this.newSize),this.hot.forceFullRender=!0,this.hot.view.render(),this.hot.view.wt.wtOverlays.adjustElementsSize(!0),this.hot.runHooks("afterColumnResize",this.currentCol,this.newSize,!0)}this.dblclick=0,this.autoresizeTimeout=null},onMouseDown:function(e){var t=this;d(e.target,"manualColumnResizer")&&(this.setupGuidePosition(),this.pressed=this.hot,null===this.autoresizeTimeout&&(this.autoresizeTimeout=setTimeout(function(){return t.afterMouseDownTimeout()},500),this.hot._registerTimeout(this.autoresizeTimeout)),this.dblclick++,this.startX=g(e),this.newSize=this.startWidth)},onMouseMove:function(e){this.pressed&&(this.currentWidth=this.startWidth+(g(e)-this.startX),this.newSize=this.setManualSize(this.currentCol,this.currentWidth),this.refreshHandlePosition(),this.refreshGuidePosition())},onMouseUp:function(e){this.pressed&&(this.hideHandleAndGuide(),this.pressed=!1,this.newSize!=this.startWidth&&(this.hot.runHooks("beforeColumnResize",this.currentCol,this.newSize),this.hot.forceFullRender=!0,this.hot.view.render(),this.hot.view.wt.wtOverlays.adjustElementsSize(!0),this.saveManualColumnWidths(),this.hot.runHooks("afterColumnResize",this.currentCol,this.newSize)),this.setupHandlePosition(this.currentTH))},bindEvents:function(){var e=this;this.eventManager.addEventListener(this.hot.rootElement,"mouseover",function(t){return e.onMouseOver(t)}),this.eventManager.addEventListener(this.hot.rootElement,"mousedown",function(t){return e.onMouseDown(t)}),this.eventManager.addEventListener(window,"mousemove",function(t){return e.onMouseMove(t)}),this.eventManager.addEventListener(window,"mouseup",function(t){return e.onMouseUp(t)})},setManualSize:function(e,t){return t=Math.max(t,20),e=this.hot.runHooks("modifyCol",e),this.manualColumnWidths[e]=t,t},onModifyColWidth:function(e,t){return this.enabled&&(t=this.hot.runHooks("modifyCol",t),this.hot.getSettings().manualColumnResize&&this.manualColumnWidths[t])?this.manualColumnWidths[t]:e}},{},l),m("manualColumnResize",v)},{"_base.js":58,eventManager:41,"helpers/dom/element":45,"helpers/dom/event":46,plugins:57}],79:[function(e,t,n){"use strict";function o(){function e(e){var t=this;g=e;var n=this.view.wt.wtTable.getCoords(e).row;if(n>=0){f=n;var o=g.getBoundingClientRect();l=o.top,m.style.top=l+"px",m.style.left=o.left+"px",t.rootElement.appendChild(m)}}function t(e,t){var n=e.getBoundingClientRect(),o=6;t>0?m.style.top=n.top+n.height-o+"px":m.style.top=n.top+"px"}function n(){var e=this;u(m,"active"),u(v,"active");var t=g.getBoundingClientRect();v.style.width=e.view.maximumVisibleElementWidth(0)+"px",v.style.height=t.height+"px",v.style.top=l+"px",v.style.left=m.style.left,e.rootElement.appendChild(v)}function o(e){v.style.top=l+e+"px"}function r(){d(m,"active"),d(v,"active")}var i,s,a,l,f,g,m=document.createElement("DIV"),v=document.createElement("DIV"),w=h(this);m.className="manualRowMover",v.className="manualRowMoverGuide";var y=function(){var e=this;Handsontable.hooks.run(e,"persistentStateSave","manualRowPositions",e.manualRowPositions)},b=function(){var e=this,t={};return Handsontable.hooks.run(e,"persistentStateLoad","manualRowPositions",t),t.value},C=function(e){return"BODY"!=e.tagName?"TBODY"==e.parentNode.tagName?!0:(e=e.parentNode,C(e)):!1},R=function(e){return"TABLE"!=e.tagName?"TH"==e.tagName?e:R(e.parentNode):null},_=function(){var l,u=this;w.addEventListener(u.rootElement,"mouseover",function(n){if(C(n.target)){var o=R(n.target);o&&(l?(s=u.view.wt.wtTable.getCoords(o).row,t(o,s-i)):e.call(u,o))}}),w.addEventListener(u.rootElement,"mousedown",function(e){c(e.target,"manualRowMover")&&(a=p(e),n.call(u),l=u,i=f,s=f)}),w.addEventListener(window,"mousemove",function(e){l&&o(p(e)-a)}),w.addEventListener(window,"mouseup",function(t){l&&(r(),l=!1,E(u.manualRowPositions,u.countRows()),u.manualRowPositions.splice(s,0,u.manualRowPositions.splice(i,1)[0]),Handsontable.hooks.run(u,"beforeRowMove",i,s),u.forceFullRender=!0,u.view.render(),y.call(u),Handsontable.hooks.run(u,"afterRowMove",i,s),e.call(u,g))}),u.addHook("afterDestroy",S)},S=function(){w.clear()},E=function(e,t){if(e.lengthn;n++)e[n]=n};this.beforeInit=function(){this.manualRowPositions=[]},this.init=function(e){var t=this,n=!!t.getSettings().manualRowMove;if(n){var o=t.getSettings().manualRowMove,r=b.call(t);"undefined"==typeof t.manualRowPositionsPluginUsages?t.manualRowPositionsPluginUsages=["manualColumnMove"]:t.manualRowPositionsPluginUsages.push("manualColumnMove"),"undefined"!=typeof r?this.manualRowPositions=r:Array.isArray(o)?this.manualRowPositions=o:this.manualRowPositions=[],("afterInit"===e||"afterUpdateSettings"===e&&0===w.context.eventListeners.length)&&(_.call(this),this.manualRowPositions.length>0&&(t.forceFullRender=!0,t.render()))}else{var i=t.manualRowPositionsPluginUsages?t.manualRowPositionsPluginUsages.indexOf("manualColumnMove"):-1;i>-1&&(S.call(this),t.manualRowPositions=[],t.manualRowPositionsPluginUsages[i]=void 0)}},this.modifyRow=function(e){var t=this;return t.getSettings().manualRowMove?("undefined"==typeof t.manualRowPositions[e]&&E(this.manualRowPositions,e+1),t.manualRowPositions[e]):e}}Object.defineProperties(n,{ManualRowMove:{get:function(){return o}},__esModule:{value:!0}});var r,i,s,a,l=(r=e("helpers/dom/element"),r&&r.__esModule&&r||{"default":r}),u=l.addClass,c=l.hasClass,d=l.removeClass,h=(i=e("eventManager"),i&&i.__esModule&&i||{"default":i}).eventManager,f=(s=e("helpers/dom/event"),s&&s.__esModule&&s||{"default":s}),p=(f.pageX,f.pageY),g=((a=e("plugins"),a&&a.__esModule&&a||{"default":a}).registerPlugin,new o);Handsontable.hooks.add("beforeInit",g.beforeInit),Handsontable.hooks.add("afterInit",function(){g.init.call(this,"afterInit")}),Handsontable.hooks.add("afterUpdateSettings",function(){g.init.call(this,"afterUpdateSettings")}),Handsontable.hooks.add("modifyRow",g.modifyRow),Handsontable.hooks.register("beforeRowMove"),Handsontable.hooks.register("afterRowMove")},{eventManager:41,"helpers/dom/element":45,"helpers/dom/event":46,plugins:57}],80:[function(e,t,n){"use strict";Object.defineProperties(n,{ManualRowResize:{get:function(){return v}},__esModule:{value:!0}});var o,r,i,s,a,l=(o=e("_base.js"),o&&o.__esModule&&o||{"default":o})["default"],u=(r=e("helpers/dom/element"),r&&r.__esModule&&r||{"default":r}),c=u.addClass,d=u.hasClass,h=u.removeClass,f=(i=e("eventManager"),i&&i.__esModule&&i||{"default":i}).eventManager,p=(s=e("helpers/dom/event"),s&&s.__esModule&&s||{"default":s}),g=(p.pageX,p.pageY),m=(a=e("plugins"),a&&a.__esModule&&a||{"default":a}).registerPlugin,v=function(e){$traceurRuntime.superConstructor(w).call(this,e),this.currentTH=null,this.currentRow=null,this.currentHeight=null,this.newSize=null,this.startY=null,this.startHeight=null,this.startOffset=null,this.handle=document.createElement("DIV"),this.guide=document.createElement("DIV"),this.eventManager=f(this),this.pressed=null,this.dblclick=0,this.autoresizeTimeout=null,this.manualRowHeights=[],c(this.handle,"manualRowResizer"),c(this.guide,"manualRowResizerGuide")},w=v;$traceurRuntime.createClass(v,{isEnabled:function(){return this.hot.getSettings().manualRowResize},enablePlugin:function(){var e=this;if(!this.enabled){this.manualRowHeights=[];var t=this.hot.getSettings().manualRowResize,n=this.loadManualRowHeights();"undefined"!=typeof n?this.manualRowHeights=n:Array.isArray(t)?this.manualRowHeights=t:this.manualRowHeights=[],this.addHook("modifyRowHeight",function(t,n){return e.onModifyRowHeight(t,n)}),Handsontable.hooks.register("beforeRowResize"),Handsontable.hooks.register("afterRowResize"),this.bindEvents(),$traceurRuntime.superGet(this,w.prototype,"enablePlugin").call(this)}},updatePlugin:function(){var e=this.hot.getSettings().manualRowResize;Array.isArray(e)?this.manualRowHeights=e:this.manualRowHeights=[]},disablePlugin:function(){$traceurRuntime.superGet(this,w.prototype,"disablePlugin").call(this)},saveManualRowHeights:function(){this.hot.runHooks("persistentStateSave","manualRowHeights",this.manualRowHeights)},loadManualRowHeights:function(){var e={};return this.hot.runHooks("persistentStateLoad","manualRowHeights",e),e.value},setupHandlePosition:function(e){this.currentTH=e;var t=this.hot.view.wt.wtTable.getCoords(e).row;if(t>=0){var n=this.currentTH.getBoundingClientRect();this.currentRow=t,this.startOffset=n.top-6,this.startHeight=parseInt(n.height,10),this.handle.style.left=n.left+"px",this.handle.style.top=this.startOffset+this.startHeight+"px",this.hot.rootElement.appendChild(this.handle)}},refreshHandlePosition:function(){this.handle.style.top=this.startOffset+this.currentHeight+"px"},setupGuidePosition:function(){c(this.handle,"active"),c(this.guide,"active"),this.guide.style.top=this.handle.style.top,this.guide.style.left=this.handle.style.left,this.guide.style.width=this.hot.view.maximumVisibleElementWidth(0)+"px",this.hot.rootElement.appendChild(this.guide)},refreshGuidePosition:function(){this.guide.style.top=this.handle.style.top},hideHandleAndGuide:function(){h(this.handle,"active"),h(this.guide,"active")},checkIfRowHeader:function(e){return"BODY"!=e.tagName?"TBODY"==e.parentNode.tagName?!0:(e=e.parentNode,this.checkIfRowHeader(e)):!1},getTHFromTargetElement:function(e){return"TABLE"!=e.tagName?"TH"==e.tagName?e:this.getTHFromTargetElement(e.parentNode):null},onMouseOver:function(e){if(this.checkIfRowHeader(e.target)){var t=this.getTHFromTargetElement(e.target);t&&(this.pressed||this.setupHandlePosition(t))}},afterMouseDownTimeout:function(){if(this.dblclick>=2){var e=this.hot.runHooks("beforeRowResize",this.currentRow,this.newSize,!0);void 0!==e&&(this.newSize=e),this.setManualSize(this.currentRow,this.newSize),this.hot.forceFullRender=!0,this.hot.view.render(),this.hot.view.wt.wtOverlays.adjustElementsSize(!0),this.hot.runHooks("afterRowResize",this.currentRow,this.newSize,!0)}this.dblclick=0,this.autoresizeTimeout=null},onMouseDown:function(e){var t=this;d(e.target,"manualRowResizer")&&(this.setupGuidePosition(),this.pressed=this.hot,null==this.autoresizeTimeout&&(this.autoresizeTimeout=setTimeout(function(){return t.afterMouseDownTimeout()},500),this.hot._registerTimeout(this.autoresizeTimeout)),this.dblclick++,this.startY=g(e),this.newSize=this.startHeight)},onMouseMove:function(e){this.pressed&&(this.currentHeight=this.startHeight+(g(e)-this.startY),this.newSize=this.setManualSize(this.currentRow,this.currentHeight),this.refreshHandlePosition(),this.refreshGuidePosition())},onMouseUp:function(e){this.pressed&&(this.hideHandleAndGuide(),this.pressed=!1,this.newSize!=this.startHeight&&(this.hot.runHooks("beforeRowResize",this.currentRow,this.newSize),this.hot.forceFullRender=!0,this.hot.view.render(),this.hot.view.wt.wtOverlays.adjustElementsSize(!0),this.saveManualRowHeights(),this.hot.runHooks("afterRowResize",this.currentRow,this.newSize)),this.setupHandlePosition(this.currentTH))},bindEvents:function(){var e=this;this.eventManager.addEventListener(this.hot.rootElement,"mouseover",function(t){return e.onMouseOver(t)}),this.eventManager.addEventListener(this.hot.rootElement,"mousedown",function(t){return e.onMouseDown(t)}),this.eventManager.addEventListener(window,"mousemove",function(t){return e.onMouseMove(t)}),this.eventManager.addEventListener(window,"mouseup",function(t){return e.onMouseUp(t)})},setManualSize:function(e,t){return e=this.hot.runHooks("modifyRow",e),this.manualRowHeights[e]=t,t},onModifyRowHeight:function(e,t){if(this.enabled){var n=this.hot.getPlugin("autoRowSize"),o=n?n.heights[t]:null;t=this.hot.runHooks("modifyRow",t);var r=this.manualRowHeights[t];if(void 0!==r&&(r===o||r>(e||0)))return r}return e}},{},l),m("manualRowResize",v)},{"_base.js":58,eventManager:41,"helpers/dom/element":45,"helpers/dom/event":46,plugins:57}],81:[function(e,t,n){"use strict";function o(){var e=[];return e.getInfo=function(e,t){for(var n=0,o=this.length;o>n;n++)if(this[n].row<=e&&this[n].row+this[n].rowspan-1>=e&&this[n].col<=t&&this[n].col+this[n].colspan-1>=t)return this[n]},e.setInfo=function(e){for(var t=0,n=this.length;n>t;t++)if(this[t].row===e.row&&this[t].col===e.col)return void(this[t]=e);this.push(e)},e.removeInfo=function(e,t){for(var n=0,o=this.length;o>n;n++)if(this[n].row===e&&this[n].col===t){this.splice(n,1);break}},e}function r(e){if(this.mergedCellInfoCollection=new o,Array.isArray(e))for(var t=0,n=e.length;n>t;t++)this.mergedCellInfoCollection.setInfo(e[t])}function i(e,t){var n=this.getSettings().mergeCells;if(n&&!this.selection.isMultiple()){var o=this.mergeCells.mergedCellInfoCollection.getInfo(e[0],e[1]);o&&(e[0]=o.row,e[1]=o.col,e[2]=o.row+o.rowspan-1,e[3]=o.col+o.colspan-1)}}function s(e,t){this.mergeCells&&this.mergeCells.shiftCollection("right",e,t)}function a(e,t){this.mergeCells&&this.mergeCells.shiftCollection("left",e,t)}function l(e,t){this.mergeCells&&this.mergeCells.shiftCollection("down",e,t)}function u(e,t){this.mergeCells&&this.mergeCells.shiftCollection("up",e,t)}Object.defineProperties(n,{MergeCells:{get:function(){return r}},__esModule:{value:!0}});var c,d,h,f,p,g=((c=e("plugins"),c&&c.__esModule&&c||{"default":c}).registerPlugin,(d=e("helpers/dom/event"),d&&d.__esModule&&d||{"default":d}).stopImmediatePropagation),m=(h=e("3rdparty/walkontable/src/cell/coords"),h&&h.__esModule&&h||{"default":h}).WalkontableCellCoords,v=(f=e("3rdparty/walkontable/src/cell/range"),f&&f.__esModule&&f||{"default":f}).WalkontableCellRange,w=(p=e("3rdparty/walkontable/src/table"),p&&p.__esModule&&p||{"default":p}).WalkontableTable;r.prototype.canMergeRange=function(e){return!e.isSingle()},r.prototype.mergeRange=function(e){if(this.canMergeRange(e)){var t=e.getTopLeftCorner(),n=e.getBottomRightCorner(),o={};o.row=t.row,o.col=t.col,o.rowspan=n.row-t.row+1,o.colspan=n.col-t.col+1,this.mergedCellInfoCollection.setInfo(o)}},r.prototype.mergeOrUnmergeSelection=function(e){var t=this.mergedCellInfoCollection.getInfo(e.from.row,e.from.col);t?this.unmergeSelection(e.from):this.mergeSelection(e)},r.prototype.mergeSelection=function(e){this.mergeRange(e)},r.prototype.unmergeSelection=function(e){var t=this.mergedCellInfoCollection.getInfo(e.row,e.col);this.mergedCellInfoCollection.removeInfo(t.row,t.col)},r.prototype.applySpanProperties=function(e,t,n){var o=this.mergedCellInfoCollection.getInfo(t,n);o?o.row===t&&o.col===n?(e.setAttribute("rowspan",o.rowspan),e.setAttribute("colspan",o.colspan)):(e.removeAttribute("rowspan"),e.removeAttribute("colspan"),e.style.display="none"):(e.removeAttribute("rowspan"),e.removeAttribute("colspan"))},r.prototype.modifyTransform=function(e,t,n){var o=function(e,t){return t.row>=e.row&&t.row<=e.row+e.rowspan-1?!0:!1},r=function(e,t){return t.col>=e.col&&t.col<=e.col+e.colspan-1?!0:!1},i=function(e){return new m(t.to.row+e.row,t.to.col+e.col)},s={row:n.row,col:n.col};if("modifyTransformStart"==e){this.lastDesiredCoords||(this.lastDesiredCoords=new m(null,null));for(var a,l=new m(t.highlight.row,t.highlight.col),u=this.mergedCellInfoCollection.getInfo(l.row,l.col),c=0,d=this.mergedCellInfoCollection.length;d>c;c++){var h=this.mergedCellInfoCollection[c];if(h=new m(h.row+h.rowspan-1,h.col+h.colspan-1),t.includes(h)){a=!0;break}}if(u){var f=new m(u.row,u.col),p=new m(u.row+u.rowspan-1,u.col+u.colspan-1),g=new v(f,f,p);g.includes(this.lastDesiredCoords)||(this.lastDesiredCoords=new m(null,null)),s.row=this.lastDesiredCoords.row?this.lastDesiredCoords.row-l.row:s.row,s.col=this.lastDesiredCoords.col?this.lastDesiredCoords.col-l.col:s.col,n.row>0?s.row=u.row+u.rowspan-1-l.row+n.row:n.row<0&&(s.row=l.row-u.row+n.row),n.col>0?s.col=u.col+u.colspan-1-l.col+n.col:n.col<0&&(s.col=l.col-u.col+n.col)}var w=new m(t.highlight.row+s.row,t.highlight.col+s.col),y=this.mergedCellInfoCollection.getInfo(w.row,w.col);y&&(this.lastDesiredCoords=w,s={row:y.row-l.row,col:y.col-l.col})}else if("modifyTransformEnd"==e)for(var c=0,d=this.mergedCellInfoCollection.length;d>c;c++){var b=this.mergedCellInfoCollection[c],f=new m(b.row,b.col),p=new m(b.row+b.rowspan-1,b.col+b.colspan-1),C=new v(f,f,p),R=t.getBordersSharedWith(C);if(C.isEqual(t))t.setDirection("NW-SE");else if(R.length>0){var _=t.highlight.isEqual(C.from);R.indexOf("top")>-1?t.to.isSouthEastOf(C.from)&&_?t.setDirection("NW-SE"):t.to.isSouthWestOf(C.from)&&_&&t.setDirection("NE-SW"):R.indexOf("bottom")>-1&&(t.to.isNorthEastOf(C.from)&&_?t.setDirection("SW-NE"):t.to.isNorthWestOf(C.from)&&_&&t.setDirection("SE-NW"))}var w=i(s),S=o(b,w),E=r(b,w);t.includesRange(C)&&(C.includes(w)||S||E)&&(S&&(s.row<0?s.row-=b.rowspan-1:s.row>0&&(s.row+=b.rowspan-1)), +E&&(s.col<0?s.col-=b.colspan-1:s.col>0&&(s.col+=b.colspan-1)))}0!==s.row&&(n.row=s.row),0!==s.col&&(n.col=s.col)},r.prototype.shiftCollection=function(e,t,n){var o=[0,0];switch(e){case"right":o[0]+=1;break;case"left":o[0]-=1;break;case"down":o[1]+=1;break;case"up":o[1]-=1}for(var r=0;rn;n++)e.mergeCells.mergedCellInfoCollection.setInfo(t[n])}else e.mergeCells=new r(t);else e.mergeCells&&(e.mergeCells.mergedCellInfoCollection=new o)},R=function(e){if(this.mergeCells){var t=(e.ctrlKey||e.metaKey)&&!e.altKey;t&&77===e.keyCode&&(this.mergeCells.mergeOrUnmergeSelection(this.getSelectedRange()),this.render(),g(e))}},_=function(e){this.getSettings().mergeCells&&(e.items.push(Handsontable.plugins.ContextMenu.SEPARATOR),e.items.push({key:"mergeCells",name:function(){var e=this.getSelected(),t=this.mergeCells.mergedCellInfoCollection.getInfo(e[0],e[1]);return t?"Unmerge cells":"Merge cells"},callback:function(){this.mergeCells.mergeOrUnmergeSelection(this.getSelectedRange()),this.render()},disabled:function(){return!1}}))},S=function(e,t,n,o,r,i){this.mergeCells&&this.mergeCells.applySpanProperties(e,t,n)},E=function(e){return function(t){var n=this.getSettings().mergeCells;if(n){var o=this.getSelectedRange();if(this.mergeCells.modifyTransform(e,o,t),"modifyTransformEnd"===e){var r=this.countRows(),i=this.countCols();o.from.row<0?o.from.row=0:o.from.row>0&&o.from.row>=r&&(o.from.row=o.from-1),o.from.col<0?o.from.col=0:o.from.col>0&&o.from.col>=i&&(o.from.col=i-1)}}}},T=function(e){this.lastDesiredCoords=null;var t=this.getSettings().mergeCells;if(t){var n=this.getSelectedRange();n.highlight=new m(n.highlight.row,n.highlight.col),n.to=e;var o=!1;do{o=!1;for(var r=0,i=this.mergeCells.mergedCellInfoCollection.length;i>r;r++){var s=this.mergeCells.mergedCellInfoCollection[r],a=new m(s.row,s.col),l=new m(s.row+s.rowspan-1,s.col+s.colspan-1),u=new v(a,a,l);n.expandByRange(u)&&(e.row=n.to.row,e.col=n.to.col,o=!0)}}while(o)}},O=function(e,t){if(t&&"area"==t){var n=this.getSettings().mergeCells;if(n)for(var o=this.getSelectedRange(),r=new v(o.from,o.from,o.from),i=new v(o.to,o.to,o.to),s=0,a=this.mergeCells.mergedCellInfoCollection.length;a>s;s++){var l=this.mergeCells.mergedCellInfoCollection[s],u=new m(l.row,l.col),c=new m(l.row+l.rowspan-1,l.col+l.colspan-1),d=new v(u,u,c);r.expandByRange(d)&&(e[0]=r.from.row,e[1]=r.from.col),i.expandByRange(d)&&(e[2]=i.from.row,e[3]=i.from.col)}}},M=function(e,t,n){var o=this.getSettings().mergeCells;if(o){var r=this.mergeCells.mergedCellInfoCollection.getInfo(e,t);!r||r.row==e&&r.col==t||(n.copyable=!1)}},k=function(e){var t=this.getSettings().mergeCells;if(t)for(var n,o=this.countCols(),r=0;o>r;r++){if(n=this.mergeCells.mergedCellInfoCollection.getInfo(e.startRow,r),n&&n.rowe.endRow)return e.endRow=i,k.call(this,e)}}},H=function(e){var t=this.getSettings().mergeCells;if(t)for(var n,o=this.countRows(),r=0;o>r;r++){if(n=this.mergeCells.mergedCellInfoCollection.getInfo(r,e.startColumn),n&&n.cole.endColumn)return e.endColumn=i,H.call(this,e)}}},D=function(e){if(e&&this.mergeCells){var t=this.mergeCells.mergedCellInfoCollection,n=this.getSelectedRange();for(var o in t)if(n.highlight.row==t[o].row&&n.highlight.col==t[o].col&&n.to.row==t[o].row+t[o].rowspan-1&&n.to.col==t[o].col+t[o].colspan-1)return!1}return e};Handsontable.hooks.add("beforeInit",y),Handsontable.hooks.add("afterInit",b),Handsontable.hooks.add("afterUpdateSettings",C),Handsontable.hooks.add("beforeKeyDown",R),Handsontable.hooks.add("modifyTransformStart",E("modifyTransformStart")),Handsontable.hooks.add("modifyTransformEnd",E("modifyTransformEnd")),Handsontable.hooks.add("beforeSetRangeEnd",T),Handsontable.hooks.add("beforeDrawBorders",O),Handsontable.hooks.add("afterIsMultipleSelection",D),Handsontable.hooks.add("afterRenderer",S),Handsontable.hooks.add("afterContextMenuDefaultOptions",_),Handsontable.hooks.add("afterGetCellMeta",M),Handsontable.hooks.add("afterViewportRowCalculatorOverride",k),Handsontable.hooks.add("afterViewportColumnCalculatorOverride",H),Handsontable.hooks.add("afterAutofillApplyValues",i),Handsontable.hooks.add("afterCreateCol",s),Handsontable.hooks.add("afterRemoveCol",a),Handsontable.hooks.add("afterCreateRow",l),Handsontable.hooks.add("afterRemoveRow",u),Handsontable.MergeCells=r},{"3rdparty/walkontable/src/cell/coords":5,"3rdparty/walkontable/src/cell/range":6,"3rdparty/walkontable/src/table":20,"helpers/dom/event":46,plugins:57}],82:[function(e,t,n){"use strict";Object.defineProperties(n,{MultipleSelectionHandles:{get:function(){return p}},__esModule:{value:!0}});var o,r,i,s,a=(o=e("helpers/dom/element"),o&&o.__esModule&&o||{"default":o}),l=a.getWindowScrollTop,u=a.hasClass,c=a.getWindowScrollLeft,d=(r=e("_base"),r&&r.__esModule&&r||{"default":r})["default"],h=(i=e("eventManager"),i&&i.__esModule&&i||{"default":i}).EventManager,f=(s=e("plugins"),s&&s.__esModule&&s||{"default":s}).registerPlugin,p=function(e){$traceurRuntime.superConstructor(g).call(this,e),this.dragged=[],this.eventManager=null,this.lastSetCell=null},g=p;$traceurRuntime.createClass(p,{isEnabled:function(){return Handsontable.mobileBrowser},enablePlugin:function(){this.enabled||(this.eventManager||(this.eventManager=new h(this)),this.registerListeners(),$traceurRuntime.superGet(this,g.prototype,"enablePlugin").call(this))},registerListeners:function(){function e(e){if(1===t.dragged.length)return t.dragged.splice(0,t.dragged.length),!0;var n=t.dragged.indexOf(e);return-1==n?!1:void(0===n?t.dragged=t.dragged.slice(0,1):1==n&&(t.dragged=t.dragged.slice(-1)))}var t=this;this.eventManager.addEventListener(this.hot.rootElement,"touchstart",function(e){var n;return u(e.target,"topLeftSelectionHandle-HitArea")?(n=t.hot.getSelectedRange(),t.dragged.push("topLeft"),t.touchStartRange={width:n.getWidth(),height:n.getHeight(),direction:n.getDirection()},e.preventDefault(),!1):u(e.target,"bottomRightSelectionHandle-HitArea")?(n=t.hot.getSelectedRange(),t.dragged.push("bottomRight"),t.touchStartRange={width:n.getWidth(),height:n.getHeight(),direction:n.getDirection()},e.preventDefault(),!1):void 0}),this.eventManager.addEventListener(this.hot.rootElement,"touchend",function(n){return u(n.target,"topLeftSelectionHandle-HitArea")?(e.call(t,"topLeft"),t.touchStartRange=void 0,n.preventDefault(),!1):u(n.target,"bottomRightSelectionHandle-HitArea")?(e.call(t,"bottomRight"),t.touchStartRange=void 0,n.preventDefault(),!1):void 0}),this.eventManager.addEventListener(this.hot.rootElement,"touchmove",function(e){var n,o,r,i,s,a,u,d=l(),h=c();0!==t.dragged.length&&(n=document.elementFromPoint(e.touches[0].screenX-h,e.touches[0].screenY-d),n&&n!==t.lastSetCell&&(("TD"==n.nodeName||"TH"==n.nodeName)&&(o=t.hot.getCoords(n),-1==o.col&&(o.col=0),r=t.hot.getSelectedRange(),i=r.getWidth(),s=r.getHeight(),a=r.getDirection(),1==i&&1==s&&t.hot.selection.setRangeEnd(o),u=t.getCurrentRangeCoords(r,o,t.touchStartRange.direction,a,t.dragged[0]),null!==u.start&&t.hot.selection.setRangeStart(u.start),t.hot.selection.setRangeEnd(u.end),t.lastSetCell=n),e.preventDefault()))})},getCurrentRangeCoords:function(e,t,n,o,r){var i=e.getTopLeftCorner(),s=e.getBottomRightCorner(),a=e.getBottomLeftCorner(),l=e.getTopRightCorner(),u={start:null,end:null};switch(n){case"NE-SW":switch(o){case"NE-SW":case"NW-SE":u="topLeft"==r?{start:new WalkontableCellCoords(t.row,e.highlight.col),end:new WalkontableCellCoords(a.row,t.col)}:{start:new WalkontableCellCoords(e.highlight.row,t.col),end:new WalkontableCellCoords(t.row,i.col)};break;case"SE-NW":"bottomRight"==r&&(u={start:new WalkontableCellCoords(s.row,t.col),end:new WalkontableCellCoords(t.row,i.col)})}break;case"NW-SE":switch(o){case"NE-SW":"topLeft"==r?u={start:t,end:a}:u.end=t;break;case"NW-SE":"topLeft"==r?u={start:t,end:s}:u.end=t;break;case"SE-NW":"topLeft"==r?u={start:t,end:i}:u.end=t;break;case"SW-NE":"topLeft"==r?u={start:t,end:l}:u.end=t}break;case"SW-NE":switch(o){case"NW-SE":u="bottomRight"==r?{start:new WalkontableCellCoords(t.row,i.col),end:new WalkontableCellCoords(a.row,t.col)}:{start:new WalkontableCellCoords(i.row,t.col),end:new WalkontableCellCoords(t.row,s.col)};break;case"SW-NE":u="topLeft"==r?{start:new WalkontableCellCoords(e.highlight.row,t.col),end:new WalkontableCellCoords(t.row,s.col)}:{start:new WalkontableCellCoords(t.row,i.col),end:new WalkontableCellCoords(i.row,t.col)};break;case"SE-NW":"bottomRight"==r?u={start:new WalkontableCellCoords(t.row,l.col),end:new WalkontableCellCoords(i.row,t.col)}:"topLeft"==r&&(u={start:a,end:t})}break;case"SE-NW":switch(o){case"NW-SE":case"NE-SW":case"SW-NE":"topLeft"==r&&(u.end=t);break;case"SE-NW":"topLeft"==r?u.end=t:u={start:t,end:i}}}return u},isDragged:function(){return this.dragged.length>0}},{},d),f("multipleSelectionHandles",p)},{_base:58,eventManager:41,"helpers/dom/element":45,plugins:57}],83:[function(e,t,n){"use strict";function o(){}function r(){var e=this,t=e.getSettings().observeChanges;t?(e.observer&&a.call(e),i.call(e),u.call(e)):t||a.call(e)}function i(){var e=this;e.observeChangesActive=!0,e.pauseObservingChanges=function(){e.observeChangesActive=!1},e.resumeObservingChanges=function(){e.observeChangesActive=!0},e.observedData=e.getSourceData(),e.observer=p.observe(e.observedData,function(t){e.observeChangesActive&&(s.call(e,t),e.render()),e.runHooks("afterChangesObserved")})}function s(e){function t(e){var t;return t=o(e),t=n(t)}function n(e){var t=[];return e.filter(function(e){var n=r(e.path);if(-1!=["add","remove"].indexOf(e.op)&&!isNaN(n.col)){if(-1!=t.indexOf(n.col))return!1;t.push(n.col)}return!0})}function o(e){return e.filter(function(e){return!/[\/]length/gi.test(e.path)})}function r(e){var t=e.match(/^\/(\d+)\/?(.*)?$/);return{row:parseInt(t[1],10),col:/^\d*$/.test(t[2])?parseInt(t[2],10):t[2]}}for(var i=this,s=t(e),a=0,l=s.length;l>a;a++){var u=s[a],c=r(u.path);switch(u.op){case"add":isNaN(c.col)?i.runHooks("afterCreateRow",c.row):i.runHooks("afterCreateCol",c.col);break;case"remove":isNaN(c.col)?i.runHooks("afterRemoveRow",c.row,1):i.runHooks("afterRemoveCol",c.col,1);break;case"replace":i.runHooks("afterChange",[c.row,c.col,null,u.value],"external")}}}function a(){var e=this;e.observer&&(l.call(e),c.call(e))}function l(){var e=this;p.unobserve(e.observedData,e.observer),delete e.observedData,delete e.observeChangesActive,delete e.pauseObservingChanges,delete e.resumeObservingChanges}function u(){var e=this;e.addHook("afterDestroy",a),e.addHook("afterCreateRow",d),e.addHook("afterRemoveRow",d),e.addHook("afterCreateCol",d),e.addHook("afterRemoveCol",d),e.addHook("afterChange",function(e,t){"loadData"!=t&&d.call(this)})}function c(){var e=this;e.removeHook("afterDestroy",a),e.removeHook("afterCreateRow",d),e.removeHook("afterRemoveRow",d),e.removeHook("afterCreateCol",d),e.removeHook("afterRemoveCol",d),e.removeHook("afterChange",d)}function d(){var e=this;e.pauseObservingChanges(),e.addHookOnce("afterChangesObserved",function(){e.resumeObservingChanges()})}Object.defineProperties(n,{ObserveChanges:{get:function(){return o}},__esModule:{value:!0}});var h,f,p=((h=e("plugins"),h&&h.__esModule&&h||{"default":h}).registerPlugin,(f=e("jsonpatch"),f&&f.__esModule&&f||{"default":f})["default"]);Handsontable.hooks.add("afterLoadData",r),Handsontable.hooks.add("afterUpdateSettings",r),Handsontable.hooks.register("afterChangesObserved")},{jsonpatch:"jsonpatch",plugins:57}],84:[function(e,t,n){"use strict";function o(e){var t,n=function(){window.localStorage[e+"__persistentStateKeys"]=JSON.stringify(t)},o=function(){var n=window.localStorage[e+"__persistentStateKeys"],o="string"==typeof n?JSON.parse(n):void 0;t=o?o:[]},r=function(){t=[],n()};o(),this.saveValue=function(o,r){window.localStorage[e+"_"+o]=JSON.stringify(r),-1==t.indexOf(o)&&(t.push(o),n())},this.loadValue=function(t,n){t="undefined"==typeof t?n:t;var o=window.localStorage[e+"_"+t];return"undefined"==typeof o?void 0:JSON.parse(o)},this.reset=function(t){window.localStorage.removeItem(e+"_"+t)},this.resetAll=function(){for(var n=0;na;a++)for(var l=0;i>l;l++){var u=e.getDataAtCell(a,l),c=e.getCellMeta(a,l),d=c.search.callback||n,h=c.search.queryMethod||o,f=h(t,u);if(f){var p={row:a,col:l,data:u};s.push(p)}d&&d(e,a,l,u,f)}return s}},Handsontable.Search.DEFAULT_CALLBACK=function(e,t,n,o,r){e.getCellMeta(t,n).isSearchResult=r},Handsontable.Search.DEFAULT_QUERY_METHOD=function(e,t){return"undefined"!=typeof e&&null!=e&&e.toLowerCase&&0!==e.length?"undefined"==typeof t||null==t?!1:-1!=t.toString().toLowerCase().indexOf(e.toLowerCase()):!1},Handsontable.Search.DEFAULT_SEARCH_RESULT_CLASS="htSearchResult",Handsontable.Search.global=function(){var e=Handsontable.Search.DEFAULT_CALLBACK,t=Handsontable.Search.DEFAULT_QUERY_METHOD,n=Handsontable.Search.DEFAULT_SEARCH_RESULT_CLASS;return{getDefaultCallback:function(){return e},setDefaultCallback:function(t){e=t},getDefaultQueryMethod:function(){return t},setDefaultQueryMethod:function(e){t=e},getDefaultSearchResultClass:function(){return n},setDefaultSearchResultClass:function(e){n=e}}}(),Handsontable.SearchCellDecorator=function(e,t,n,o,r,i,s){var u=null!==s.search&&"object"==typeof s.search&&s.search.searchResultClass||Handsontable.Search.global.getDefaultSearchResultClass();s.isSearchResult?a(t,u):l(t,u)};var h=d("base");c("base",function(e,t,n,o,r,i,s){h.apply(this,arguments),Handsontable.SearchCellDecorator.apply(this,arguments)}),Handsontable.hooks.add("afterInit",o),Handsontable.hooks.add("afterUpdateSettings",o)},{"helpers/dom/element":45,renderers:88}],86:[function(e,t,n){"use strict";Object.defineProperties(n,{TouchScroll:{get:function(){return d}},__esModule:{value:!0}});var o,r,i,s=(o=e("helpers/dom/element"),o&&o.__esModule&&o||{"default":o}),a=s.addClass,l=s.removeClass,u=(r=e("_base"),r&&r.__esModule&&r||{"default":r})["default"],c=(i=e("plugins"),i&&i.__esModule&&i||{"default":i}).registerPlugin,d=function(e){var t=this;$traceurRuntime.superConstructor(h).call(this,e),this.hot.addHook("afterInit",function(){return t.afterInit()}),this.hot.addHook("afterUpdateSettings",function(){return t.onAfterUpdateSettings()}),this.scrollbars=[],this.clones=[]},h=d;$traceurRuntime.createClass(d,{afterInit:function(){this.registerEvents(),this.onAfterUpdateSettings()},onAfterUpdateSettings:function(){var e=this;this.hot.addHookOnce("afterRender",function(){var t=e.hot.view.wt.wtOverlays;e.scrollbars=[],e.scrollbars.push(t.topOverlay),t.bottomOverlay.clone&&e.scrollbars.push(t.bottomOverlay),e.scrollbars.push(t.leftOverlay),t.topLeftCornerOverlay&&e.scrollbars.push(t.topLeftCornerOverlay),t.bottomLeftCornerOverlay&&t.bottomLeftCornerOverlay.clone&&e.scrollbars.push(t.bottomLeftCornerOverlay),e.clones=[],t.topOverlay.needFullRender&&e.clones.push(t.topOverlay.clone.wtTable.holder.parentNode),t.bottomOverlay.needFullRender&&e.clones.push(t.bottomOverlay.clone.wtTable.holder.parentNode),t.leftOverlay.needFullRender&&e.clones.push(t.leftOverlay.clone.wtTable.holder.parentNode),t.topLeftCornerOverlay&&e.clones.push(t.topLeftCornerOverlay.clone.wtTable.holder.parentNode),t.bottomLeftCornerOverlay&&t.bottomLeftCornerOverlay.clone&&e.clones.push(t.bottomLeftCornerOverlay.clone.wtTable.holder.parentNode)})},registerEvents:function(){var e=this;this.hot.addHook("beforeTouchScroll",function(){return e.onBeforeTouchScroll()}),this.hot.addHook("afterMomentumScroll",function(){return e.onAfterMomentumScroll()})},onBeforeTouchScroll:function(){Handsontable.freezeOverlays=!0;for(var e=0,t=this.clones.length;t>e;e++)a(this.clones[e],"hide-tween")},onAfterMomentumScroll:function(){Handsontable.freezeOverlays=!1;for(var e=this,t=0,n=this.clones.length;n>t;t++)l(this.clones[t],"hide-tween");for(var o=0,r=this.clones.length;r>o;o++)a(this.clones[o],"show-tween");setTimeout(function(){for(var t=0,n=e.clones.length;n>t;t++)l(e.clones[t],"show-tween")},400);for(var i=0,s=this.scrollbars.length;s>i;i++)this.scrollbars[i].refresh(),this.scrollbars[i].resetFixedPosition();this.hot.view.wt.wtOverlays.syncScrollWithMaster()}},{},u),c("touchScroll",d)},{_base:58,"helpers/dom/element":45,plugins:57}],87:[function(e,t,n){"use strict";function o(){var e=this,t="undefined"==typeof e.getSettings().undo||e.getSettings().undo;t?e.undoRedo||(e.undoRedo=new Handsontable.UndoRedo(e),s(e),e.addHook("beforeKeyDown",r),e.addHook("afterChange",i)):e.undoRedo&&(delete e.undoRedo,a(e),e.removeHook("beforeKeyDown",r),e.removeHook("afterChange",i))}function r(e){var t=this,n=(e.ctrlKey||e.metaKey)&&!e.altKey;n&&(89===e.keyCode||e.shiftKey&&90===e.keyCode?(t.undoRedo.redo(),f(e)):90===e.keyCode&&(t.undoRedo.undo(),f(e)))}function i(e,t){var n=this;return"loadData"==t?n.undoRedo.clear():void 0}function s(e){e.undo=function(){return e.undoRedo.undo()},e.redo=function(){return e.undoRedo.redo()},e.isUndoAvailable=function(){return e.undoRedo.isUndoAvailable()},e.isRedoAvailable=function(){return e.undoRedo.isRedoAvailable()},e.clearUndo=function(){return e.undoRedo.clear()}}function a(e){delete e.undo,delete e.redo,delete e.isUndoAvailable,delete e.isRedoAvailable,delete e.clearUndo}var l,u,c=(l=e("helpers/object"),l&&l.__esModule&&l||{"default":l}),d=c.inherit,h=c.deepClone,f=(u=e("helpers/dom/event"),u&&u.__esModule&&u||{"default":u}).stopImmediatePropagation;Handsontable.UndoRedo=function(e){var t=this;this.instance=e,this.doneActions=[],this.undoneActions=[],this.ignoreNewActions=!1,e.addHook("afterChange",function(e,n){if(e){var o=new Handsontable.UndoRedo.ChangeAction(e);t.done(o)}}),e.addHook("afterCreateRow",function(e,n,o){if(!o){var r=new Handsontable.UndoRedo.CreateRowAction(e,n);t.done(r)}}),e.addHook("beforeRemoveRow",function(e,n){var o=t.instance.getSourceData();e=(o.length+e)%o.length;var r=o.slice(e,e+n),i=new Handsontable.UndoRedo.RemoveRowAction(e,r);t.done(i)}),e.addHook("afterCreateCol",function(e,n,o){if(!o){var r=new Handsontable.UndoRedo.CreateColumnAction(e,n);t.done(r)}}),e.addHook("beforeRemoveCol",function(n,o){var r=t.instance.getSourceData();n=(t.instance.countCols()+n)%t.instance.countCols();for(var i=[],s=0,a=r.length;a>s;s++)i[s]=r[s].slice(n,n+o);var l;Array.isArray(e.getSettings().colHeaders)&&(l=e.getSettings().colHeaders.slice(n,n+i.length));var u=new Handsontable.UndoRedo.RemoveColumnAction(n,i,l);t.done(u)}),e.addHook("beforeCellAlignment",function(e,n,o,r){var i=new Handsontable.UndoRedo.CellAlignmentAction(e,n,o,r);t.done(i)})},Handsontable.UndoRedo.prototype.done=function(e){this.ignoreNewActions||(this.doneActions.push(e),this.undoneActions.length=0)},Handsontable.UndoRedo.prototype.undo=function(){if(this.isUndoAvailable()){var e=this.doneActions.pop();this.ignoreNewActions=!0;var t=this;e.undo(this.instance,function(){t.ignoreNewActions=!1,t.undoneActions.push(e)})}},Handsontable.UndoRedo.prototype.redo=function(){if(this.isRedoAvailable()){var e=this.undoneActions.pop();this.ignoreNewActions=!0;var t=this;e.redo(this.instance,function(){t.ignoreNewActions=!1,t.doneActions.push(e)})}},Handsontable.UndoRedo.prototype.isUndoAvailable=function(){return this.doneActions.length>0},Handsontable.UndoRedo.prototype.isRedoAvailable=function(){return this.undoneActions.length>0},Handsontable.UndoRedo.prototype.clear=function(){this.doneActions.length=0,this.undoneActions.length=0},Handsontable.UndoRedo.Action=function(){},Handsontable.UndoRedo.Action.prototype.undo=function(){},Handsontable.UndoRedo.Action.prototype.redo=function(){},Handsontable.UndoRedo.ChangeAction=function(e){this.changes=e},d(Handsontable.UndoRedo.ChangeAction,Handsontable.UndoRedo.Action),Handsontable.UndoRedo.ChangeAction.prototype.undo=function(e,t){for(var n=h(this.changes),o=e.countEmptyRows(!0),r=e.countEmptyCols(!0),i=0,s=n.length;s>i;i++)n[i].splice(3,1);e.addHookOnce("afterChange",t),e.setDataAtRowProp(n,null,null,"undo");for(var i=0,s=n.length;s>i;i++)e.getSettings().minSpareRows&&n[i][0]+1+e.getSettings().minSpareRows===e.countRows()&&o==e.getSettings().minSpareRows&&(e.alter("remove_row",parseInt(n[i][0]+1,10),e.getSettings().minSpareRows),e.undoRedo.doneActions.pop()),e.getSettings().minSpareCols&&n[i][1]+1+e.getSettings().minSpareCols===e.countCols()&&r==e.getSettings().minSpareCols&&(e.alter("remove_col",parseInt(n[i][1]+1,10),e.getSettings().minSpareCols),e.undoRedo.doneActions.pop())},Handsontable.UndoRedo.ChangeAction.prototype.redo=function(e,t){for(var n=h(this.changes),o=0,r=n.length;r>o;o++)n[o].splice(2,1);e.addHookOnce("afterChange",t),e.setDataAtRowProp(n,null,null,"redo")},Handsontable.UndoRedo.CreateRowAction=function(e,t){this.index=e,this.amount=t},d(Handsontable.UndoRedo.CreateRowAction,Handsontable.UndoRedo.Action),Handsontable.UndoRedo.CreateRowAction.prototype.undo=function(e,t){var n=e.countRows(),o=e.getSettings().minSpareRows;this.index>=n&&this.index-or;r++)n=e.getSourceDataAtRow(r),o=[this.index,0],Array.prototype.push.apply(o,this.data[r]),Array.prototype.splice.apply(n,o);"undefined"!=typeof this.headers&&(o=[this.index,0],Array.prototype.push.apply(o,this.headers),Array.prototype.splice.apply(e.getSettings().colHeaders,o)),e.addHookOnce("afterRender",t),e.render()},Handsontable.UndoRedo.RemoveColumnAction.prototype.redo=function(e,t){e.addHookOnce("afterRemoveCol",t),e.alter("remove_col",this.index,this.amount)},Handsontable.hooks.add("afterInit",o),Handsontable.hooks.add("afterUpdateSettings",o)},{"helpers/dom/event":46,"helpers/object":50}],88:[function(e,t,n){"use strict";function o(e,t){var n;l[e]=t,n=a(e)+"Renderer",Handsontable.renderers[n]=t,Handsontable[n]=t}function r(e){if("function"==typeof e)return e;if("string"!=typeof e)throw Error('Only strings and functions can be passed as "renderer" parameter');if(!(e in l))throw Error('No editor registered under name "'+e+'"');return l[e]}function i(e){return e in l}Object.defineProperties(n,{registerRenderer:{get:function(){return o}},getRenderer:{get:function(){return r}},hasRenderer:{get:function(){return i}},__esModule:{value:!0}});var s,a=(s=e("helpers/string"),s&&s.__esModule&&s||{"default":s}).toUpperCaseFirst,l={};Handsontable.renderers=Handsontable.renderers||{},Handsontable.renderers.registerRenderer=o,Handsontable.renderers.getRenderer=r},{"helpers/string":52}],89:[function(e,t,n){"use strict";function o(e,t,n,o,r,i,s){s.className&&(t.className?t.className=t.className+" "+s.className:t.className=s.className),s.readOnly&&a(t,s.readOnlyCellClassName),s.valid===!1&&s.invalidCellClassName?a(t,s.invalidCellClassName):l(t,s.invalidCellClassName),s.wordWrap===!1&&s.noWordWrapClassName&&a(t,s.noWordWrapClassName),!i&&s.placeholder&&a(t,s.placeholderCellClassName)}Object.defineProperties(n,{cellDecorator:{get:function(){return o}},__esModule:{value:!0}});var r,i,s=(r=e("helpers/dom/element"),r&&r.__esModule&&r||{"default":r}),a=s.addClass,l=s.removeClass,u=(i=e("renderers"),i&&i.__esModule&&i||{"default":i}).registerRenderer;u("base",o),Handsontable.renderers.cellDecorator=o},{"helpers/dom/element":45,renderers:88}],90:[function(e,t,n){"use strict";function o(e,t,n,o,r,i,s){var a=(m.cloneNode(!0),v.cloneNode(!0));if(f("text")(e,t,n,o,r,i,s),t.appendChild(a),u(t,"htAutocomplete"),t.firstChild||t.appendChild(document.createTextNode(String.fromCharCode(160))),!e.acArrowListener){var l=d(e);e.acArrowListener=function(r){c(r.target,"htAutocompleteArrow")&&e.view.wt.getSetting("onCellDblClick",null,new g(n,o),t)},l.addEventListener(e.rootElement,"mousedown",e.acArrowListener),e.addHookOnce("afterDestroy",function(){l.destroy()})}}Object.defineProperties(n,{autocompleteRenderer:{get:function(){return o}},__esModule:{value:!0}});var r,i,s,a,l=(r=e("helpers/dom/element"),r&&r.__esModule&&r||{"default":r}),u=l.addClass,c=l.hasClass,d=(l.empty,(i=e("eventManager"),i&&i.__esModule&&i||{"default":i}).eventManager),h=(s=e("renderers"),s&&s.__esModule&&s||{"default":s}),f=h.getRenderer,p=h.registerRenderer,g=(a=e("3rdparty/walkontable/src/cell/coords"),a&&a.__esModule&&a||{"default":a}).WalkontableCellCoords,m=document.createElement("DIV");m.className="htAutocompleteWrapper";var v=document.createElement("DIV");v.className="htAutocompleteArrow",v.appendChild(document.createTextNode(String.fromCharCode(9660)));p("autocomplete",o)},{"3rdparty/walkontable/src/cell/coords":5,eventManager:41,"helpers/dom/element":45,renderers:88}],91:[function(e,t,n){"use strict";function o(e,t,n,o,a,l,u){function c(e){var t=[C.SPACE,C.ENTER,C.DELETE,C.BACKSPACE];-1===t.indexOf(e.keyCode)||E(e)||f(function(){S(e),e.preventDefault()}),(e.keyCode==C.SPACE||e.keyCode==C.ENTER)&&d(),(e.keyCode==C.DELETE||e.keyCode==C.BACKSPACE)&&d(!1)}function d(){var e=void 0!==arguments[0]?arguments[0]:null;f(function(t){for(var n=0,o=t.length;o>n;n++){if(m(t[n],O)&&null===e)return;h(t[n],e)}})}function h(e){var t=void 0!==arguments[1]?arguments[1]:null;null===t?e.checked=!e.checked:e.checked=t,y.fireEvent(e,"change")}function f(t){for(var n=e.getSelectedRange(),o=n.getTopLeftCorner(),r=n.getBottomRightCorner(),i=o.row;i<=r.row;i++)for(var s=o.col;s<=r.col;s++){var a=e.getCell(i,s),l=e.getCellMeta(i,s),u=a.querySelectorAll("input[type=checkbox]");u.length>0&&!l.readOnly&&t(u)}}var y=new w(e),b=r(),R=u.label,M=!1;if("undefined"==typeof u.checkedTemplate&&(u.checkedTemplate=!0),"undefined"==typeof u.uncheckedTemplate&&(u.uncheckedTemplate=!1),p(t),l===u.checkedTemplate||v(l,u.checkedTemplate)?b.checked=!0:l===u.uncheckedTemplate||v(l,u.uncheckedTemplate)?b.checked=!1:null===l?g(b,"noValue"):(b.style.display="none",g(b,O),M=!0),!M&&R){var k="";R.value?k="function"==typeof R.value?R.value.call(this,n,o,a,l):R.value:R.property&&(k=e.getDataAtRowProp(n,R.property));var H=i(k);"before"===R.position?H.appendChild(b):H.insertBefore(b,H.firstChild),b=H}t.appendChild(b),M&&t.appendChild(document.createTextNode("#bad-value#")),u.readOnly?y.addEventListener(b,"click",s):(y.addEventListener(b,"mousedown",_),y.addEventListener(b,"mouseup",_),y.addEventListener(b,"change",function(t){e.setDataAtRowProp(n,a,t.target.checked?u.checkedTemplate:u.uncheckedTemplate)})),T.has(e)||(T.set(e,!0),e.addHook("beforeKeyDown",c))}function r(){var e=document.createElement("input");return e.className="htCheckboxRendererInput",e.type="checkbox",e.setAttribute("autocomplete","off"),e.cloneNode(!1)}function i(e){var t=document.createElement("label");return t.className="htCheckboxRendererLabel",t.appendChild(document.createTextNode(e)),t.cloneNode(!0)}function s(e){e.preventDefault()}Object.defineProperties(n,{checkboxRenderer:{get:function(){return o}},__esModule:{value:!0}});var a,l,u,c,d,h,f=(a=e("helpers/dom/element"),a&&a.__esModule&&a||{"default":a}),p=f.empty,g=f.addClass,m=f.hasClass,v=(l=e("helpers/string"),l&&l.__esModule&&l||{"default":l}).equalsIgnoreCase,w=(u=e("eventManager"),u&&u.__esModule&&u||{"default":u}).EventManager,y=(c=e("renderers"),c&&c.__esModule&&c||{"default":c}),b=(y.getRenderer,y.registerRenderer),C=(d=e("helpers/unicode"),d&&d.__esModule&&d||{"default":d}).KEY_CODES,R=(h=e("helpers/dom/event"),h&&h.__esModule&&h||{"default":h}),_=R.stopPropagation,S=R.stopImmediatePropagation,E=R.isImmediatePropagationStopped,T=new WeakMap,O="htBadValue"; +b("checkbox",o)},{eventManager:41,"helpers/dom/element":45,"helpers/dom/event":46,"helpers/string":52,"helpers/unicode":53,renderers:88}],92:[function(e,t,n){"use strict";function o(e,t,n,o,r,i,a){l("base").apply(this,arguments),s(t,i)}Object.defineProperties(n,{htmlRenderer:{get:function(){return o}},__esModule:{value:!0}});var r,i,s=(r=e("helpers/dom/element"),r&&r.__esModule&&r||{"default":r}).fastInnerHTML,a=(i=e("renderers"),i&&i.__esModule&&i||{"default":i}),l=a.getRenderer,u=a.registerRenderer;u("html",o)},{"helpers/dom/element":45,renderers:88}],93:[function(e,t,n){"use strict";function o(e,t,n,o,r,i,s){f(i)&&("undefined"!=typeof s.language&&l.language(s.language),i=l(i).format(s.format||"0"),u(t,"htNumeric")),d("text")(e,t,n,o,r,i,s)}Object.defineProperties(n,{numericRenderer:{get:function(){return o}},__esModule:{value:!0}});var r,i,s,a,l=(r=e("numeral"),r&&r.__esModule&&r||{"default":r})["default"],u=(i=e("helpers/dom/element"),i&&i.__esModule&&i||{"default":i}).addClass,c=(s=e("renderers"),s&&s.__esModule&&s||{"default":s}),d=c.getRenderer,h=c.registerRenderer,f=(a=e("helpers/number"),a&&a.__esModule&&a||{"default":a}).isNumeric;h("numeric",o)},{"helpers/dom/element":45,"helpers/number":49,numeral:"numeral",renderers:88}],94:[function(e,t,n){"use strict";function o(e,t,n,o,r,i,a){l("text").apply(this,arguments),i=t.innerHTML;var u,c=a.hashLength||i.length,d=a.hashSymbol||"*";for(u="";u.split(d).length-13?("function"==typeof o&&(e.__proto__=o),e.prototype=d(a(o),i(t))):e.prototype=t,f(e,"prototype",{configurable:!1,writable:!1}),h(e,i(n))}function a(e){if("function"==typeof e){var t=e.prototype;if(u(t)===t||null===t)return e.prototype;throw new c("super prototype must be an Object or null")}if(null===e)return null;throw new c("Super expression must either be null or a function, not "+typeof e+".")}function l(e,t,o){null!==g(t)&&n(e,t,"constructor",o)}var u=Object,c=TypeError,d=u.create,h=$traceurRuntime.defineProperties,f=$traceurRuntime.defineProperty,p=$traceurRuntime.getOwnPropertyDescriptor,g=Object.getPrototypeOf,m=$traceurRuntime.toProperty,v=Object,w=v.getOwnPropertyNames,y=v.getOwnPropertySymbols;$traceurRuntime.createClass=s,$traceurRuntime.defaultSuperCall=l,$traceurRuntime.superCall=n,$traceurRuntime.superConstructor=t,$traceurRuntime.superGet=o,$traceurRuntime.superSet=r}()},{}],97:[function(e,t,n){"use strict";function o(e){var t=this;this.eventManager=b(e),this.instance=e,this.settings=e.getSettings(),this.selectionMouseDown=!1;var n=e.rootElement.getAttribute("style");n&&e.rootElement.setAttribute("data-originalstyle",n),d(e.rootElement,"handsontable");var o=document.createElement("TABLE");d(o,"htCore"),e.getSettings().tableClassName&&d(o,e.getSettings().tableClassName),this.THEAD=document.createElement("THEAD"),o.appendChild(this.THEAD),this.TBODY=document.createElement("TBODY"),o.appendChild(this.TBODY),e.table=o,e.container.insertBefore(o,e.container.firstChild),this.eventManager.addEventListener(e.rootElement,"mousedown",function(e){this.selectionMouseDown=!0,t.isTextSelectionAllowed(e.target)||(i(),e.preventDefault(),window.focus())}),this.eventManager.addEventListener(e.rootElement,"mouseup",function(e){this.selectionMouseDown=!1}),this.eventManager.addEventListener(e.rootElement,"mousemove",function(e){this.selectionMouseDown&&!t.isTextSelectionAllowed(e.target)&&(i(),e.preventDefault())}),this.eventManager.addEventListener(document.documentElement,"keyup",function(t){e.selection.isInProgress()&&!t.shiftKey&&e.selection.finish()});var r;this.isMouseDown=function(){return r},this.eventManager.addEventListener(document.documentElement,"mouseup",function(t){e.selection.isInProgress()&&1===t.which&&e.selection.finish(),r=!1,y(document.activeElement)&&e.unlisten()}),this.eventManager.addEventListener(document.documentElement,"mousedown",function(n){var o=n.target,i=n.x||n.clientX,s=n.y||n.clientY;if(!r&&e.rootElement){if(o===e.view.wt.wtTable.holder){var a=g();if(document.elementFromPoint(i+a,s)!==e.view.wt.wtTable.holder||document.elementFromPoint(i,s+a)!==e.view.wt.wtTable.holder)return}else for(;o!==document.documentElement;){if(null===o){if(n.isTargetWebComponent)break;return}if(o===e.rootElement)return;o=o.parentNode}t.settings.outsideClickDeselects?e.deselectCell():e.destroyEditor()}}),this.eventManager.addEventListener(o,"selectstart",function(e){t.settings.fragmentSelection||w(e.target)||e.preventDefault()});var i=function(){window.getSelection?window.getSelection().empty?window.getSelection().empty():window.getSelection().removeAllRanges&&window.getSelection().removeAllRanges():document.selection&&document.selection.empty()},s=[new E({className:"current",border:{width:2,color:"#5292F7",cornerVisible:function(){return t.settings.fillHandle&&!t.isCellEdited()&&!e.selection.isMultiple()},multipleSelectionHandlesVisible:function(){return!t.isCellEdited()&&!e.selection.isMultiple()}}}),new E({className:"area",border:{width:1,color:"#89AFF9",cornerVisible:function(){return t.settings.fillHandle&&!t.isCellEdited()&&e.selection.isMultiple()},multipleSelectionHandlesVisible:function(){return!t.isCellEdited()&&e.selection.isMultiple()}}}),new E({className:"highlight",highlightRowClassName:t.settings.currentRowClassName,highlightColumnClassName:t.settings.currentColClassName}),new E({className:"fill",border:{width:1,color:"red"}})];s.current=s[0],s.area=s[1],s.highlight=s[2],s.fill=s[3];var a={debug:function(){return t.settings.debug},externalRowCalculator:this.instance.getPlugin("autoRowSize")&&this.instance.getPlugin("autoRowSize").isEnabled(),table:o,stretchH:this.settings.stretchH,data:e.getDataAtCell,totalRows:function(){return e.countRows()},totalColumns:function(){return e.countCols()},fixedColumnsLeft:function(){return t.settings.fixedColumnsLeft},fixedRowsTop:function(){return t.settings.fixedRowsTop},fixedRowsBottom:function(){return t.settings.fixedRowsBottom},minSpareRows:function(){return t.settings.minSpareRows},renderAllRows:t.settings.renderAllRows,rowHeaders:function(){var n=[];return e.hasRowHeaders()&&n.push(function(e,n){t.appendRowHeader(e,n)}),Handsontable.hooks.run(e,"afterGetRowHeaderRenderers",n),n},columnHeaders:function(){var n=[];return e.hasColHeaders()&&n.push(function(e,n){t.appendColHeader(e,n)}),Handsontable.hooks.run(e,"afterGetColumnHeaderRenderers",n),n},columnWidth:e.getColWidth,rowHeight:e.getRowHeight,cellRenderer:function(e,n,o){var r=t.instance.colToProp(n),i=t.instance.getCellMeta(e,n),s=t.instance.getCellRenderer(i),a=t.instance.getDataAtRowProp(e,r);s(t.instance,o,e,n,r,a,i),Handsontable.hooks.run(t.instance,"afterRenderer",o,e,n,r,a,i)},selections:s,hideBorderOnMouseDownOver:function(){return t.settings.fragmentSelection},onCellMouseDown:function(n,o,i,s){var a,l,u=i.parentNode,c=u.parentNode;if(e.listen(),t.activeWt=s,r=!0,Handsontable.hooks.run(e,"beforeOnCellMouseDown",n,o,i),e.selection.setSelectedHeaders(!1,!1),!_(n)){if(2===n.button&&e.selection.inInSelection(o));else n.shiftKey?o.row>=0&&o.col>=0&&e.selection.setRangeEnd(o):(o.row<0||o.col<0)&&(o.row>=0||o.col>=0)?(o.row<0&&(a=c.childNodes.length-Array.prototype.indexOf.call(c.childNodes,u)-1,l=e.getHeaderColspan(o.col,a),e.selection.setSelectedHeaders(!1,!0),e.selectCell(0,o.col,e.countRows()-1,o.col+Math.max(0,l-1))),o.col<0&&(e.selection.setSelectedHeaders(!0,!1),e.selectCell(o.row,0,o.row,e.countCols()-1))):(o.row=o.row<0?0:o.row,o.col=o.col<0?0:o.col,e.selection.setRangeStart(o));Handsontable.hooks.run(e,"afterOnCellMouseDown",n,o,i),t.activeWt=t.wt}},onCellMouseOver:function(n,o,i,s){t.activeWt=s,o.row>=0&&o.col>=0?r&&e.selection.setRangeEnd(o):r&&(o.row<0&&(e.selection.selectedHeader.cols?(e.selection.setRangeEnd(new S(e.countRows()-1,o.col)),e.selection.setSelectedHeaders(!1,!0)):e.selection.setRangeEnd(new S(o.row,o.col))),o.col<0&&(e.selection.selectedHeader.rows?(e.selection.setRangeEnd(new S(o.row,e.countCols()-1)),e.selection.setSelectedHeaders(!0,!1)):e.selection.setRangeEnd(new S(o.row,o.col)))),Handsontable.hooks.run(e,"afterOnCellMouseOver",n,o,i),t.activeWt=t.wt},onCellCornerMouseDown:function(t){t.preventDefault(),Handsontable.hooks.run(e,"afterOnCellCornerMouseDown",t)},beforeDraw:function(e){t.beforeRender(e)},onDraw:function(e){t.onDraw(e)},onScrollVertically:function(){e.runHooks("afterScrollVertically")},onScrollHorizontally:function(){e.runHooks("afterScrollHorizontally")},onBeforeDrawBorders:function(t,n){e.runHooks("beforeDrawBorders",t,n)},onBeforeTouchScroll:function(){e.runHooks("beforeTouchScroll")},onAfterMomentumScroll:function(){e.runHooks("afterMomentumScroll")},viewportRowCalculatorOverride:function(n){var o=e.countRows(),r=t.settings.viewportRowRenderingOffset;if("auto"===r&&t.settings.fixedRowsTop&&(r=10),"number"==typeof r&&(n.startRow=Math.max(n.startRow-r,0),n.endRow=Math.min(n.endRow+r,o-1)),"auto"===r){var i=n.startRow+n.endRow-n.startRow,s=Math.ceil(i/o*12);n.startRow=Math.max(n.startRow-s,0),n.endRow=Math.min(n.endRow+s,o-1)}e.runHooks("afterViewportRowCalculatorOverride",n)},viewportColumnCalculatorOverride:function(n){var o=e.countCols(),r=t.settings.viewportColumnRenderingOffset;if("auto"===r&&t.settings.fixedColumnsLeft&&(r=10),"number"==typeof r&&(n.startColumn=Math.max(n.startColumn-r,0),n.endColumn=Math.min(n.endColumn+r,o-1)),"auto"===r){var i=n.startColumn+n.endColumn-n.startColumn,s=Math.ceil(i/o*12);n.startRow=Math.max(n.startColumn-s,0),n.endColumn=Math.min(n.endColumn+s,o-1)}e.runHooks("afterViewportColumnCalculatorOverride",n)}};Handsontable.hooks.run(e,"beforeInitWalkontable",a),this.wt=new T(a),this.activeWt=this.wt,this.eventManager.addEventListener(t.wt.wtTable.spreader,"mousedown",function(e){e.target===t.wt.wtTable.spreader&&3===e.which&&R(e)}),this.eventManager.addEventListener(t.wt.wtTable.spreader,"contextmenu",function(e){e.target===t.wt.wtTable.spreader&&3===e.which&&R(e)}),this.eventManager.addEventListener(document.documentElement,"click",function(){t.settings.observeDOMVisibility&&t.wt.drawInterrupted&&(t.instance.forceFullRender=!0,t.render())})}Object.defineProperties(n,{TableView:{get:function(){return o}},__esModule:{value:!0}});var r,i,s,a,l,u,c=(r=e("helpers/dom/element"),r&&r.__esModule&&r||{"default":r}),d=c.addClass,h=c.empty,f=c.fastInnerHTML,p=c.fastInnerText,g=c.getScrollbarWidth,m=c.hasClass,v=c.isChildOf,w=c.isInput,y=c.isOutsideInput,b=(i=e("eventManager"),i&&i.__esModule&&i||{"default":i}).eventManager,C=(s=e("helpers/dom/event"),s&&s.__esModule&&s||{"default":s}),R=C.stopPropagation,_=C.isImmediatePropagationStopped,S=(a=e("3rdparty/walkontable/src/cell/coords"),a&&a.__esModule&&a||{"default":a}).WalkontableCellCoords,E=(l=e("3rdparty/walkontable/src/selection"),l&&l.__esModule&&l||{"default":l}).WalkontableSelection,T=(u=e("3rdparty/walkontable/src/core"),u&&u.__esModule&&u||{"default":u}).Walkontable;Handsontable.TableView=o,o.prototype.isTextSelectionAllowed=function(e){if(w(e))return!0;var t=v(e,this.instance.view.wt.wtTable.spreader);return this.settings.fragmentSelection===!0&&t?!0:"cell"===this.settings.fragmentSelection&&this.isSelectedOnlyCell()&&t?!0:!1},o.prototype.isSelectedOnlyCell=function(){var e=this.instance.getSelected()||[],t=e[0],n=e[1],o=e[2],r=e[3];return void 0!==t&&t===o&&n===r},o.prototype.isCellEdited=function(){var e=this.instance.getActiveEditor();return e&&e.isOpened()},o.prototype.beforeRender=function(e){e&&Handsontable.hooks.run(this.instance,"beforeRender",this.instance.forceFullRender)},o.prototype.onDraw=function(e){e&&Handsontable.hooks.run(this.instance,"afterRender",this.instance.forceFullRender)},o.prototype.render=function(){this.wt.draw(!this.instance.forceFullRender),this.instance.forceFullRender=!1,this.instance.renderCall=!1},o.prototype.getCellAtCoords=function(e,t){var n=this.wt.getCell(e,t);return 0>n?null:n},o.prototype.scrollViewport=function(e){this.wt.scrollViewport(e)},o.prototype.appendRowHeader=function(e,t){if(t.firstChild){var n=t.firstChild;if(!m(n,"relative"))return h(t),void this.appendRowHeader(e,t);this.updateCellHeader(n.querySelector(".rowHeader"),e,this.instance.getRowHeader)}else{var o=document.createElement("div"),r=document.createElement("span");o.className="relative",r.className="rowHeader",this.updateCellHeader(r,e,this.instance.getRowHeader),o.appendChild(r),t.appendChild(o)}Handsontable.hooks.run(this.instance,"afterGetRowHeader",e,t)},o.prototype.appendColHeader=function(e,t){if(t.firstChild){var n=t.firstChild;m(n,"relative")?this.updateCellHeader(n.querySelector(".colHeader"),e,this.instance.getColHeader):(h(t),this.appendColHeader(e,t))}else{var o=document.createElement("div"),r=document.createElement("span");o.className="relative",r.className="colHeader",this.updateCellHeader(r,e,this.instance.getColHeader),o.appendChild(r),t.appendChild(o)}Handsontable.hooks.run(this.instance,"afterGetColHeader",e,t)},o.prototype.updateCellHeader=function(e,t,n){t>-1?f(e,n(t)):(p(e,String.fromCharCode(160)),d(e,"cornerHeader"))},o.prototype.maximumVisibleElementWidth=function(e){var t=this.wt.wtViewport.getWorkspaceWidth(),n=t-e;return n>0?n:0},o.prototype.maximumVisibleElementHeight=function(e){var t=this.wt.wtViewport.getWorkspaceHeight(),n=t-e;return n>0?n:0},o.prototype.mainViewIsActive=function(){return this.wt===this.activeWt},o.prototype.destroy=function(){this.wt.destroy(),this.eventManager.destroy()}},{"3rdparty/walkontable/src/cell/coords":5,"3rdparty/walkontable/src/core":7,"3rdparty/walkontable/src/selection":18,eventManager:41,"helpers/dom/element":45,"helpers/dom/event":46}],98:[function(e,t,n){"use strict";Object.defineProperties(n,{GhostTable:{get:function(){return f}},__esModule:{value:!0}});var o,r,i,s,a,l=(o=e("helpers/dom/element"),o&&o.__esModule&&o||{"default":o}),u=l.addClass,c=l.outerHeight,d=l.outerWidth,h=(r=e("helpers/array"),r&&r.__esModule&&r||{"default":r}).arrayEach,f=((i=e("helpers/object"),i&&i.__esModule&&i||{"default":i}).objectEach,(s=e("helpers/number"),s&&s.__esModule&&s||{"default":s}).rangeEach,(a=e("helpers/mixed"),a&&a.__esModule&&a||{"default":a}).stringify,function(e){this.hot=e,this.container=null,this.injected=!1,this.rows=[],this.columns=[],this.samples=null});$traceurRuntime.createClass(f,{addRow:function(e,t){if(this.columns.length)throw new Error("Doesn't support multi-dimensional table");this.rows.length||(this.container=this.createContainer(this.hot.rootElement.className));var n={row:e};this.rows.push(n),this.samples=t,this.table=this.createTable(this.hot.table.className),this.table.colGroup.appendChild(this.createColGroupsCol()),this.table.tr.appendChild(this.createRow(e)),this.container.container.appendChild(this.table.fragment),n.table=this.table.table},addColumn:function(e,t){if(this.rows.length)throw new Error("Doesn't support multi-dimensional table");this.columns.length||(this.container=this.createContainer(this.hot.rootElement.className));var n={col:e};this.columns.push(n),this.samples=t,this.table=this.createTable(this.hot.table.className),null!==this.hot.getColHeader(e)&&this.hot.view.appendColHeader(e,this.table.th),this.table.tBody.appendChild(this.createCol(e)),this.container.container.appendChild(this.table.fragment),n.table=this.table.table},getHeights:function(e){this.injected||this.injectTable(),h(this.rows,function(t){e(t.row,c(t.table)-1)})},getWidths:function(e){this.injected||this.injectTable(),h(this.columns,function(t){e(t.col,d(t.table))})},createColGroupsCol:function(){var e=this,t=document,n=t.createDocumentFragment();return n.appendChild(this.createColElement(-1)),this.samples.forEach(function(t){h(t.strings,function(t){n.appendChild(e.createColElement(t.col))})}),n},createRow:function(e){var t=this,n=document,o=n.createDocumentFragment(),r=n.createElement("th");return null!==this.hot.getRowHeader(e)&&this.hot.view.appendRowHeader(e,r),o.appendChild(r),this.samples.forEach(function(r){h(r.strings,function(r){var i=r.col,s=t.hot.getCellMeta(e,i);s.col=i,s.row=e;var a=t.hot.getCellRenderer(s),l=n.createElement("td");a(t.hot,l,e,i,t.hot.colToProp(i),r.value,s),o.appendChild(l)})}),o},createCol:function(e){var t=this,n=document,o=n.createDocumentFragment();return this.samples.forEach(function(r){h(r.strings,function(r){var i=r.row,s=t.hot.getCellMeta(i,e);s.col=e,s.row=i;var a=t.hot.getCellRenderer(s),l=n.createElement("td"),u=n.createElement("tr");a(t.hot,l,i,e,t.hot.colToProp(i),r.value,s),u.appendChild(l),o.appendChild(u)})}),o},clean:function(){this.rows.length=0,this.columns.length=0,this.samples&&this.samples.clear(),this.samples=null,this.removeTable()},injectTable:function(){var e=void 0!==arguments[0]?arguments[0]:null;this.injected||((e||this.hot.rootElement).appendChild(this.container.fragment),this.injected=!0)},removeTable:function(){this.injected&&this.container.container.parentNode&&(this.container.container.parentNode.removeChild(this.container.container),this.container=null,this.injected=!1)},createColElement:function(e){var t=document,n=t.createElement("col");return n.style.width=this.hot.view.wt.wtTable.getStretchedColumnWidth(e)+"px",n},createTable:function(){var e=void 0!==arguments[0]?arguments[0]:"",t=document,n=t.createDocumentFragment(),o=t.createElement("table"),r=t.createElement("thead"),i=t.createElement("tbody"),s=t.createElement("colgroup"),a=t.createElement("tr"),l=t.createElement("th");return this.isVertical()&&o.appendChild(s),this.isHorizontal()&&(a.appendChild(l),r.appendChild(a),o.style.tableLayout="auto",o.style.width="auto"),o.appendChild(r),this.isVertical()&&i.appendChild(a),o.appendChild(i),u(o,e),n.appendChild(o),{fragment:n,table:o,tHead:r,tBody:i,colGroup:s,tr:a,th:l}},createContainer:function(){var e=void 0!==arguments[0]?arguments[0]:"",t=document,n=t.createDocumentFragment(),o=t.createElement("div");return e="htGhostTable htAutoSize "+e.trim(),u(o,e),n.appendChild(o),{fragment:n,container:o}},isVertical:function(){return this.rows.length&&!this.columns.length?!0:!1},isHorizontal:function(){return this.columns.length&&!this.rows.length?!0:!1}},{}),Handsontable.utils=Handsontable.utils||{},Handsontable.utils.GhostTable=f},{"helpers/array":42,"helpers/dom/element":45,"helpers/mixed":48,"helpers/number":49,"helpers/object":50}],99:[function(e,t,n){"use strict";var o;Object.defineProperties(n,{SamplesGenerator:{get:function(){return h}},__esModule:{value:!0}});var r,i,s,a,l,u=(r=e("helpers/dom/element"),r&&r.__esModule&&r||{"default":r}),c=(u.addClass,u.outerHeight,u.outerWidth,(i=e("helpers/array"),i&&i.__esModule&&i||{"default":i}).arrayEach,(s=e("helpers/object"),s&&s.__esModule&&s||{"default":s}).objectEach,(a=e("helpers/number"),a&&a.__esModule&&a||{"default":a}).rangeEach),d=(l=e("helpers/mixed"),l&&l.__esModule&&l||{"default":l}).stringify,h=function(e){this.samples=null,this.dataFactory=e},f=h;$traceurRuntime.createClass(h,(o={},Object.defineProperty(o,"generateRowSamples",{value:function(e,t){return this.generateSamples("row",t,e)},configurable:!0,enumerable:!0,writable:!0}),Object.defineProperty(o,"generateColumnSamples",{value:function(e,t){return this.generateSamples("col",t,e)},configurable:!0,enumerable:!0,writable:!0}),Object.defineProperty(o,"generateSamples",{value:function(e,t,n){var o=this,r=new Map;return"number"==typeof n&&(n={from:n,to:n}),c(n.from,n.to,function(n){var i=o.generateSample(e,t,n);r.set(n,i)}),r},configurable:!0,enumerable:!0,writable:!0}),Object.defineProperty(o,"generateSample",{value:function(e,t,n){var o=this,r=new Map;return c(t.from,t.to,function(t){var i,s;if("row"===e)s=o.dataFactory(n,t);else{if("col"!==e)throw new Error("Unsupported sample type");s=o.dataFactory(t,n)}Array.isArray(s)||(s=d(s));var a=s.length;r.has(a)||r.set(a,{needed:f.SAMPLE_COUNT,strings:[]});var l=r.get(a);if(l.needed){var u="row"===e?"col":"row";l.strings.push((i={},Object.defineProperty(i,"value",{value:s,configurable:!0,enumerable:!0,writable:!0}),Object.defineProperty(i,u,{value:t,configurable:!0,enumerable:!0,writable:!0}),i)),l.needed--}}),r},configurable:!0,enumerable:!0,writable:!0}),o),{get SAMPLE_COUNT(){return 3}}),Handsontable.utils=Handsontable.utils||{},Handsontable.utils.SamplesGenerator=h},{"helpers/array":42,"helpers/dom/element":45,"helpers/mixed":48,"helpers/number":49,"helpers/object":50}],100:[function(e,t,n){"use strict";function o(e,t){var n=e,o="string"==typeof n?n.toLowerCase():null;return function(e){for(var r=!1,s=0,a=e.length;a>s;s++){if(n===e[s]){r=!0;break}if(o===i(e[s]).toLowerCase()){r=!0;break}}t(r)}}var r,i=(r=e("helpers/mixed"),r&&r.__esModule&&r||{"default":r}).stringify;Handsontable.AutocompleteValidator=function(e,t){this.strict&&this.source?"function"==typeof this.source?this.source(e,o(e,t)):o(e,t)(this.source):t(!0)}},{"helpers/mixed":48}],101:[function(e,t,n){"use strict";var o,r,i=(o=e("moment"),o&&o.__esModule&&o||{"default":o})["default"],s=(r=e("editors"),r&&r.__esModule&&r||{"default":r}).getEditor;Handsontable.DateValidator=function(e,t){var n=!0,o=s("date",this.instance);null===e&&(e="");var r=i(new Date(e)).isValid(),l=i(e,this.dateFormat||o.defaultDateFormat,!0).isValid();if(r||(n=!1),!r&&l&&(n=!0),r&&!l)if(this.correctFormat===!0){var u=a(e,this.dateFormat);this.instance.setDataAtCell(this.row,this.col,u,"dateValidator"),n=!0}else n=!1;t(n)};var a=function(e,t){var n=i(new Date(e)),o=n.format("YYYY"),r=i().format("YYYY");return o.substr(0,2)!==r.substr(0,2)?e.match(new RegExp(o))||n.year(o.replace(o.substr(0,2),r.substr(0,2))):o.length>4&&n.year((n.year()+"").substr(0,4)),n.format(t)}},{editors:29,moment:"moment"}],102:[function(e,t,n){"use strict";Handsontable.NumericValidator=function(e,t){null===e&&(e=""),t(/^-?\d*(\.|\,)?\d*$/.test(e))}},{}],SheetClip:[function(e,t,n){"use strict";!function(e){function t(e){return e.split('"').length-1}var o={parse:function(e){var n,o,r,i,s,a,l,u=[],c=0;for(r=e.split("\n"),r.length>1&&""===r[r.length-1]&&r.pop(),n=0,o=r.length;o>n;n+=1){for(r[n]=r[n].split(" "),i=0,s=r[n].length;s>i;i+=1)u[c]||(u[c]=[]),a&&0===i?(l=u[c].length-1,u[c][l]=u[c][l]+"\n"+r[n][0],a&&1&t(r[n][0])&&(a=!1,u[c][l]=u[c][l].substring(0,u[c][l].length-1).replace(/""/g,'"'))):i===s-1&&0===r[n][i].indexOf('"')&&1&t(r[n][i])?(u[c].push(r[n][i].substring(1).replace(/""/g,'"')),a=!0):(u[c].push(r[n][i].replace(/""/g,'"')),a=!1);a||(c+=1)}return u},stringify:function(e){var t,n,o,r,i,s="";for(t=0,n=e.length;n>t;t+=1){for(r=e[t].length,o=0;r>o;o+=1)o>0&&(s+=" "),i=e[t][o],s+="string"==typeof i?i.indexOf("\n")>-1?'"'+i.replace(/"/g,'""')+'"':i:null===i||void 0===i?"":i;s+="\n"}return s}};"undefined"!=typeof n?(n.parse=o.parse,n.stringify=o.stringify):e.SheetClip=o}(window)},{}],autoResize:[function(e,t,n){"use strict";function o(){var e,t={minHeight:200,maxHeight:300,minWidth:100,maxWidth:300},n=document.body,o=document.createTextNode(""),r=document.createElement("SPAN"),i=function(e,t,n){window.attachEvent?e.attachEvent("on"+t,n):e.addEventListener(t,n,!1)},s=function(e,t,n){window.removeEventListener?e.removeEventListener(t,n,!1):e.detachEvent("on"+t,n)},a=function(i){var s,a;i?/^[a-zA-Z \.,\\\/\|0-9]$/.test(i)||(i="."):i="",void 0!==o.textContent?o.textContent=e.value+i:o.data=e.value+i,r.style.fontSize=Handsontable.Dom.getComputedStyle(e).fontSize,r.style.fontFamily=Handsontable.Dom.getComputedStyle(e).fontFamily,r.style.whiteSpace="pre",n.appendChild(r),s=r.clientWidth+2,n.removeChild(r),e.style.height=t.minHeight+"px",t.minWidth>s?e.style.width=t.minWidth+"px":s>t.maxWidth?e.style.width=t.maxWidth+"px":e.style.width=s+"px",a=e.scrollHeight?e.scrollHeight-1:0,t.minHeight>a?e.style.height=t.minHeight+"px":t.maxHeight-1||"true"===e.contentEditable}var n=this,o=!1;if(e.metaKey?o=!0:e.ctrlKey&&-1===navigator.userAgent.indexOf("Mac")&&(o=!0), +o){if(document.activeElement!==this.elTextarea&&(""!==this.getSelectionText()||t()))return;this.selectNodeText(this.elTextarea),setTimeout(function(){document.activeElement!==n.elTextarea&&n.selectNodeText(n.elTextarea)},0)}!o||67!==e.keyCode&&86!==e.keyCode&&88!==e.keyCode||(88===e.keyCode?setTimeout(function(){n.triggerCut(e)},0):86===e.keyCode&&setTimeout(function(){n.triggerPaste(e)},0))},r.prototype.selectNodeText=function(e){e&&e.select()},r.prototype.getSelectionText=function(){var e="";return window.getSelection?e=window.getSelection().toString():document.selection&&"Control"!==document.selection.type&&(e=document.selection.createRange().text),e},r.prototype.copyable=function(e){if("string"!=typeof e&&void 0===e.toString)throw new Error("copyable requires string parameter");this.elTextarea.value=e,this.selectNodeText(this.elTextarea)},r.prototype.onCut=function(e){this.cutCallbacks.push(e)},r.prototype.onPaste=function(e){this.pasteCallbacks.push(e)},r.prototype.removeCallback=function(e){var t,n;for(t=0,n=this.copyCallbacks.length;n>t;t++)if(this.copyCallbacks[t]===e)return this.copyCallbacks.splice(t,1),!0;for(t=0,n=this.cutCallbacks.length;n>t;t++)if(this.cutCallbacks[t]===e)return this.cutCallbacks.splice(t,1),!0;for(t=0,n=this.pasteCallbacks.length;n>t;t++)if(this.pasteCallbacks[t]===e)return this.pasteCallbacks.splice(t,1),!0;return!1},r.prototype.triggerCut=function(e){var t=this;t.cutCallbacks&&setTimeout(function(){for(var n=0,o=t.cutCallbacks.length;o>n;n++)t.cutCallbacks[n](e)},50)},r.prototype.triggerPaste=function(e,t){var n=this;n.pasteCallbacks&&setTimeout(function(){for(var o=t||n.elTextarea.value,r=0,i=n.pasteCallbacks.length;i>r;r++)n.pasteCallbacks[r](o,e)},50)},r.prototype.destroy=function(){this.hasBeenDestroyed()||0!==--this.refCounter||(this.elDiv&&this.elDiv.parentNode&&(this.elDiv.parentNode.removeChild(this.elDiv),this.elDiv=null,this.elTextarea=null),document.documentElement.removeEventListener("keydown",this.onKeyDownRef),this.onKeyDownRef=null)},r.prototype.hasBeenDestroyed=function(){return!this.refCounter}},{}],es6collections:[function(e,t,n){"use strict";!function(e){function t(e,t){function o(e){return this&&this.constructor===o?(this._keys=[],this._values=[],this._itp=[],this.objectOnly=t,void(e&&n.call(this,e))):new o(e)}return t||y(e,"size",{get:m}),e.constructor=o,o.prototype=e,o}function n(e){this.add?e.forEach(this.add,this):e.forEach(function(e){this.set(e[0],e[1])},this)}function o(e){return this.has(e)&&(this._keys.splice(w,1),this._values.splice(w,1),this._itp.forEach(function(e){w-1}function r(e){return this.has(e)?this._values[w]:void 0}function i(e,t){if(this.objectOnly&&t!==Object(t))throw new TypeError("Invalid value used as weak collection key");if(t!=t||0===t)for(w=e.length;w--&&!b(e[w],t););else w=e.indexOf(t);return w>-1}function s(e){return i.call(this,this._values,e)}function a(e){return i.call(this,this._keys,e)}function l(e,t){return this.has(e)?this._values[w]=t:this._values[this._keys.push(e)-1]=t,this}function u(e){return this.has(e)||this._values.push(e),this}function c(){this._values.length=0}function d(){return g(this._itp,this._keys)}function h(){return g(this._itp,this._values)}function f(){return g(this._itp,this._keys,this._values)}function p(){return g(this._itp,this._values,this._values)}function g(e,t,n){var o=[0],r=!1;return e.push(o),{next:function(){var i,s=o[0];return!r&&st;t++)if(w[t].obj===e)return w[t]}function i(e){for(var t=0,n=w.length;n>t;t++)w[t]===e&&w.splice(t,1)}function s(e,t){for(var n=0,o=e.observers.length;o>n;n++)if(e.observers[n].callback===t)return e.observers[n].observer}function a(e,t){for(var n=0,o=e.observers.length;o>n;n++)if(e.observers[n].observer===t)return e.observers.splice(n,1),void(e.observers.length||i(e))}function l(e,t){h(t),Object.observe?d(t,e):clearTimeout(t.next);var n=r(e);a(n,t)}function u(e,t){var n,i=[],a=e,l=r(e);if(l?n=s(l,t):(l=new y(e),w.push(l)),n)return n;if(Object.observe)n=function(r){d(n,e),c(n,e);for(var s=0,l=r.length;l>s;){if(("length"!==r[s].name||!R(r[s].object))&&"__Jasmine_been_here_before__"!==r[s].name){var u=r[s].type;switch(u){case"new":u="add";break;case"deleted":u="delete";break;case"updated":u="update"}v[u].call(r[s],i,o(a,r[s].object))}s++}i&&t&&t(i),n.patches=i,i=[]};else if(n={},l.value=JSON.parse(JSON.stringify(e)),t){n.callback=t,n.next=null;var u=this.intervals||[100,1e3,1e4,6e4],f=0,p=function(){h(n)},g=function(){clearTimeout(n.next),n.next=setTimeout(function(){p(),f=0,n.next=setTimeout(m,u[f++])},0)},m=function(){p(),f==u.length&&(f=u.length-1),n.next=setTimeout(m,u[f++])};"undefined"!=typeof window&&(window.addEventListener?(window.addEventListener("mousedown",g),window.addEventListener("mouseup",g),window.addEventListener("keydown",g)):(window.attachEvent("onmousedown",g),window.attachEvent("onmouseup",g),window.attachEvent("onkeydown",g))),n.next=setTimeout(m,u[f++])}return n.patches=i,n.object=e,l.observers.push(new b(t,n)),c(n,e)}function c(e,t){if(Object.observe){Object.observe(t,e);for(var n in t)if(t.hasOwnProperty(n)){var o=t[n];o&&"object"==typeof o&&c(e,o)}}return e}function d(e,t){if(Object.observe){Object.unobserve(t,e);for(var n in t)if(t.hasOwnProperty(n)){var o=t[n];o&&"object"==typeof o&&d(e,o)}}return e}function h(e){if(Object.observe)Object.deliverChangeRecords(e);else{for(var t,n=0,o=w.length;o>n;n++)if(w[n].obj===e.object){t=w[n];break}t&&f(t.value,e.object,e.patches,"")}var r=e.patches;return r.length>0&&(e.patches=[],e.callback&&e.callback(r)),r}function f(e,n,o,r){for(var i=C(n),s=C(e),a=!1,l=!1,u=s.length-1;u>=0;u--){var c=s[u],d=e[c];if(n.hasOwnProperty(c)){var h=n[c];d instanceof Object?f(d,h,o,r+"/"+t(c)):d!=h&&(a=!0,o.push({op:"replace",path:r+"/"+t(c),value:h}),e[c]=h)}else o.push({op:"remove",path:r+"/"+t(c)}),delete e[c],l=!0}if(l||i.length!=s.length)for(var u=0;ur;){n=t[r];for(var s=n.path.split("/"),a=e,l=1,u=s.length;;)if(R(a)){var c=parseInt(s[l],10);if(l++,l>=u){o=m[n.op].call(n,a,c,e);break}a=a[c]}else{var d=s[l];if(-1!=d.indexOf("~")&&(d=d.replace(/~1/g,"/").replace(/~0/g,"~")),l++,l>=u){o=g[n.op].call(n,a,d,e);break}a=a[d]}r++}return o}var g={add:function(e,t){return e[t]=this.value,!0},remove:function(e,t){return delete e[t],!0},replace:function(e,t){return e[t]=this.value,!0},move:function(e,t,n){var o={op:"_get",path:this.from};return p(n,[o]),p(n,[{op:"remove",path:this.from}]),p(n,[{op:"add",path:this.path,value:o.value}]),!0},copy:function(e,t,n){var o={op:"_get",path:this.from};return p(n,[o]),p(n,[{op:"add",path:this.path,value:o.value}]),!0},test:function(e,t){return JSON.stringify(e[t])===JSON.stringify(this.value)},_get:function(e,t){this.value=e[t]}},m={add:function(e,t){return e.splice(t,0,this.value),!0},remove:function(e,t){return e.splice(t,1),!0},replace:function(e,t){return e[t]=this.value,!0},move:g.move,copy:g.copy,test:g.test,_get:g._get},v={add:function(e,n){var o={op:"add",path:n+t(this.name),value:this.object[this.name]};e.push(o)},"delete":function(e,n){var o={op:"remove",path:n+t(this.name)};e.push(o)},update:function(e,n){var o={op:"replace",path:n+t(this.name),value:this.object[this.name]};e.push(o)}},w=[];e.intervals;var y=function(){function e(e){this.observers=[],this.obj=e}return e}(),b=function(){function e(e,t){this.callback=e,this.observer=t}return e}();e.unobserve=l,e.observe=u,e.generate=h;var C;C=Object.keys?Object.keys:function(e){var t=[];for(var n in e)e.hasOwnProperty(n)&&t.push(n);return t};var R;R=Array.isArray?Array.isArray:function(e){return e.push&&"number"==typeof e.length},e.apply=p}(o||(o={})),"undefined"!=typeof n&&(n.apply=o.apply,n.observe=o.observe,n.unobserve=o.unobserve,n.generate=o.generate)},{}],moment:[function(t,n,o){ //! moment.js //! version : 2.10.6 //! authors : Tim Wood, Iskren Chernev, Moment.js contributors //! license : MIT //! momentjs.com -!function(t,r){"object"==typeof o&&"undefined"!=typeof n?n.exports=r():"function"==typeof e&&e.amd?e(r):t.moment=r()}(this,function(){"use strict";function e(){return Ln.apply(null,arguments)}function o(e){Ln=e}function r(e){return"[object Array]"===Object.prototype.toString.call(e)}function i(e){return e instanceof Date||"[object Date]"===Object.prototype.toString.call(e)}function s(e,t){var n,o=[];for(n=0;n0)for(n in In)o=In[n],r=t[o],"undefined"!=typeof r&&(e[o]=r);return e}function g(t){p(this,t),this._d=new Date(null!=t._d?t._d.getTime():NaN),jn===!1&&(jn=!0,e.updateOffset(this),jn=!1)}function m(e){return e instanceof g||null!=e&&null!=e._isAMomentObject}function v(e){return 0>e?Math.ceil(e):Math.floor(e)}function w(e){var t=+e,n=0;return 0!==t&&isFinite(t)&&(n=v(t)),n}function y(e,t,n){var o,r=Math.min(e.length,t.length),i=Math.abs(e.length-t.length),s=0;for(o=0;r>o;o++)(n&&e[o]!==t[o]||!n&&w(e[o])!==w(t[o]))&&s++;return s+i}function b(){}function C(e){return e?e.toLowerCase().replace("_","-"):e}function R(e){for(var t,n,o,r,i=0;i0;){if(o=_(r.slice(0,t).join("-")))return o;if(n&&n.length>=t&&y(r,n,!0)>=t-1)break;t--}i++}return null}function _(e){var o=null;if(!Bn[e]&&"undefined"!=typeof n&&n&&n.exports)try{o=Wn._abbr,t("./locale/"+e),S(o)}catch(r){}return Bn[e]}function S(e,t){var n;return e&&(n="undefined"==typeof t?T(e):E(e,t),n&&(Wn=n)),Wn._abbr}function E(e,t){return null!==t?(t.abbr=e,Bn[e]=Bn[e]||new b,Bn[e].set(t),S(e),Bn[e]):(delete Bn[e],null)}function T(e){var t;if(e&&e._locale&&e._locale._abbr&&(e=e._locale._abbr),!e)return Wn;if(!r(e)){if(t=_(e))return t;e=[e]}return R(e)}function O(e,t){var n=e.toLowerCase();Fn[n]=Fn[n+"s"]=Fn[t]=e}function M(e){return"string"==typeof e?Fn[e]||Fn[e.toLowerCase()]:void 0}function k(e){var t,n,o={};for(n in e)a(e,n)&&(t=M(n),t&&(o[t]=e[n]));return o}function H(t,n){return function(o){return null!=o?(x(this,t,o),e.updateOffset(this,n),this):D(this,t)}}function D(e,t){return e._d["get"+(e._isUTC?"UTC":"")+t]()}function x(e,t,n){return e._d["set"+(e._isUTC?"UTC":"")+t](n)}function A(e,t){var n;if("object"==typeof e)for(n in e)this.set(n,e[n]);else if(e=M(e),"function"==typeof this[e])return this[e](t);return this}function P(e,t,n){var o=""+Math.abs(e),r=t-o.length,i=e>=0;return(i?n?"+":"":"-")+Math.pow(10,Math.max(0,r)).toString().substr(1)+o}function N(e,t,n,o){var r=o;"string"==typeof o&&(r=function(){return this[o]()}),e&&(Un[e]=r),t&&(Un[t[0]]=function(){return P(r.apply(this,arguments),t[1],t[2])}),n&&(Un[n]=function(){return this.localeData().ordinal(r.apply(this,arguments),e)})}function L(e){return e.match(/\[[\s\S]/)?e.replace(/^\[|\]$/g,""):e.replace(/\\/g,"")}function W(e){var t,n,o=e.match(Vn);for(t=0,n=o.length;n>t;t++)Un[o[t]]?o[t]=Un[o[t]]:o[t]=L(o[t]);return function(r){var i="";for(t=0;n>t;t++)i+=o[t]instanceof Function?o[t].call(r,e):o[t];return i}}function I(e,t){return e.isValid()?(t=j(t,e.localeData()),Yn[t]=Yn[t]||W(t),Yn[t](e)):e.localeData().invalidDate()}function j(e,t){function n(e){return t.longDateFormat(e)||e}var o=5;for(zn.lastIndex=0;o>=0&&zn.test(e);)e=e.replace(zn,n),zn.lastIndex=0,o-=1;return e}function B(e){return"function"==typeof e&&"[object Function]"===Object.prototype.toString.call(e)}function F(e,t,n){so[e]=B(t)?t:function(e){return e&&n?n:t}}function V(e,t){return a(so,e)?so[e](t._strict,t._locale):new RegExp(z(e))}function z(e){return e.replace("\\","").replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g,function(e,t,n,o,r){return t||n||o||r}).replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}function Y(e,t){var n,o=t;for("string"==typeof e&&(e=[e]),"number"==typeof t&&(o=function(e,n){n[t]=w(e)}),n=0;no;o++){if(r=u([2e3,o]),n&&!this._longMonthsParse[o]&&(this._longMonthsParse[o]=new RegExp("^"+this.months(r,"").replace(".","")+"$","i"),this._shortMonthsParse[o]=new RegExp("^"+this.monthsShort(r,"").replace(".","")+"$","i")),n||this._monthsParse[o]||(i="^"+this.months(r,"")+"|^"+this.monthsShort(r,""),this._monthsParse[o]=new RegExp(i.replace(".",""),"i")),n&&"MMMM"===t&&this._longMonthsParse[o].test(e))return o;if(n&&"MMM"===t&&this._shortMonthsParse[o].test(e))return o;if(!n&&this._monthsParse[o].test(e))return o}}function Z(e,t){var n;return"string"==typeof t&&(t=e.localeData().monthsParse(t),"number"!=typeof t)?e:(n=Math.min(e.date(),$(e.year(),t)),e._d["set"+(e._isUTC?"UTC":"")+"Month"](t,n),e)}function J(t){return null!=t?(Z(this,t),e.updateOffset(this,!0),this):D(this,"Month")}function Q(){return $(this.year(),this.month())}function ee(e){var t,n=e._a;return n&&-2===d(e).overflow&&(t=n[uo]<0||n[uo]>11?uo:n[co]<1||n[co]>$(n[lo],n[uo])?co:n[ho]<0||n[ho]>24||24===n[ho]&&(0!==n[fo]||0!==n[po]||0!==n[go])?ho:n[fo]<0||n[fo]>59?fo:n[po]<0||n[po]>59?po:n[go]<0||n[go]>999?go:-1,d(e)._overflowDayOfYear&&(lo>t||t>co)&&(t=co),d(e).overflow=t),e}function te(t){e.suppressDeprecationWarnings===!1&&"undefined"!=typeof console&&console.warn&&console.warn("Deprecation warning: "+t)}function ne(e,t){var n=!0;return l(function(){return n&&(te(e+"\n"+(new Error).stack),n=!1),t.apply(this,arguments)},t)}function oe(e,t){wo[e]||(te(t),wo[e]=!0)}function re(e){var t,n,o=e._i,r=yo.exec(o);if(r){for(d(e).iso=!0,t=0,n=bo.length;n>t;t++)if(bo[t][1].exec(o)){e._f=bo[t][0];break}for(t=0,n=Co.length;n>t;t++)if(Co[t][1].exec(o)){e._f+=(r[6]||" ")+Co[t][0];break}o.match(oo)&&(e._f+="Z"),_e(e)}else e._isValid=!1}function ie(t){var n=Ro.exec(t._i);return null!==n?void(t._d=new Date(+n[1])):(re(t),void(t._isValid===!1&&(delete t._isValid,e.createFromInputFallback(t))))}function se(e,t,n,o,r,i,s){var a=new Date(e,t,n,o,r,i,s);return 1970>e&&a.setFullYear(e),a}function ae(e){var t=new Date(Date.UTC.apply(null,arguments));return 1970>e&&t.setUTCFullYear(e),t}function le(e){return ue(e)?366:365}function ue(e){return e%4===0&&e%100!==0||e%400===0}function ce(){return ue(this.year())}function de(e,t,n){var o,r=n-t,i=n-e.day();return i>r&&(i-=7),r-7>i&&(i+=7),o=De(e).add(i,"d"),{week:Math.ceil(o.dayOfYear()/7),year:o.year()}}function he(e){return de(e,this._week.dow,this._week.doy).week}function fe(){return this._week.dow}function pe(){return this._week.doy}function ge(e){var t=this.localeData().week(this);return null==e?t:this.add(7*(e-t),"d")}function me(e){var t=de(this,1,4).week;return null==e?t:this.add(7*(e-t),"d")}function ve(e,t,n,o,r){var i,s=6+r-o,a=ae(e,0,1+s),l=a.getUTCDay();return r>l&&(l+=7),n=null!=n?1*n:r,i=1+s+7*(t-1)-l+n,{year:i>0?e:e-1,dayOfYear:i>0?i:le(e-1)+i}}function we(e){var t=Math.round((this.clone().startOf("day")-this.clone().startOf("year"))/864e5)+1;return null==e?t:this.add(e-t,"d")}function ye(e,t,n){return null!=e?e:null!=t?t:n}function be(e){var t=new Date;return e._useUTC?[t.getUTCFullYear(),t.getUTCMonth(),t.getUTCDate()]:[t.getFullYear(),t.getMonth(),t.getDate()]}function Ce(e){var t,n,o,r,i=[];if(!e._d){for(o=be(e),e._w&&null==e._a[co]&&null==e._a[uo]&&Re(e),e._dayOfYear&&(r=ye(e._a[lo],o[lo]),e._dayOfYear>le(r)&&(d(e)._overflowDayOfYear=!0),n=ae(r,0,e._dayOfYear),e._a[uo]=n.getUTCMonth(),e._a[co]=n.getUTCDate()),t=0;3>t&&null==e._a[t];++t)e._a[t]=i[t]=o[t];for(;7>t;t++)e._a[t]=i[t]=null==e._a[t]?2===t?1:0:e._a[t];24===e._a[ho]&&0===e._a[fo]&&0===e._a[po]&&0===e._a[go]&&(e._nextDay=!0,e._a[ho]=0),e._d=(e._useUTC?ae:se).apply(null,i),null!=e._tzm&&e._d.setUTCMinutes(e._d.getUTCMinutes()-e._tzm),e._nextDay&&(e._a[ho]=24)}}function Re(e){var t,n,o,r,i,s,a;t=e._w,null!=t.GG||null!=t.W||null!=t.E?(i=1,s=4,n=ye(t.GG,e._a[lo],de(De(),1,4).year),o=ye(t.W,1),r=ye(t.E,1)):(i=e._locale._week.dow,s=e._locale._week.doy,n=ye(t.gg,e._a[lo],de(De(),i,s).year),o=ye(t.w,1),null!=t.d?(r=t.d,i>r&&++o):r=null!=t.e?t.e+i:i),a=ve(n,o,r,s,i),e._a[lo]=a.year,e._dayOfYear=a.dayOfYear}function _e(t){if(t._f===e.ISO_8601)return void re(t);t._a=[],d(t).empty=!0;var n,o,r,i,s,a=""+t._i,l=a.length,u=0;for(r=j(t._f,t._locale).match(Vn)||[],n=0;n0&&d(t).unusedInput.push(s),a=a.slice(a.indexOf(o)+o.length),u+=o.length),Un[i]?(o?d(t).empty=!1:d(t).unusedTokens.push(i),G(i,o,t)):t._strict&&!o&&d(t).unusedTokens.push(i);d(t).charsLeftOver=l-u,a.length>0&&d(t).unusedInput.push(a),d(t).bigHour===!0&&t._a[ho]<=12&&t._a[ho]>0&&(d(t).bigHour=void 0),t._a[ho]=Se(t._locale,t._a[ho],t._meridiem),Ce(t),ee(t)}function Se(e,t,n){var o;return null==n?t:null!=e.meridiemHour?e.meridiemHour(t,n):null!=e.isPM?(o=e.isPM(n),o&&12>t&&(t+=12),o||12!==t||(t=0),t):t}function Ee(e){var t,n,o,r,i;if(0===e._f.length)return d(e).invalidFormat=!0,void(e._d=new Date(NaN));for(r=0;ri)&&(o=i,n=t));l(e,n||t)}function Te(e){if(!e._d){var t=k(e._i);e._a=[t.year,t.month,t.day||t.date,t.hour,t.minute,t.second,t.millisecond],Ce(e)}}function Oe(e){var t=new g(ee(Me(e)));return t._nextDay&&(t.add(1,"d"),t._nextDay=void 0),t}function Me(e){var t=e._i,n=e._f;return e._locale=e._locale||T(e._l),null===t||void 0===n&&""===t?f({nullInput:!0}):("string"==typeof t&&(e._i=t=e._locale.preparse(t)),m(t)?new g(ee(t)):(r(n)?Ee(e):n?_e(e):i(t)?e._d=t:ke(e),e))}function ke(t){var n=t._i;void 0===n?t._d=new Date:i(n)?t._d=new Date(+n):"string"==typeof n?ie(t):r(n)?(t._a=s(n.slice(0),function(e){return parseInt(e,10)}),Ce(t)):"object"==typeof n?Te(t):"number"==typeof n?t._d=new Date(n):e.createFromInputFallback(t)}function He(e,t,n,o,r){var i={};return"boolean"==typeof n&&(o=n,n=void 0),i._isAMomentObject=!0,i._useUTC=i._isUTC=r,i._l=n,i._i=e,i._f=t,i._strict=o,Oe(i)}function De(e,t,n,o){return He(e,t,n,o,!1)}function xe(e,t){var n,o;if(1===t.length&&r(t[0])&&(t=t[0]),!t.length)return De();for(n=t[0],o=1;oe&&(e=-e,n="-"),n+P(~~(e/60),2)+t+P(~~e%60,2)})}function Ie(e){var t=(e||"").match(oo)||[],n=t[t.length-1]||[],o=(n+"").match(Oo)||["-",0,0],r=+(60*o[1])+w(o[2]);return"+"===o[0]?r:-r}function je(t,n){var o,r;return n._isUTC?(o=n.clone(),r=(m(t)||i(t)?+t:+De(t))-+o,o._d.setTime(+o._d+r),e.updateOffset(o,!1),o):De(t).local()}function Be(e){return 15*-Math.round(e._d.getTimezoneOffset()/15)}function Fe(t,n){var o,r=this._offset||0;return null!=t?("string"==typeof t&&(t=Ie(t)),Math.abs(t)<16&&(t=60*t),!this._isUTC&&n&&(o=Be(this)),this._offset=t,this._isUTC=!0,null!=o&&this.add(o,"m"),r!==t&&(!n||this._changeInProgress?ot(this,Je(t-r,"m"),1,!1):this._changeInProgress||(this._changeInProgress=!0,e.updateOffset(this,!0),this._changeInProgress=null)),this):this._isUTC?r:Be(this)}function Ve(e,t){return null!=e?("string"!=typeof e&&(e=-e),this.utcOffset(e,t),this):-this.utcOffset()}function ze(e){return this.utcOffset(0,e)}function Ye(e){return this._isUTC&&(this.utcOffset(0,e),this._isUTC=!1,e&&this.subtract(Be(this),"m")),this}function Ue(){return this._tzm?this.utcOffset(this._tzm):"string"==typeof this._i&&this.utcOffset(Ie(this._i)),this}function Ge(e){return e=e?De(e).utcOffset():0,(this.utcOffset()-e)%60===0}function $e(){return this.utcOffset()>this.clone().month(0).utcOffset()||this.utcOffset()>this.clone().month(5).utcOffset()}function Ke(){if("undefined"!=typeof this._isDSTShifted)return this._isDSTShifted;var e={};if(p(e,this),e=Me(e),e._a){var t=e._isUTC?u(e._a):De(e._a);this._isDSTShifted=this.isValid()&&y(e._a,t.toArray())>0}else this._isDSTShifted=!1;return this._isDSTShifted}function Xe(){return!this._isUTC}function qe(){return this._isUTC}function Ze(){return this._isUTC&&0===this._offset}function Je(e,t){var n,o,r,i=e,s=null;return Le(e)?i={ms:e._milliseconds,d:e._days,M:e._months}:"number"==typeof e?(i={},t?i[t]=e:i.milliseconds=e):(s=Mo.exec(e))?(n="-"===s[1]?-1:1,i={y:0,d:w(s[co])*n,h:w(s[ho])*n,m:w(s[fo])*n,s:w(s[po])*n,ms:w(s[go])*n}):(s=ko.exec(e))?(n="-"===s[1]?-1:1,i={y:Qe(s[2],n),M:Qe(s[3],n),d:Qe(s[4],n),h:Qe(s[5],n),m:Qe(s[6],n),s:Qe(s[7],n),w:Qe(s[8],n)}):null==i?i={}:"object"==typeof i&&("from"in i||"to"in i)&&(r=tt(De(i.from),De(i.to)),i={},i.ms=r.milliseconds,i.M=r.months),o=new Ne(i),Le(e)&&a(e,"_locale")&&(o._locale=e._locale),o}function Qe(e,t){var n=e&&parseFloat(e.replace(",","."));return(isNaN(n)?0:n)*t}function et(e,t){var n={milliseconds:0,months:0};return n.months=t.month()-e.month()+12*(t.year()-e.year()),e.clone().add(n.months,"M").isAfter(t)&&--n.months,n.milliseconds=+t-+e.clone().add(n.months,"M"),n}function tt(e,t){var n;return t=je(t,e),e.isBefore(t)?n=et(e,t):(n=et(t,e),n.milliseconds=-n.milliseconds,n.months=-n.months),n}function nt(e,t){return function(n,o){var r,i;return null===o||isNaN(+o)||(oe(t,"moment()."+t+"(period, number) is deprecated. Please use moment()."+t+"(number, period)."),i=n,n=o,o=i),n="string"==typeof n?+n:n,r=Je(n,o),ot(this,r,e),this}}function ot(t,n,o,r){var i=n._milliseconds,s=n._days,a=n._months;r=null==r?!0:r,i&&t._d.setTime(+t._d+i*o),s&&x(t,"Date",D(t,"Date")+s*o),a&&Z(t,D(t,"Month")+a*o),r&&e.updateOffset(t,s||a)}function rt(e,t){var n=e||De(),o=je(n,this).startOf("day"),r=this.diff(o,"days",!0),i=-6>r?"sameElse":-1>r?"lastWeek":0>r?"lastDay":1>r?"sameDay":2>r?"nextDay":7>r?"nextWeek":"sameElse";return this.format(t&&t[i]||this.localeData().calendar(i,this,De(n)))}function it(){return new g(this)}function st(e,t){var n;return t=M("undefined"!=typeof t?t:"millisecond"),"millisecond"===t?(e=m(e)?e:De(e),+this>+e):(n=m(e)?+e:+De(e),n<+this.clone().startOf(t))}function at(e,t){var n;return t=M("undefined"!=typeof t?t:"millisecond"),"millisecond"===t?(e=m(e)?e:De(e),+e>+this):(n=m(e)?+e:+De(e),+this.clone().endOf(t)t-i?(n=e.clone().add(r-1,"months"),o=(t-i)/(i-n)):(n=e.clone().add(r+1,"months"),o=(t-i)/(n-i)),-(r+o)}function ht(){return this.clone().locale("en").format("ddd MMM DD YYYY HH:mm:ss [GMT]ZZ")}function ft(){var e=this.clone().utc();return 0t;t++)if(this._weekdaysParse[t]||(n=De([2e3,1]).day(t),o="^"+this.weekdays(n,"")+"|^"+this.weekdaysShort(n,"")+"|^"+this.weekdaysMin(n,""),this._weekdaysParse[t]=new RegExp(o.replace(".",""),"i")),this._weekdaysParse[t].test(e))return t}function zt(e){var t=this._isUTC?this._d.getUTCDay():this._d.getDay();return null!=e?(e=It(e,this.localeData()),this.add(e-t,"d")):t}function Yt(e){var t=(this.day()+7-this.localeData()._week.dow)%7;return null==e?t:this.add(e-t,"d")}function Ut(e){return null==e?this.day()||7:this.day(this.day()%7?e:e-7)}function Gt(e,t){N(e,0,0,function(){return this.localeData().meridiem(this.hours(),this.minutes(),t)})}function $t(e,t){return t._meridiemParse}function Kt(e){return"p"===(e+"").toLowerCase().charAt(0)}function Xt(e,t,n){return e>11?n?"pm":"PM":n?"am":"AM"}function qt(e,t){t[go]=w(1e3*("0."+e))}function Zt(){return this._isUTC?"UTC":""}function Jt(){return this._isUTC?"Coordinated Universal Time":""}function Qt(e){return De(1e3*e)}function en(){return De.apply(null,arguments).parseZone()}function tn(e,t,n){var o=this._calendar[e];return"function"==typeof o?o.call(t,n):o}function nn(e){var t=this._longDateFormat[e],n=this._longDateFormat[e.toUpperCase()];return t||!n?t:(this._longDateFormat[e]=n.replace(/MMMM|MM|DD|dddd/g,function(e){return e.slice(1)}),this._longDateFormat[e])}function on(){return this._invalidDate}function rn(e){return this._ordinal.replace("%d",e)}function sn(e){return e}function an(e,t,n,o){var r=this._relativeTime[n];return"function"==typeof r?r(e,t,n,o):r.replace(/%d/i,e)}function ln(e,t){var n=this._relativeTime[e>0?"future":"past"];return"function"==typeof n?n(t):n.replace(/%s/i,t)}function un(e){var t,n;for(n in e)t=e[n],"function"==typeof t?this[n]=t:this["_"+n]=t;this._ordinalParseLenient=new RegExp(this._ordinalParse.source+"|"+/\d{1,2}/.source)}function cn(e,t,n,o){var r=T(),i=u().set(o,t);return r[n](i,e)}function dn(e,t,n,o,r){if("number"==typeof e&&(t=e,e=void 0),e=e||"",null!=t)return cn(e,t,n,r);var i,s=[];for(i=0;o>i;i++)s[i]=cn(e,i,n,r);return s}function hn(e,t){return dn(e,t,"months",12,"month")}function fn(e,t){return dn(e,t,"monthsShort",12,"month")}function pn(e,t){return dn(e,t,"weekdays",7,"day")}function gn(e,t){return dn(e,t,"weekdaysShort",7,"day")}function mn(e,t){return dn(e,t,"weekdaysMin",7,"day")}function vn(){var e=this._data;return this._milliseconds=Jo(this._milliseconds),this._days=Jo(this._days),this._months=Jo(this._months),e.milliseconds=Jo(e.milliseconds),e.seconds=Jo(e.seconds),e.minutes=Jo(e.minutes),e.hours=Jo(e.hours),e.months=Jo(e.months),e.years=Jo(e.years),this}function wn(e,t,n,o){var r=Je(t,n);return e._milliseconds+=o*r._milliseconds,e._days+=o*r._days,e._months+=o*r._months,e._bubble()}function yn(e,t){return wn(this,e,t,1)}function bn(e,t){return wn(this,e,t,-1)}function Cn(e){return 0>e?Math.floor(e):Math.ceil(e)}function Rn(){var e,t,n,o,r,i=this._milliseconds,s=this._days,a=this._months,l=this._data;return i>=0&&s>=0&&a>=0||0>=i&&0>=s&&0>=a||(i+=864e5*Cn(Sn(a)+s),s=0,a=0),l.milliseconds=i%1e3,e=v(i/1e3),l.seconds=e%60,t=v(e/60),l.minutes=t%60,n=v(t/60),l.hours=n%24,s+=v(n/24),r=v(_n(s)),a+=r,s-=Cn(Sn(r)),o=v(a/12),a%=12,l.days=s,l.months=a,l.years=o,this}function _n(e){return 4800*e/146097}function Sn(e){return 146097*e/4800}function En(e){var t,n,o=this._milliseconds;if(e=M(e),"month"===e||"year"===e)return t=this._days+o/864e5,n=this._months+_n(t),"month"===e?n:n/12;switch(t=this._days+Math.round(Sn(this._months)),e){case"week":return t/7+o/6048e5;case"day":return t+o/864e5;case"hour":return 24*t+o/36e5;case"minute":return 1440*t+o/6e4;case"second":return 86400*t+o/1e3;case"millisecond":return Math.floor(864e5*t)+o;default:throw new Error("Unknown unit "+e)}}function Tn(){return this._milliseconds+864e5*this._days+this._months%12*2592e6+31536e6*w(this._months/12)}function On(e){return function(){return this.as(e)}}function Mn(e){return e=M(e),this[e+"s"]()}function kn(e){return function(){return this._data[e]}}function Hn(){return v(this.days()/7)}function Dn(e,t,n,o,r){return r.relativeTime(t||1,!!n,e,o)}function xn(e,t,n){var o=Je(e).abs(),r=pr(o.as("s")),i=pr(o.as("m")),s=pr(o.as("h")),a=pr(o.as("d")),l=pr(o.as("M")),u=pr(o.as("y")),c=r0,c[4]=n,Dn.apply(null,c)}function An(e,t){return void 0===gr[e]?!1:void 0===t?gr[e]:(gr[e]=t,!0)}function Pn(e){var t=this.localeData(),n=xn(this,!e,t);return e&&(n=t.pastFuture(+this,n)),t.postformat(n)}function Nn(){var e,t,n,o=mr(this._milliseconds)/1e3,r=mr(this._days),i=mr(this._months);e=v(o/60),t=v(e/60),o%=60,e%=60,n=v(i/12),i%=12;var s=n,a=i,l=r,u=t,c=e,d=o,h=this.asSeconds();return h?(0>h?"-":"")+"P"+(s?s+"Y":"")+(a?a+"M":"")+(l?l+"D":"")+(u||c||d?"T":"")+(u?u+"H":"")+(c?c+"M":"")+(d?d+"S":""):"P0D"}var Ln,Wn,In=e.momentProperties=[],jn=!1,Bn={},Fn={},Vn=/(\[[^\[]*\])|(\\)?(Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Q|YYYYYY|YYYYY|YYYY|YY|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g,zn=/(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,Yn={},Un={},Gn=/\d/,$n=/\d\d/,Kn=/\d{3}/,Xn=/\d{4}/,qn=/[+-]?\d{6}/,Zn=/\d\d?/,Jn=/\d{1,3}/,Qn=/\d{1,4}/,eo=/[+-]?\d{1,6}/,to=/\d+/,no=/[+-]?\d+/,oo=/Z|[+-]\d\d:?\d\d/gi,ro=/[+-]?\d+(\.\d{1,3})?/,io=/[0-9]*['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+|[\u0600-\u06FF\/]+(\s*?[\u0600-\u06FF]+){1,2}/i,so={},ao={},lo=0,uo=1,co=2,ho=3,fo=4,po=5,go=6;N("M",["MM",2],"Mo",function(){return this.month()+1}),N("MMM",0,0,function(e){return this.localeData().monthsShort(this,e)}),N("MMMM",0,0,function(e){return this.localeData().months(this,e)}),O("month","M"),F("M",Zn),F("MM",Zn,$n),F("MMM",io),F("MMMM",io),Y(["M","MM"],function(e,t){t[uo]=w(e)-1}),Y(["MMM","MMMM"],function(e,t,n,o){var r=n._locale.monthsParse(e,o,n._strict);null!=r?t[uo]=r:d(n).invalidMonth=e});var mo="January_February_March_April_May_June_July_August_September_October_November_December".split("_"),vo="Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),wo={};e.suppressDeprecationWarnings=!1;var yo=/^\s*(?:[+-]\d{6}|\d{4})-(?:(\d\d-\d\d)|(W\d\d$)|(W\d\d-\d)|(\d\d\d))((T| )(\d\d(:\d\d(:\d\d(\.\d+)?)?)?)?([\+\-]\d\d(?::?\d\d)?|\s*Z)?)?$/,bo=[["YYYYYY-MM-DD",/[+-]\d{6}-\d{2}-\d{2}/],["YYYY-MM-DD",/\d{4}-\d{2}-\d{2}/],["GGGG-[W]WW-E",/\d{4}-W\d{2}-\d/],["GGGG-[W]WW",/\d{4}-W\d{2}/],["YYYY-DDD",/\d{4}-\d{3}/]],Co=[["HH:mm:ss.SSSS",/(T| )\d\d:\d\d:\d\d\.\d+/],["HH:mm:ss",/(T| )\d\d:\d\d:\d\d/],["HH:mm",/(T| )\d\d:\d\d/],["HH",/(T| )\d\d/]],Ro=/^\/?Date\((\-?\d+)/i;e.createFromInputFallback=ne("moment construction falls back to js Date. This is discouraged and will be removed in upcoming major release. Please refer to https://github.com/moment/moment/issues/1407 for more info.",function(e){e._d=new Date(e._i+(e._useUTC?" UTC":""))}),N(0,["YY",2],0,function(){return this.year()%100}),N(0,["YYYY",4],0,"year"),N(0,["YYYYY",5],0,"year"),N(0,["YYYYYY",6,!0],0,"year"),O("year","y"),F("Y",no),F("YY",Zn,$n),F("YYYY",Qn,Xn),F("YYYYY",eo,qn),F("YYYYYY",eo,qn),Y(["YYYYY","YYYYYY"],lo),Y("YYYY",function(t,n){n[lo]=2===t.length?e.parseTwoDigitYear(t):w(t)}),Y("YY",function(t,n){n[lo]=e.parseTwoDigitYear(t)}),e.parseTwoDigitYear=function(e){return w(e)+(w(e)>68?1900:2e3)};var _o=H("FullYear",!1);N("w",["ww",2],"wo","week"),N("W",["WW",2],"Wo","isoWeek"),O("week","w"),O("isoWeek","W"),F("w",Zn),F("ww",Zn,$n),F("W",Zn),F("WW",Zn,$n),U(["w","ww","W","WW"],function(e,t,n,o){t[o.substr(0,1)]=w(e)});var So={dow:0,doy:6};N("DDD",["DDDD",3],"DDDo","dayOfYear"),O("dayOfYear","DDD"),F("DDD",Jn),F("DDDD",Kn),Y(["DDD","DDDD"],function(e,t,n){n._dayOfYear=w(e)}),e.ISO_8601=function(){};var Eo=ne("moment().min is deprecated, use moment.min instead. https://github.com/moment/moment/issues/1548",function(){var e=De.apply(null,arguments);return this>e?this:e}),To=ne("moment().max is deprecated, use moment.max instead. https://github.com/moment/moment/issues/1548",function(){var e=De.apply(null,arguments);return e>this?this:e});We("Z",":"),We("ZZ",""),F("Z",oo),F("ZZ",oo),Y(["Z","ZZ"],function(e,t,n){n._useUTC=!0,n._tzm=Ie(e)});var Oo=/([\+\-]|\d\d)/gi;e.updateOffset=function(){};var Mo=/(\-)?(?:(\d*)\.)?(\d+)\:(\d+)(?:\:(\d+)\.?(\d{3})?)?/,ko=/^(-)?P(?:(?:([0-9,.]*)Y)?(?:([0-9,.]*)M)?(?:([0-9,.]*)D)?(?:T(?:([0-9,.]*)H)?(?:([0-9,.]*)M)?(?:([0-9,.]*)S)?)?|([0-9,.]*)W)$/;Je.fn=Ne.prototype;var Ho=nt(1,"add"),Do=nt(-1,"subtract");e.defaultFormat="YYYY-MM-DDTHH:mm:ssZ";var xo=ne("moment().lang() is deprecated. Instead, use moment().localeData() to get the language configuration. Use moment().locale() to change languages.",function(e){return void 0===e?this.localeData():this.locale(e)});N(0,["gg",2],0,function(){return this.weekYear()%100}),N(0,["GG",2],0,function(){return this.isoWeekYear()%100}),Dt("gggg","weekYear"),Dt("ggggg","weekYear"),Dt("GGGG","isoWeekYear"),Dt("GGGGG","isoWeekYear"),O("weekYear","gg"),O("isoWeekYear","GG"),F("G",no),F("g",no),F("GG",Zn,$n),F("gg",Zn,$n),F("GGGG",Qn,Xn),F("gggg",Qn,Xn),F("GGGGG",eo,qn),F("ggggg",eo,qn),U(["gggg","ggggg","GGGG","GGGGG"],function(e,t,n,o){t[o.substr(0,2)]=w(e)}),U(["gg","GG"],function(t,n,o,r){n[r]=e.parseTwoDigitYear(t)}),N("Q",0,0,"quarter"),O("quarter","Q"),F("Q",Gn),Y("Q",function(e,t){t[uo]=3*(w(e)-1)}),N("D",["DD",2],"Do","date"),O("date","D"),F("D",Zn),F("DD",Zn,$n),F("Do",function(e,t){return e?t._ordinalParse:t._ordinalParseLenient}),Y(["D","DD"],co),Y("Do",function(e,t){t[co]=w(e.match(Zn)[0],10)});var Ao=H("Date",!0);N("d",0,"do","day"),N("dd",0,0,function(e){return this.localeData().weekdaysMin(this,e)}),N("ddd",0,0,function(e){return this.localeData().weekdaysShort(this,e)}),N("dddd",0,0,function(e){return this.localeData().weekdays(this,e)}),N("e",0,0,"weekday"),N("E",0,0,"isoWeekday"),O("day","d"),O("weekday","e"),O("isoWeekday","E"),F("d",Zn),F("e",Zn),F("E",Zn),F("dd",io),F("ddd",io),F("dddd",io),U(["dd","ddd","dddd"],function(e,t,n){var o=n._locale.weekdaysParse(e);null!=o?t.d=o:d(n).invalidWeekday=e}),U(["d","e","E"],function(e,t,n,o){t[o]=w(e)});var Po="Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),No="Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),Lo="Su_Mo_Tu_We_Th_Fr_Sa".split("_");N("H",["HH",2],0,"hour"),N("h",["hh",2],0,function(){return this.hours()%12||12}),Gt("a",!0),Gt("A",!1),O("hour","h"),F("a",$t),F("A",$t),F("H",Zn),F("h",Zn),F("HH",Zn,$n),F("hh",Zn,$n),Y(["H","HH"],ho),Y(["a","A"],function(e,t,n){n._isPm=n._locale.isPM(e),n._meridiem=e}),Y(["h","hh"],function(e,t,n){t[ho]=w(e),d(n).bigHour=!0});var Wo=/[ap]\.?m?\.?/i,Io=H("Hours",!0);N("m",["mm",2],0,"minute"),O("minute","m"),F("m",Zn),F("mm",Zn,$n),Y(["m","mm"],fo);var jo=H("Minutes",!1);N("s",["ss",2],0,"second"),O("second","s"),F("s",Zn),F("ss",Zn,$n),Y(["s","ss"],po);var Bo=H("Seconds",!1);N("S",0,0,function(){return~~(this.millisecond()/100)}),N(0,["SS",2],0,function(){return~~(this.millisecond()/10)}),N(0,["SSS",3],0,"millisecond"),N(0,["SSSS",4],0,function(){return 10*this.millisecond()}),N(0,["SSSSS",5],0,function(){return 100*this.millisecond()}),N(0,["SSSSSS",6],0,function(){return 1e3*this.millisecond()}),N(0,["SSSSSSS",7],0,function(){return 1e4*this.millisecond()}),N(0,["SSSSSSSS",8],0,function(){return 1e5*this.millisecond()}),N(0,["SSSSSSSSS",9],0,function(){return 1e6*this.millisecond()}),O("millisecond","ms"),F("S",Jn,Gn),F("SS",Jn,$n),F("SSS",Jn,Kn);var Fo;for(Fo="SSSS";Fo.length<=9;Fo+="S")F(Fo,to);for(Fo="S";Fo.length<=9;Fo+="S")Y(Fo,qt);var Vo=H("Milliseconds",!1);N("z",0,0,"zoneAbbr"),N("zz",0,0,"zoneName");var zo=g.prototype;zo.add=Ho,zo.calendar=rt,zo.clone=it,zo.diff=ct,zo.endOf=Rt,zo.format=pt,zo.from=gt,zo.fromNow=mt,zo.to=vt,zo.toNow=wt,zo.get=A,zo.invalidAt=Ht,zo.isAfter=st,zo.isBefore=at,zo.isBetween=lt,zo.isSame=ut,zo.isValid=Mt,zo.lang=xo,zo.locale=yt,zo.localeData=bt,zo.max=To,zo.min=Eo,zo.parsingFlags=kt,zo.set=A,zo.startOf=Ct,zo.subtract=Do,zo.toArray=Tt,zo.toObject=Ot,zo.toDate=Et,zo.toISOString=ft,zo.toJSON=ft,zo.toString=ht,zo.unix=St,zo.valueOf=_t,zo.year=_o,zo.isLeapYear=ce,zo.weekYear=At,zo.isoWeekYear=Pt,zo.quarter=zo.quarters=Wt,zo.month=J,zo.daysInMonth=Q,zo.week=zo.weeks=ge,zo.isoWeek=zo.isoWeeks=me,zo.weeksInYear=Lt,zo.isoWeeksInYear=Nt,zo.date=Ao,zo.day=zo.days=zt,zo.weekday=Yt,zo.isoWeekday=Ut,zo.dayOfYear=we,zo.hour=zo.hours=Io,zo.minute=zo.minutes=jo,zo.second=zo.seconds=Bo,zo.millisecond=zo.milliseconds=Vo,zo.utcOffset=Fe, -zo.utc=ze,zo.local=Ye,zo.parseZone=Ue,zo.hasAlignedHourOffset=Ge,zo.isDST=$e,zo.isDSTShifted=Ke,zo.isLocal=Xe,zo.isUtcOffset=qe,zo.isUtc=Ze,zo.isUTC=Ze,zo.zoneAbbr=Zt,zo.zoneName=Jt,zo.dates=ne("dates accessor is deprecated. Use date instead.",Ao),zo.months=ne("months accessor is deprecated. Use month instead",J),zo.years=ne("years accessor is deprecated. Use year instead",_o),zo.zone=ne("moment().zone is deprecated, use moment().utcOffset instead. https://github.com/moment/moment/issues/1779",Ve);var Yo=zo,Uo={sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},Go={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"},$o="Invalid date",Ko="%d",Xo=/\d{1,2}/,qo={future:"in %s",past:"%s ago",s:"a few seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},Zo=b.prototype;Zo._calendar=Uo,Zo.calendar=tn,Zo._longDateFormat=Go,Zo.longDateFormat=nn,Zo._invalidDate=$o,Zo.invalidDate=on,Zo._ordinal=Ko,Zo.ordinal=rn,Zo._ordinalParse=Xo,Zo.preparse=sn,Zo.postformat=sn,Zo._relativeTime=qo,Zo.relativeTime=an,Zo.pastFuture=ln,Zo.set=un,Zo.months=K,Zo._months=mo,Zo.monthsShort=X,Zo._monthsShort=vo,Zo.monthsParse=q,Zo.week=he,Zo._week=So,Zo.firstDayOfYear=pe,Zo.firstDayOfWeek=fe,Zo.weekdays=jt,Zo._weekdays=Po,Zo.weekdaysMin=Ft,Zo._weekdaysMin=Lo,Zo.weekdaysShort=Bt,Zo._weekdaysShort=No,Zo.weekdaysParse=Vt,Zo.isPM=Kt,Zo._meridiemParse=Wo,Zo.meridiem=Xt,S("en",{ordinalParse:/\d{1,2}(th|st|nd|rd)/,ordinal:function(e){var t=e%10,n=1===w(e%100/10)?"th":1===t?"st":2===t?"nd":3===t?"rd":"th";return e+n}}),e.lang=ne("moment.lang is deprecated. Use moment.locale instead.",S),e.langData=ne("moment.langData is deprecated. Use moment.localeData instead.",T);var Jo=Math.abs,Qo=On("ms"),er=On("s"),tr=On("m"),nr=On("h"),or=On("d"),rr=On("w"),ir=On("M"),sr=On("y"),ar=kn("milliseconds"),lr=kn("seconds"),ur=kn("minutes"),cr=kn("hours"),dr=kn("days"),hr=kn("months"),fr=kn("years"),pr=Math.round,gr={s:45,m:45,h:22,d:26,M:11},mr=Math.abs,vr=Ne.prototype;vr.abs=vn,vr.add=yn,vr.subtract=bn,vr.as=En,vr.asMilliseconds=Qo,vr.asSeconds=er,vr.asMinutes=tr,vr.asHours=nr,vr.asDays=or,vr.asWeeks=rr,vr.asMonths=ir,vr.asYears=sr,vr.valueOf=Tn,vr._bubble=Rn,vr.get=Mn,vr.milliseconds=ar,vr.seconds=lr,vr.minutes=ur,vr.hours=cr,vr.days=dr,vr.weeks=Hn,vr.months=hr,vr.years=fr,vr.humanize=Pn,vr.toISOString=Nn,vr.toString=Nn,vr.toJSON=Nn,vr.locale=yt,vr.localeData=bt,vr.toIsoString=ne("toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)",Nn),vr.lang=xo,N("X",0,0,"unix"),N("x",0,0,"valueOf"),F("x",no),F("X",ro),Y("X",function(e,t,n){n._d=new Date(1e3*parseFloat(e,10))}),Y("x",function(e,t,n){n._d=new Date(w(e))}),e.version="2.10.6",o(De),e.fn=Yo,e.min=Ae,e.max=Pe,e.utc=u,e.unix=Qt,e.months=hn,e.isDate=i,e.locale=S,e.invalid=f,e.duration=Je,e.isMoment=m,e.weekdays=pn,e.parseZone=en,e.localeData=T,e.isDuration=Le,e.monthsShort=fn,e.weekdaysMin=mn,e.defineLocale=E,e.weekdaysShort=gn,e.normalizeUnits=M,e.relativeTimeThreshold=An;var wr=e;return wr})},{}],numeral:[function(t,n,o){"use strict";(function(){function t(e){this._value=e}function o(e,t,n,o){var r,i,s=Math.pow(10,t);return i=(n(e*s)/s).toFixed(t),o&&(r=new RegExp("0{1,"+o+"}$"),i=i.replace(r,"")),i}function r(e,t,n){var o;return o=t.indexOf("$")>-1?s(e,t,n):t.indexOf("%")>-1?a(e,t,n):t.indexOf(":")>-1?l(e,t):c(e._value,t,n)}function i(e,t){var n,o,r,i,s,a=t,l=["KB","MB","GB","TB","PB","EB","ZB","YB"],c=!1;if(t.indexOf(":")>-1)e._value=u(t);else if(t===w)e._value=0;else{for("."!==m[v].delimiters.decimal&&(t=t.replace(/\./g,"").replace(m[v].delimiters.decimal,".")),n=new RegExp("[^a-zA-Z]"+m[v].abbreviations.thousand+"(?:\\)|(\\"+m[v].currency.symbol+")?(?:\\))?)?$"),o=new RegExp("[^a-zA-Z]"+m[v].abbreviations.million+"(?:\\)|(\\"+m[v].currency.symbol+")?(?:\\))?)?$"),r=new RegExp("[^a-zA-Z]"+m[v].abbreviations.billion+"(?:\\)|(\\"+m[v].currency.symbol+")?(?:\\))?)?$"),i=new RegExp("[^a-zA-Z]"+m[v].abbreviations.trillion+"(?:\\)|(\\"+m[v].currency.symbol+")?(?:\\))?)?$"),s=0;s<=l.length&&!(c=t.indexOf(l[s])>-1?Math.pow(1024,s+1):!1);s++);e._value=(c?c:1)*(a.match(n)?Math.pow(10,3):1)*(a.match(o)?Math.pow(10,6):1)*(a.match(r)?Math.pow(10,9):1)*(a.match(i)?Math.pow(10,12):1)*(t.indexOf("%")>-1?.01:1)*((t.split("-").length+Math.min(t.split("(").length-1,t.split(")").length-1))%2?1:-1)*Number(t.replace(/[^0-9\.]+/g,"")),e._value=c?Math.ceil(e._value):e._value}return e._value}function s(e,t,n){var o,r,i=t.indexOf("$"),s=t.indexOf("("),a=t.indexOf("-"),l="";return t.indexOf(" $")>-1?(l=" ",t=t.replace(" $","")):t.indexOf("$ ")>-1?(l=" ",t=t.replace("$ ","")):t=t.replace("$",""),r=c(e._value,t,n),1>=i?r.indexOf("(")>-1||r.indexOf("-")>-1?(r=r.split(""),o=1,(s>i||a>i)&&(o=0),r.splice(o,0,m[v].currency.symbol+l),r=r.join("")):r=m[v].currency.symbol+l+r:r.indexOf(")")>-1?(r=r.split(""),r.splice(-1,0,l+m[v].currency.symbol),r=r.join("")):r=r+l+m[v].currency.symbol,r}function a(e,t,n){var o,r="",i=100*e._value;return t.indexOf(" %")>-1?(r=" ",t=t.replace(" %","")):t=t.replace("%",""),o=c(i,t,n),o.indexOf(")")>-1?(o=o.split(""),o.splice(-1,0,r+"%"),o=o.join("")):o=o+r+"%",o}function l(e){var t=Math.floor(e._value/60/60),n=Math.floor((e._value-60*t*60)/60),o=Math.round(e._value-60*t*60-60*n);return t+":"+(10>n?"0"+n:n)+":"+(10>o?"0"+o:o)}function u(e){var t=e.split(":"),n=0;return 3===t.length?(n+=60*Number(t[0])*60,n+=60*Number(t[1]),n+=Number(t[2])):2===t.length&&(n+=60*Number(t[0]),n+=Number(t[1])),Number(n)}function c(e,t,n){var r,i,s,a,l,u,c=!1,d=!1,h=!1,f="",p=!1,g=!1,y=!1,b=!1,C=!1,R="",_="",S=Math.abs(e),E=["B","KB","MB","GB","TB","PB","EB","ZB","YB"],T="",O=!1;if(0===e&&null!==w)return w;if(t.indexOf("(")>-1?(c=!0,t=t.slice(1,-1)):t.indexOf("+")>-1&&(d=!0,t=t.replace(/\+/g,"")),t.indexOf("a")>-1&&(p=t.indexOf("aK")>=0,g=t.indexOf("aM")>=0,y=t.indexOf("aB")>=0,b=t.indexOf("aT")>=0,C=p||g||y||b,t.indexOf(" a")>-1?(f=" ",t=t.replace(" a","")):t=t.replace("a",""),S>=Math.pow(10,12)&&!C||b?(f+=m[v].abbreviations.trillion,e/=Math.pow(10,12)):S=Math.pow(10,9)&&!C||y?(f+=m[v].abbreviations.billion,e/=Math.pow(10,9)):S=Math.pow(10,6)&&!C||g?(f+=m[v].abbreviations.million,e/=Math.pow(10,6)):(S=Math.pow(10,3)&&!C||p)&&(f+=m[v].abbreviations.thousand,e/=Math.pow(10,3))),t.indexOf("b")>-1)for(t.indexOf(" b")>-1?(R=" ",t=t.replace(" b","")):t=t.replace("b",""),s=0;s<=E.length;s++)if(r=Math.pow(1024,s),i=Math.pow(1024,s+1),e>=r&&i>e){R+=E[s],r>0&&(e/=r);break}return t.indexOf("o")>-1&&(t.indexOf(" o")>-1?(_=" ",t=t.replace(" o","")):t=t.replace("o",""),_+=m[v].ordinal(e)),t.indexOf("[.]")>-1&&(h=!0,t=t.replace("[.]",".")),a=e.toString().split(".")[0],l=t.split(".")[1],u=t.indexOf(","),l?(l.indexOf("[")>-1?(l=l.replace("]",""),l=l.split("["),T=o(e,l[0].length+l[1].length,n,l[1].length)):T=o(e,l.length,n),a=T.split(".")[0],T=T.split(".")[1].length?m[v].delimiters.decimal+T.split(".")[1]:"",h&&0===Number(T.slice(1))&&(T="")):a=o(e,null,n),a.indexOf("-")>-1&&(a=a.slice(1),O=!0),u>-1&&(a=a.toString().replace(/(\d)(?=(\d{3})+(?!\d))/g,"$1"+m[v].delimiters.thousands)),0===t.indexOf(".")&&(a=""),(c&&O?"(":"")+(!c&&O?"-":"")+(!O&&d?"+":"")+a+T+(_?_:"")+(f?f:"")+(R?R:"")+(c&&O?")":"")}function d(e,t){m[e]=t}function h(e){var t=e.toString().split(".");return t.length<2?1:Math.pow(10,t[1].length)}function f(){var e=Array.prototype.slice.call(arguments);return e.reduce(function(e,t){var n=h(e),o=h(t);return n>o?n:o},-(1/0))}var p,g="1.5.3",m={},v="en",w=null,y="0,0",b="undefined"!=typeof n&&n.exports;p=function(e){return p.isNumeral(e)?e=e.value():0===e||"undefined"==typeof e?e=0:Number(e)||(e=p.fn.unformat(e)),new t(Number(e))},p.version=g,p.isNumeral=function(e){return e instanceof t},p.language=function(e,t){if(!e)return v;if(e&&!t){if(!m[e])throw new Error("Unknown language : "+e);v=e}return(t||!m[e])&&d(e,t),p},p.languageData=function(e){if(!e)return m[v];if(!m[e])throw new Error("Unknown language : "+e);return m[e]},p.language("en",{delimiters:{thousands:",",decimal:"."},abbreviations:{thousand:"k",million:"m",billion:"b",trillion:"t"},ordinal:function(e){var t=e%10;return 1===~~(e%100/10)?"th":1===t?"st":2===t?"nd":3===t?"rd":"th"},currency:{symbol:"$"}}),p.zeroFormat=function(e){w="string"==typeof e?e:null},p.defaultFormat=function(e){y="string"==typeof e?e:"0.0"},p.validate=function(e,t){var n,o,r,i,s,a,l,u;if("string"!=typeof e&&(e+="",console.warn&&console.warn("Numeral.js: Value is not string. It has been co-erced to: ",e)),e=e.trim(),""===e)return!1;e=e.replace(/^[+-]?/,"");try{l=p.languageData(t)}catch(c){l=p.languageData(p.language())}return r=l.currency.symbol,s=l.abbreviations,n=l.delimiters.decimal,o="."===l.delimiters.thousands?"\\.":l.delimiters.thousands,u=e.match(/^[^\d\.\,]+/),null!==u&&(e=e.substr(1),u[0]!==r)?!1:(u=e.match(/[^\d]+$/),null!==u&&(e=e.slice(0,-1),u[0]!==s.thousand&&u[0]!==s.million&&u[0]!==s.billion&&u[0]!==s.trillion)?!1:e.match(/^\d+$/)?!0:(a=new RegExp(o+"{2}"),e.match(/[^\d.,]/g)?!1:(i=e.split(n),i.length>2?!1:i.length<2?!!i[0].match(/^\d+.*\d$/)&&!i[0].match(a):""===i[0]?!i[0].match(a)&&!!i[1].match(/^\d+$/):1===i[0].length?!!i[0].match(/^\d+$/)&&!i[0].match(a)&&!!i[1].match(/^\d+$/):!!i[0].match(/^\d+.*\d$/)&&!i[0].match(a)&&!!i[1].match(/^\d+$/))))},"function"!=typeof Array.prototype.reduce&&(Array.prototype.reduce=function(e,t){if(null===this||"undefined"==typeof this)throw new TypeError("Array.prototype.reduce called on null or undefined");if("function"!=typeof e)throw new TypeError(e+" is not a function");var n,o,r=this.length>>>0,i=!1;for(1n;++n)this.hasOwnProperty(n)&&(i?o=e(o,this[n],n,this):(o=this[n],i=!0));if(!i)throw new TypeError("Reduce of empty array with no initial value");return o}),p.fn=t.prototype={clone:function(){return p(this)},format:function(e,t){return r(this,e?e:y,void 0!==t?t:Math.round)},unformat:function(e){return"[object Number]"===Object.prototype.toString.call(e)?e:i(this,e?e:y)},value:function(){return this._value},valueOf:function(){return this._value},set:function(e){return this._value=Number(e),this},add:function(e){function t(e,t,o,r){return e+n*t}var n=f.call(null,this._value,e);return this._value=[this._value,e].reduce(t,0)/n,this},subtract:function(e){function t(e,t,o,r){return e-n*t}var n=f.call(null,this._value,e);return this._value=[e].reduce(t,this._value*n)/n,this},multiply:function(e){function t(e,t,n,o){var r=f(e,t);return e*r*(t*r)/(r*r)}return this._value=[this._value,e].reduce(t,1),this},divide:function(e){function t(e,t,n,o){var r=f(e,t);return e*r/(t*r)}return this._value=[this._value,e].reduce(t),this},difference:function(e){return Math.abs(p(this._value).subtract(e).value())}},b&&(n.exports=p),"undefined"==typeof ender&&(this.numeral=p),"function"==typeof e&&e.amd&&e([],function(){return p})}).call(window)},{}],pikaday:[function(t,n,o){/*! +!function(t,r){"object"==typeof o&&"undefined"!=typeof n?n.exports=r():"function"==typeof e&&e.amd?e(r):t.moment=r()}(this,function(){"use strict";function e(){return Ln.apply(null,arguments)}function o(e){Ln=e}function r(e){return"[object Array]"===Object.prototype.toString.call(e)}function i(e){return e instanceof Date||"[object Date]"===Object.prototype.toString.call(e)}function s(e,t){var n,o=[];for(n=0;n0)for(n in In)o=In[n],r=t[o],"undefined"!=typeof r&&(e[o]=r);return e}function g(t){p(this,t),this._d=new Date(null!=t._d?t._d.getTime():NaN),jn===!1&&(jn=!0,e.updateOffset(this),jn=!1)}function m(e){return e instanceof g||null!=e&&null!=e._isAMomentObject}function v(e){return 0>e?Math.ceil(e):Math.floor(e)}function w(e){var t=+e,n=0;return 0!==t&&isFinite(t)&&(n=v(t)),n}function y(e,t,n){var o,r=Math.min(e.length,t.length),i=Math.abs(e.length-t.length),s=0;for(o=0;r>o;o++)(n&&e[o]!==t[o]||!n&&w(e[o])!==w(t[o]))&&s++;return s+i}function b(){}function C(e){return e?e.toLowerCase().replace("_","-"):e}function R(e){for(var t,n,o,r,i=0;i0;){if(o=_(r.slice(0,t).join("-")))return o;if(n&&n.length>=t&&y(r,n,!0)>=t-1)break;t--}i++}return null}function _(e){var o=null;if(!Bn[e]&&"undefined"!=typeof n&&n&&n.exports)try{o=Wn._abbr,t("./locale/"+e),S(o)}catch(r){}return Bn[e]}function S(e,t){var n;return e&&(n="undefined"==typeof t?T(e):E(e,t),n&&(Wn=n)),Wn._abbr}function E(e,t){return null!==t?(t.abbr=e,Bn[e]=Bn[e]||new b,Bn[e].set(t),S(e),Bn[e]):(delete Bn[e],null)}function T(e){var t;if(e&&e._locale&&e._locale._abbr&&(e=e._locale._abbr),!e)return Wn;if(!r(e)){if(t=_(e))return t;e=[e]}return R(e)}function O(e,t){var n=e.toLowerCase();Fn[n]=Fn[n+"s"]=Fn[t]=e}function M(e){return"string"==typeof e?Fn[e]||Fn[e.toLowerCase()]:void 0}function k(e){var t,n,o={};for(n in e)a(e,n)&&(t=M(n),t&&(o[t]=e[n]));return o}function H(t,n){return function(o){return null!=o?(A(this,t,o),e.updateOffset(this,n),this):D(this,t)}}function D(e,t){return e._d["get"+(e._isUTC?"UTC":"")+t]()}function A(e,t,n){return e._d["set"+(e._isUTC?"UTC":"")+t](n)}function x(e,t){var n;if("object"==typeof e)for(n in e)this.set(n,e[n]);else if(e=M(e),"function"==typeof this[e])return this[e](t);return this}function P(e,t,n){var o=""+Math.abs(e),r=t-o.length,i=e>=0;return(i?n?"+":"":"-")+Math.pow(10,Math.max(0,r)).toString().substr(1)+o}function N(e,t,n,o){var r=o;"string"==typeof o&&(r=function(){return this[o]()}),e&&(Un[e]=r),t&&(Un[t[0]]=function(){return P(r.apply(this,arguments),t[1],t[2])}),n&&(Un[n]=function(){return this.localeData().ordinal(r.apply(this,arguments),e)})}function L(e){return e.match(/\[[\s\S]/)?e.replace(/^\[|\]$/g,""):e.replace(/\\/g,"")}function W(e){var t,n,o=e.match(Vn);for(t=0,n=o.length;n>t;t++)Un[o[t]]?o[t]=Un[o[t]]:o[t]=L(o[t]);return function(r){var i="";for(t=0;n>t;t++)i+=o[t]instanceof Function?o[t].call(r,e):o[t];return i}}function I(e,t){return e.isValid()?(t=j(t,e.localeData()),Yn[t]=Yn[t]||W(t),Yn[t](e)):e.localeData().invalidDate()}function j(e,t){function n(e){return t.longDateFormat(e)||e}var o=5;for(zn.lastIndex=0;o>=0&&zn.test(e);)e=e.replace(zn,n),zn.lastIndex=0,o-=1;return e}function B(e){return"function"==typeof e&&"[object Function]"===Object.prototype.toString.call(e)}function F(e,t,n){so[e]=B(t)?t:function(e){return e&&n?n:t}}function V(e,t){return a(so,e)?so[e](t._strict,t._locale):new RegExp(z(e))}function z(e){return e.replace("\\","").replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g,function(e,t,n,o,r){return t||n||o||r}).replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}function Y(e,t){var n,o=t;for("string"==typeof e&&(e=[e]),"number"==typeof t&&(o=function(e,n){n[t]=w(e)}),n=0;no;o++){if(r=u([2e3,o]),n&&!this._longMonthsParse[o]&&(this._longMonthsParse[o]=new RegExp("^"+this.months(r,"").replace(".","")+"$","i"),this._shortMonthsParse[o]=new RegExp("^"+this.monthsShort(r,"").replace(".","")+"$","i")),n||this._monthsParse[o]||(i="^"+this.months(r,"")+"|^"+this.monthsShort(r,""),this._monthsParse[o]=new RegExp(i.replace(".",""),"i")),n&&"MMMM"===t&&this._longMonthsParse[o].test(e))return o;if(n&&"MMM"===t&&this._shortMonthsParse[o].test(e))return o;if(!n&&this._monthsParse[o].test(e))return o}}function Z(e,t){var n;return"string"==typeof t&&(t=e.localeData().monthsParse(t),"number"!=typeof t)?e:(n=Math.min(e.date(),$(e.year(),t)),e._d["set"+(e._isUTC?"UTC":"")+"Month"](t,n),e)}function J(t){return null!=t?(Z(this,t),e.updateOffset(this,!0),this):D(this,"Month")}function Q(){return $(this.year(),this.month())}function ee(e){var t,n=e._a;return n&&-2===d(e).overflow&&(t=n[uo]<0||n[uo]>11?uo:n[co]<1||n[co]>$(n[lo],n[uo])?co:n[ho]<0||n[ho]>24||24===n[ho]&&(0!==n[fo]||0!==n[po]||0!==n[go])?ho:n[fo]<0||n[fo]>59?fo:n[po]<0||n[po]>59?po:n[go]<0||n[go]>999?go:-1,d(e)._overflowDayOfYear&&(lo>t||t>co)&&(t=co),d(e).overflow=t),e}function te(t){e.suppressDeprecationWarnings===!1&&"undefined"!=typeof console&&console.warn&&console.warn("Deprecation warning: "+t)}function ne(e,t){var n=!0;return l(function(){return n&&(te(e+"\n"+(new Error).stack),n=!1),t.apply(this,arguments)},t)}function oe(e,t){wo[e]||(te(t),wo[e]=!0)}function re(e){var t,n,o=e._i,r=yo.exec(o);if(r){for(d(e).iso=!0,t=0,n=bo.length;n>t;t++)if(bo[t][1].exec(o)){e._f=bo[t][0];break}for(t=0,n=Co.length;n>t;t++)if(Co[t][1].exec(o)){e._f+=(r[6]||" ")+Co[t][0];break}o.match(oo)&&(e._f+="Z"),_e(e)}else e._isValid=!1}function ie(t){var n=Ro.exec(t._i);return null!==n?void(t._d=new Date(+n[1])):(re(t),void(t._isValid===!1&&(delete t._isValid,e.createFromInputFallback(t))))}function se(e,t,n,o,r,i,s){var a=new Date(e,t,n,o,r,i,s);return 1970>e&&a.setFullYear(e),a}function ae(e){var t=new Date(Date.UTC.apply(null,arguments));return 1970>e&&t.setUTCFullYear(e),t}function le(e){return ue(e)?366:365}function ue(e){return e%4===0&&e%100!==0||e%400===0}function ce(){return ue(this.year())}function de(e,t,n){var o,r=n-t,i=n-e.day();return i>r&&(i-=7),r-7>i&&(i+=7),o=De(e).add(i,"d"),{week:Math.ceil(o.dayOfYear()/7),year:o.year()}}function he(e){return de(e,this._week.dow,this._week.doy).week}function fe(){return this._week.dow}function pe(){return this._week.doy}function ge(e){var t=this.localeData().week(this);return null==e?t:this.add(7*(e-t),"d")}function me(e){var t=de(this,1,4).week;return null==e?t:this.add(7*(e-t),"d")}function ve(e,t,n,o,r){var i,s=6+r-o,a=ae(e,0,1+s),l=a.getUTCDay();return r>l&&(l+=7),n=null!=n?1*n:r,i=1+s+7*(t-1)-l+n,{year:i>0?e:e-1,dayOfYear:i>0?i:le(e-1)+i}}function we(e){var t=Math.round((this.clone().startOf("day")-this.clone().startOf("year"))/864e5)+1;return null==e?t:this.add(e-t,"d")}function ye(e,t,n){return null!=e?e:null!=t?t:n}function be(e){var t=new Date;return e._useUTC?[t.getUTCFullYear(),t.getUTCMonth(),t.getUTCDate()]:[t.getFullYear(),t.getMonth(),t.getDate()]}function Ce(e){var t,n,o,r,i=[];if(!e._d){for(o=be(e),e._w&&null==e._a[co]&&null==e._a[uo]&&Re(e),e._dayOfYear&&(r=ye(e._a[lo],o[lo]),e._dayOfYear>le(r)&&(d(e)._overflowDayOfYear=!0),n=ae(r,0,e._dayOfYear),e._a[uo]=n.getUTCMonth(),e._a[co]=n.getUTCDate()),t=0;3>t&&null==e._a[t];++t)e._a[t]=i[t]=o[t];for(;7>t;t++)e._a[t]=i[t]=null==e._a[t]?2===t?1:0:e._a[t];24===e._a[ho]&&0===e._a[fo]&&0===e._a[po]&&0===e._a[go]&&(e._nextDay=!0,e._a[ho]=0),e._d=(e._useUTC?ae:se).apply(null,i),null!=e._tzm&&e._d.setUTCMinutes(e._d.getUTCMinutes()-e._tzm),e._nextDay&&(e._a[ho]=24)}}function Re(e){var t,n,o,r,i,s,a;t=e._w,null!=t.GG||null!=t.W||null!=t.E?(i=1,s=4,n=ye(t.GG,e._a[lo],de(De(),1,4).year),o=ye(t.W,1),r=ye(t.E,1)):(i=e._locale._week.dow,s=e._locale._week.doy,n=ye(t.gg,e._a[lo],de(De(),i,s).year),o=ye(t.w,1),null!=t.d?(r=t.d,i>r&&++o):r=null!=t.e?t.e+i:i),a=ve(n,o,r,s,i),e._a[lo]=a.year,e._dayOfYear=a.dayOfYear}function _e(t){if(t._f===e.ISO_8601)return void re(t);t._a=[],d(t).empty=!0;var n,o,r,i,s,a=""+t._i,l=a.length,u=0;for(r=j(t._f,t._locale).match(Vn)||[],n=0;n0&&d(t).unusedInput.push(s),a=a.slice(a.indexOf(o)+o.length),u+=o.length),Un[i]?(o?d(t).empty=!1:d(t).unusedTokens.push(i),G(i,o,t)):t._strict&&!o&&d(t).unusedTokens.push(i);d(t).charsLeftOver=l-u,a.length>0&&d(t).unusedInput.push(a),d(t).bigHour===!0&&t._a[ho]<=12&&t._a[ho]>0&&(d(t).bigHour=void 0),t._a[ho]=Se(t._locale,t._a[ho],t._meridiem),Ce(t),ee(t)}function Se(e,t,n){var o;return null==n?t:null!=e.meridiemHour?e.meridiemHour(t,n):null!=e.isPM?(o=e.isPM(n),o&&12>t&&(t+=12),o||12!==t||(t=0),t):t}function Ee(e){var t,n,o,r,i;if(0===e._f.length)return d(e).invalidFormat=!0,void(e._d=new Date(NaN));for(r=0;ri)&&(o=i,n=t));l(e,n||t)}function Te(e){if(!e._d){var t=k(e._i);e._a=[t.year,t.month,t.day||t.date,t.hour,t.minute,t.second,t.millisecond],Ce(e)}}function Oe(e){var t=new g(ee(Me(e)));return t._nextDay&&(t.add(1,"d"),t._nextDay=void 0),t}function Me(e){var t=e._i,n=e._f;return e._locale=e._locale||T(e._l),null===t||void 0===n&&""===t?f({nullInput:!0}):("string"==typeof t&&(e._i=t=e._locale.preparse(t)),m(t)?new g(ee(t)):(r(n)?Ee(e):n?_e(e):i(t)?e._d=t:ke(e),e))}function ke(t){var n=t._i;void 0===n?t._d=new Date:i(n)?t._d=new Date(+n):"string"==typeof n?ie(t):r(n)?(t._a=s(n.slice(0),function(e){return parseInt(e,10)}),Ce(t)):"object"==typeof n?Te(t):"number"==typeof n?t._d=new Date(n):e.createFromInputFallback(t)}function He(e,t,n,o,r){var i={};return"boolean"==typeof n&&(o=n,n=void 0),i._isAMomentObject=!0,i._useUTC=i._isUTC=r,i._l=n,i._i=e,i._f=t,i._strict=o,Oe(i)}function De(e,t,n,o){return He(e,t,n,o,!1)}function Ae(e,t){var n,o;if(1===t.length&&r(t[0])&&(t=t[0]),!t.length)return De();for(n=t[0],o=1;oe&&(e=-e,n="-"),n+P(~~(e/60),2)+t+P(~~e%60,2)})}function Ie(e){var t=(e||"").match(oo)||[],n=t[t.length-1]||[],o=(n+"").match(Oo)||["-",0,0],r=+(60*o[1])+w(o[2]);return"+"===o[0]?r:-r}function je(t,n){var o,r;return n._isUTC?(o=n.clone(),r=(m(t)||i(t)?+t:+De(t))-+o,o._d.setTime(+o._d+r),e.updateOffset(o,!1),o):De(t).local()}function Be(e){return 15*-Math.round(e._d.getTimezoneOffset()/15)}function Fe(t,n){var o,r=this._offset||0;return null!=t?("string"==typeof t&&(t=Ie(t)),Math.abs(t)<16&&(t=60*t),!this._isUTC&&n&&(o=Be(this)),this._offset=t,this._isUTC=!0,null!=o&&this.add(o,"m"),r!==t&&(!n||this._changeInProgress?ot(this,Je(t-r,"m"),1,!1):this._changeInProgress||(this._changeInProgress=!0,e.updateOffset(this,!0),this._changeInProgress=null)),this):this._isUTC?r:Be(this)}function Ve(e,t){return null!=e?("string"!=typeof e&&(e=-e),this.utcOffset(e,t),this):-this.utcOffset()}function ze(e){return this.utcOffset(0,e)}function Ye(e){return this._isUTC&&(this.utcOffset(0,e),this._isUTC=!1,e&&this.subtract(Be(this),"m")),this}function Ue(){return this._tzm?this.utcOffset(this._tzm):"string"==typeof this._i&&this.utcOffset(Ie(this._i)),this}function Ge(e){return e=e?De(e).utcOffset():0,(this.utcOffset()-e)%60===0}function $e(){return this.utcOffset()>this.clone().month(0).utcOffset()||this.utcOffset()>this.clone().month(5).utcOffset()}function Ke(){if("undefined"!=typeof this._isDSTShifted)return this._isDSTShifted;var e={};if(p(e,this),e=Me(e),e._a){var t=e._isUTC?u(e._a):De(e._a);this._isDSTShifted=this.isValid()&&y(e._a,t.toArray())>0}else this._isDSTShifted=!1;return this._isDSTShifted}function Xe(){return!this._isUTC}function qe(){return this._isUTC}function Ze(){return this._isUTC&&0===this._offset}function Je(e,t){var n,o,r,i=e,s=null;return Le(e)?i={ms:e._milliseconds,d:e._days,M:e._months}:"number"==typeof e?(i={},t?i[t]=e:i.milliseconds=e):(s=Mo.exec(e))?(n="-"===s[1]?-1:1,i={y:0,d:w(s[co])*n,h:w(s[ho])*n,m:w(s[fo])*n,s:w(s[po])*n,ms:w(s[go])*n}):(s=ko.exec(e))?(n="-"===s[1]?-1:1,i={y:Qe(s[2],n),M:Qe(s[3],n),d:Qe(s[4],n),h:Qe(s[5],n),m:Qe(s[6],n),s:Qe(s[7],n),w:Qe(s[8],n)}):null==i?i={}:"object"==typeof i&&("from"in i||"to"in i)&&(r=tt(De(i.from),De(i.to)),i={},i.ms=r.milliseconds,i.M=r.months),o=new Ne(i),Le(e)&&a(e,"_locale")&&(o._locale=e._locale),o}function Qe(e,t){var n=e&&parseFloat(e.replace(",","."));return(isNaN(n)?0:n)*t}function et(e,t){var n={milliseconds:0,months:0};return n.months=t.month()-e.month()+12*(t.year()-e.year()),e.clone().add(n.months,"M").isAfter(t)&&--n.months,n.milliseconds=+t-+e.clone().add(n.months,"M"),n}function tt(e,t){var n;return t=je(t,e),e.isBefore(t)?n=et(e,t):(n=et(t,e),n.milliseconds=-n.milliseconds,n.months=-n.months),n}function nt(e,t){return function(n,o){var r,i;return null===o||isNaN(+o)||(oe(t,"moment()."+t+"(period, number) is deprecated. Please use moment()."+t+"(number, period)."),i=n,n=o,o=i),n="string"==typeof n?+n:n,r=Je(n,o),ot(this,r,e),this}}function ot(t,n,o,r){var i=n._milliseconds,s=n._days,a=n._months;r=null==r?!0:r,i&&t._d.setTime(+t._d+i*o),s&&A(t,"Date",D(t,"Date")+s*o),a&&Z(t,D(t,"Month")+a*o),r&&e.updateOffset(t,s||a)}function rt(e,t){var n=e||De(),o=je(n,this).startOf("day"),r=this.diff(o,"days",!0),i=-6>r?"sameElse":-1>r?"lastWeek":0>r?"lastDay":1>r?"sameDay":2>r?"nextDay":7>r?"nextWeek":"sameElse";return this.format(t&&t[i]||this.localeData().calendar(i,this,De(n)))}function it(){return new g(this)}function st(e,t){var n;return t=M("undefined"!=typeof t?t:"millisecond"),"millisecond"===t?(e=m(e)?e:De(e),+this>+e):(n=m(e)?+e:+De(e),n<+this.clone().startOf(t))}function at(e,t){var n;return t=M("undefined"!=typeof t?t:"millisecond"),"millisecond"===t?(e=m(e)?e:De(e),+e>+this):(n=m(e)?+e:+De(e),+this.clone().endOf(t)t-i?(n=e.clone().add(r-1,"months"),o=(t-i)/(i-n)):(n=e.clone().add(r+1,"months"),o=(t-i)/(n-i)),-(r+o)}function ht(){return this.clone().locale("en").format("ddd MMM DD YYYY HH:mm:ss [GMT]ZZ")}function ft(){var e=this.clone().utc();return 0t;t++)if(this._weekdaysParse[t]||(n=De([2e3,1]).day(t),o="^"+this.weekdays(n,"")+"|^"+this.weekdaysShort(n,"")+"|^"+this.weekdaysMin(n,""),this._weekdaysParse[t]=new RegExp(o.replace(".",""),"i")),this._weekdaysParse[t].test(e))return t}function zt(e){var t=this._isUTC?this._d.getUTCDay():this._d.getDay();return null!=e?(e=It(e,this.localeData()),this.add(e-t,"d")):t}function Yt(e){var t=(this.day()+7-this.localeData()._week.dow)%7;return null==e?t:this.add(e-t,"d")}function Ut(e){return null==e?this.day()||7:this.day(this.day()%7?e:e-7)}function Gt(e,t){N(e,0,0,function(){return this.localeData().meridiem(this.hours(),this.minutes(),t)})}function $t(e,t){return t._meridiemParse}function Kt(e){return"p"===(e+"").toLowerCase().charAt(0)}function Xt(e,t,n){return e>11?n?"pm":"PM":n?"am":"AM"}function qt(e,t){t[go]=w(1e3*("0."+e))}function Zt(){return this._isUTC?"UTC":""}function Jt(){return this._isUTC?"Coordinated Universal Time":""}function Qt(e){return De(1e3*e)}function en(){return De.apply(null,arguments).parseZone()}function tn(e,t,n){var o=this._calendar[e];return"function"==typeof o?o.call(t,n):o}function nn(e){var t=this._longDateFormat[e],n=this._longDateFormat[e.toUpperCase()];return t||!n?t:(this._longDateFormat[e]=n.replace(/MMMM|MM|DD|dddd/g,function(e){return e.slice(1)}),this._longDateFormat[e])}function on(){return this._invalidDate}function rn(e){return this._ordinal.replace("%d",e)}function sn(e){return e}function an(e,t,n,o){var r=this._relativeTime[n];return"function"==typeof r?r(e,t,n,o):r.replace(/%d/i,e)}function ln(e,t){var n=this._relativeTime[e>0?"future":"past"];return"function"==typeof n?n(t):n.replace(/%s/i,t)}function un(e){var t,n;for(n in e)t=e[n],"function"==typeof t?this[n]=t:this["_"+n]=t;this._ordinalParseLenient=new RegExp(this._ordinalParse.source+"|"+/\d{1,2}/.source)}function cn(e,t,n,o){var r=T(),i=u().set(o,t);return r[n](i,e)}function dn(e,t,n,o,r){if("number"==typeof e&&(t=e,e=void 0),e=e||"",null!=t)return cn(e,t,n,r);var i,s=[];for(i=0;o>i;i++)s[i]=cn(e,i,n,r);return s}function hn(e,t){return dn(e,t,"months",12,"month")}function fn(e,t){return dn(e,t,"monthsShort",12,"month")}function pn(e,t){return dn(e,t,"weekdays",7,"day")}function gn(e,t){return dn(e,t,"weekdaysShort",7,"day")}function mn(e,t){return dn(e,t,"weekdaysMin",7,"day")}function vn(){var e=this._data;return this._milliseconds=Jo(this._milliseconds),this._days=Jo(this._days),this._months=Jo(this._months),e.milliseconds=Jo(e.milliseconds),e.seconds=Jo(e.seconds),e.minutes=Jo(e.minutes),e.hours=Jo(e.hours),e.months=Jo(e.months),e.years=Jo(e.years),this}function wn(e,t,n,o){var r=Je(t,n);return e._milliseconds+=o*r._milliseconds,e._days+=o*r._days,e._months+=o*r._months,e._bubble()}function yn(e,t){return wn(this,e,t,1)}function bn(e,t){return wn(this,e,t,-1)}function Cn(e){return 0>e?Math.floor(e):Math.ceil(e)}function Rn(){var e,t,n,o,r,i=this._milliseconds,s=this._days,a=this._months,l=this._data;return i>=0&&s>=0&&a>=0||0>=i&&0>=s&&0>=a||(i+=864e5*Cn(Sn(a)+s),s=0,a=0),l.milliseconds=i%1e3,e=v(i/1e3),l.seconds=e%60,t=v(e/60),l.minutes=t%60,n=v(t/60),l.hours=n%24,s+=v(n/24),r=v(_n(s)),a+=r,s-=Cn(Sn(r)),o=v(a/12),a%=12,l.days=s,l.months=a,l.years=o,this}function _n(e){return 4800*e/146097}function Sn(e){return 146097*e/4800}function En(e){var t,n,o=this._milliseconds;if(e=M(e),"month"===e||"year"===e)return t=this._days+o/864e5,n=this._months+_n(t),"month"===e?n:n/12;switch(t=this._days+Math.round(Sn(this._months)),e){case"week":return t/7+o/6048e5;case"day":return t+o/864e5;case"hour":return 24*t+o/36e5;case"minute":return 1440*t+o/6e4;case"second":return 86400*t+o/1e3;case"millisecond":return Math.floor(864e5*t)+o;default:throw new Error("Unknown unit "+e)}}function Tn(){return this._milliseconds+864e5*this._days+this._months%12*2592e6+31536e6*w(this._months/12)}function On(e){return function(){return this.as(e)}}function Mn(e){return e=M(e),this[e+"s"]()}function kn(e){return function(){return this._data[e]}}function Hn(){return v(this.days()/7)}function Dn(e,t,n,o,r){return r.relativeTime(t||1,!!n,e,o)}function An(e,t,n){var o=Je(e).abs(),r=pr(o.as("s")),i=pr(o.as("m")),s=pr(o.as("h")),a=pr(o.as("d")),l=pr(o.as("M")),u=pr(o.as("y")),c=r0,c[4]=n,Dn.apply(null,c)}function xn(e,t){return void 0===gr[e]?!1:void 0===t?gr[e]:(gr[e]=t,!0)}function Pn(e){var t=this.localeData(),n=An(this,!e,t);return e&&(n=t.pastFuture(+this,n)),t.postformat(n)}function Nn(){var e,t,n,o=mr(this._milliseconds)/1e3,r=mr(this._days),i=mr(this._months);e=v(o/60),t=v(e/60),o%=60,e%=60,n=v(i/12),i%=12;var s=n,a=i,l=r,u=t,c=e,d=o,h=this.asSeconds();return h?(0>h?"-":"")+"P"+(s?s+"Y":"")+(a?a+"M":"")+(l?l+"D":"")+(u||c||d?"T":"")+(u?u+"H":"")+(c?c+"M":"")+(d?d+"S":""):"P0D"}var Ln,Wn,In=e.momentProperties=[],jn=!1,Bn={},Fn={},Vn=/(\[[^\[]*\])|(\\)?(Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Q|YYYYYY|YYYYY|YYYY|YY|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g,zn=/(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,Yn={},Un={},Gn=/\d/,$n=/\d\d/,Kn=/\d{3}/,Xn=/\d{4}/,qn=/[+-]?\d{6}/,Zn=/\d\d?/,Jn=/\d{1,3}/,Qn=/\d{1,4}/,eo=/[+-]?\d{1,6}/,to=/\d+/,no=/[+-]?\d+/,oo=/Z|[+-]\d\d:?\d\d/gi,ro=/[+-]?\d+(\.\d{1,3})?/,io=/[0-9]*['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+|[\u0600-\u06FF\/]+(\s*?[\u0600-\u06FF]+){1,2}/i,so={},ao={},lo=0,uo=1,co=2,ho=3,fo=4,po=5,go=6;N("M",["MM",2],"Mo",function(){return this.month()+1}),N("MMM",0,0,function(e){return this.localeData().monthsShort(this,e)}),N("MMMM",0,0,function(e){return this.localeData().months(this,e)}),O("month","M"),F("M",Zn),F("MM",Zn,$n),F("MMM",io),F("MMMM",io),Y(["M","MM"],function(e,t){t[uo]=w(e)-1}),Y(["MMM","MMMM"],function(e,t,n,o){var r=n._locale.monthsParse(e,o,n._strict);null!=r?t[uo]=r:d(n).invalidMonth=e});var mo="January_February_March_April_May_June_July_August_September_October_November_December".split("_"),vo="Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),wo={};e.suppressDeprecationWarnings=!1;var yo=/^\s*(?:[+-]\d{6}|\d{4})-(?:(\d\d-\d\d)|(W\d\d$)|(W\d\d-\d)|(\d\d\d))((T| )(\d\d(:\d\d(:\d\d(\.\d+)?)?)?)?([\+\-]\d\d(?::?\d\d)?|\s*Z)?)?$/,bo=[["YYYYYY-MM-DD",/[+-]\d{6}-\d{2}-\d{2}/],["YYYY-MM-DD",/\d{4}-\d{2}-\d{2}/],["GGGG-[W]WW-E",/\d{4}-W\d{2}-\d/],["GGGG-[W]WW",/\d{4}-W\d{2}/],["YYYY-DDD",/\d{4}-\d{3}/]],Co=[["HH:mm:ss.SSSS",/(T| )\d\d:\d\d:\d\d\.\d+/],["HH:mm:ss",/(T| )\d\d:\d\d:\d\d/],["HH:mm",/(T| )\d\d:\d\d/],["HH",/(T| )\d\d/]],Ro=/^\/?Date\((\-?\d+)/i;e.createFromInputFallback=ne("moment construction falls back to js Date. This is discouraged and will be removed in upcoming major release. Please refer to https://github.com/moment/moment/issues/1407 for more info.",function(e){e._d=new Date(e._i+(e._useUTC?" UTC":""))}),N(0,["YY",2],0,function(){return this.year()%100}),N(0,["YYYY",4],0,"year"),N(0,["YYYYY",5],0,"year"),N(0,["YYYYYY",6,!0],0,"year"),O("year","y"),F("Y",no),F("YY",Zn,$n),F("YYYY",Qn,Xn),F("YYYYY",eo,qn),F("YYYYYY",eo,qn),Y(["YYYYY","YYYYYY"],lo),Y("YYYY",function(t,n){n[lo]=2===t.length?e.parseTwoDigitYear(t):w(t)}),Y("YY",function(t,n){n[lo]=e.parseTwoDigitYear(t)}),e.parseTwoDigitYear=function(e){return w(e)+(w(e)>68?1900:2e3)};var _o=H("FullYear",!1);N("w",["ww",2],"wo","week"),N("W",["WW",2],"Wo","isoWeek"),O("week","w"),O("isoWeek","W"),F("w",Zn),F("ww",Zn,$n),F("W",Zn),F("WW",Zn,$n),U(["w","ww","W","WW"],function(e,t,n,o){t[o.substr(0,1)]=w(e)});var So={dow:0,doy:6};N("DDD",["DDDD",3],"DDDo","dayOfYear"),O("dayOfYear","DDD"),F("DDD",Jn),F("DDDD",Kn),Y(["DDD","DDDD"],function(e,t,n){n._dayOfYear=w(e)}),e.ISO_8601=function(){};var Eo=ne("moment().min is deprecated, use moment.min instead. https://github.com/moment/moment/issues/1548",function(){var e=De.apply(null,arguments);return this>e?this:e}),To=ne("moment().max is deprecated, use moment.max instead. https://github.com/moment/moment/issues/1548",function(){var e=De.apply(null,arguments);return e>this?this:e});We("Z",":"),We("ZZ",""),F("Z",oo),F("ZZ",oo),Y(["Z","ZZ"],function(e,t,n){n._useUTC=!0,n._tzm=Ie(e)});var Oo=/([\+\-]|\d\d)/gi;e.updateOffset=function(){};var Mo=/(\-)?(?:(\d*)\.)?(\d+)\:(\d+)(?:\:(\d+)\.?(\d{3})?)?/,ko=/^(-)?P(?:(?:([0-9,.]*)Y)?(?:([0-9,.]*)M)?(?:([0-9,.]*)D)?(?:T(?:([0-9,.]*)H)?(?:([0-9,.]*)M)?(?:([0-9,.]*)S)?)?|([0-9,.]*)W)$/;Je.fn=Ne.prototype;var Ho=nt(1,"add"),Do=nt(-1,"subtract");e.defaultFormat="YYYY-MM-DDTHH:mm:ssZ";var Ao=ne("moment().lang() is deprecated. Instead, use moment().localeData() to get the language configuration. Use moment().locale() to change languages.",function(e){return void 0===e?this.localeData():this.locale(e)});N(0,["gg",2],0,function(){return this.weekYear()%100}),N(0,["GG",2],0,function(){return this.isoWeekYear()%100}),Dt("gggg","weekYear"),Dt("ggggg","weekYear"),Dt("GGGG","isoWeekYear"),Dt("GGGGG","isoWeekYear"),O("weekYear","gg"),O("isoWeekYear","GG"),F("G",no),F("g",no),F("GG",Zn,$n),F("gg",Zn,$n),F("GGGG",Qn,Xn),F("gggg",Qn,Xn),F("GGGGG",eo,qn),F("ggggg",eo,qn),U(["gggg","ggggg","GGGG","GGGGG"],function(e,t,n,o){t[o.substr(0,2)]=w(e)}),U(["gg","GG"],function(t,n,o,r){n[r]=e.parseTwoDigitYear(t)}),N("Q",0,0,"quarter"),O("quarter","Q"),F("Q",Gn),Y("Q",function(e,t){t[uo]=3*(w(e)-1)}),N("D",["DD",2],"Do","date"),O("date","D"),F("D",Zn),F("DD",Zn,$n),F("Do",function(e,t){return e?t._ordinalParse:t._ordinalParseLenient}),Y(["D","DD"],co),Y("Do",function(e,t){t[co]=w(e.match(Zn)[0],10)});var xo=H("Date",!0);N("d",0,"do","day"),N("dd",0,0,function(e){return this.localeData().weekdaysMin(this,e)}),N("ddd",0,0,function(e){return this.localeData().weekdaysShort(this,e)}),N("dddd",0,0,function(e){return this.localeData().weekdays(this,e)}),N("e",0,0,"weekday"),N("E",0,0,"isoWeekday"),O("day","d"),O("weekday","e"),O("isoWeekday","E"),F("d",Zn),F("e",Zn),F("E",Zn),F("dd",io),F("ddd",io),F("dddd",io),U(["dd","ddd","dddd"],function(e,t,n){var o=n._locale.weekdaysParse(e);null!=o?t.d=o:d(n).invalidWeekday=e}),U(["d","e","E"],function(e,t,n,o){t[o]=w(e)});var Po="Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),No="Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),Lo="Su_Mo_Tu_We_Th_Fr_Sa".split("_");N("H",["HH",2],0,"hour"),N("h",["hh",2],0,function(){return this.hours()%12||12}),Gt("a",!0),Gt("A",!1),O("hour","h"),F("a",$t),F("A",$t),F("H",Zn),F("h",Zn),F("HH",Zn,$n),F("hh",Zn,$n),Y(["H","HH"],ho),Y(["a","A"],function(e,t,n){n._isPm=n._locale.isPM(e),n._meridiem=e}),Y(["h","hh"],function(e,t,n){t[ho]=w(e),d(n).bigHour=!0});var Wo=/[ap]\.?m?\.?/i,Io=H("Hours",!0);N("m",["mm",2],0,"minute"),O("minute","m"),F("m",Zn),F("mm",Zn,$n),Y(["m","mm"],fo);var jo=H("Minutes",!1);N("s",["ss",2],0,"second"),O("second","s"),F("s",Zn),F("ss",Zn,$n),Y(["s","ss"],po);var Bo=H("Seconds",!1);N("S",0,0,function(){return~~(this.millisecond()/100)}),N(0,["SS",2],0,function(){return~~(this.millisecond()/10)}),N(0,["SSS",3],0,"millisecond"),N(0,["SSSS",4],0,function(){return 10*this.millisecond()}),N(0,["SSSSS",5],0,function(){return 100*this.millisecond()}),N(0,["SSSSSS",6],0,function(){return 1e3*this.millisecond()}),N(0,["SSSSSSS",7],0,function(){return 1e4*this.millisecond()}),N(0,["SSSSSSSS",8],0,function(){return 1e5*this.millisecond()}),N(0,["SSSSSSSSS",9],0,function(){return 1e6*this.millisecond()}),O("millisecond","ms"),F("S",Jn,Gn),F("SS",Jn,$n),F("SSS",Jn,Kn);var Fo;for(Fo="SSSS";Fo.length<=9;Fo+="S")F(Fo,to);for(Fo="S";Fo.length<=9;Fo+="S")Y(Fo,qt);var Vo=H("Milliseconds",!1);N("z",0,0,"zoneAbbr"),N("zz",0,0,"zoneName");var zo=g.prototype;zo.add=Ho,zo.calendar=rt,zo.clone=it,zo.diff=ct,zo.endOf=Rt,zo.format=pt,zo.from=gt,zo.fromNow=mt,zo.to=vt,zo.toNow=wt,zo.get=x,zo.invalidAt=Ht,zo.isAfter=st,zo.isBefore=at,zo.isBetween=lt,zo.isSame=ut,zo.isValid=Mt,zo.lang=Ao,zo.locale=yt,zo.localeData=bt,zo.max=To,zo.min=Eo,zo.parsingFlags=kt,zo.set=x,zo.startOf=Ct,zo.subtract=Do,zo.toArray=Tt,zo.toObject=Ot,zo.toDate=Et,zo.toISOString=ft,zo.toJSON=ft,zo.toString=ht,zo.unix=St,zo.valueOf=_t,zo.year=_o,zo.isLeapYear=ce,zo.weekYear=xt,zo.isoWeekYear=Pt,zo.quarter=zo.quarters=Wt,zo.month=J,zo.daysInMonth=Q,zo.week=zo.weeks=ge,zo.isoWeek=zo.isoWeeks=me,zo.weeksInYear=Lt,zo.isoWeeksInYear=Nt,zo.date=xo,zo.day=zo.days=zt,zo.weekday=Yt,zo.isoWeekday=Ut,zo.dayOfYear=we,zo.hour=zo.hours=Io,zo.minute=zo.minutes=jo,zo.second=zo.seconds=Bo,zo.millisecond=zo.milliseconds=Vo,zo.utcOffset=Fe, +zo.utc=ze,zo.local=Ye,zo.parseZone=Ue,zo.hasAlignedHourOffset=Ge,zo.isDST=$e,zo.isDSTShifted=Ke,zo.isLocal=Xe,zo.isUtcOffset=qe,zo.isUtc=Ze,zo.isUTC=Ze,zo.zoneAbbr=Zt,zo.zoneName=Jt,zo.dates=ne("dates accessor is deprecated. Use date instead.",xo),zo.months=ne("months accessor is deprecated. Use month instead",J),zo.years=ne("years accessor is deprecated. Use year instead",_o),zo.zone=ne("moment().zone is deprecated, use moment().utcOffset instead. https://github.com/moment/moment/issues/1779",Ve);var Yo=zo,Uo={sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},Go={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"},$o="Invalid date",Ko="%d",Xo=/\d{1,2}/,qo={future:"in %s",past:"%s ago",s:"a few seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},Zo=b.prototype;Zo._calendar=Uo,Zo.calendar=tn,Zo._longDateFormat=Go,Zo.longDateFormat=nn,Zo._invalidDate=$o,Zo.invalidDate=on,Zo._ordinal=Ko,Zo.ordinal=rn,Zo._ordinalParse=Xo,Zo.preparse=sn,Zo.postformat=sn,Zo._relativeTime=qo,Zo.relativeTime=an,Zo.pastFuture=ln,Zo.set=un,Zo.months=K,Zo._months=mo,Zo.monthsShort=X,Zo._monthsShort=vo,Zo.monthsParse=q,Zo.week=he,Zo._week=So,Zo.firstDayOfYear=pe,Zo.firstDayOfWeek=fe,Zo.weekdays=jt,Zo._weekdays=Po,Zo.weekdaysMin=Ft,Zo._weekdaysMin=Lo,Zo.weekdaysShort=Bt,Zo._weekdaysShort=No,Zo.weekdaysParse=Vt,Zo.isPM=Kt,Zo._meridiemParse=Wo,Zo.meridiem=Xt,S("en",{ordinalParse:/\d{1,2}(th|st|nd|rd)/,ordinal:function(e){var t=e%10,n=1===w(e%100/10)?"th":1===t?"st":2===t?"nd":3===t?"rd":"th";return e+n}}),e.lang=ne("moment.lang is deprecated. Use moment.locale instead.",S),e.langData=ne("moment.langData is deprecated. Use moment.localeData instead.",T);var Jo=Math.abs,Qo=On("ms"),er=On("s"),tr=On("m"),nr=On("h"),or=On("d"),rr=On("w"),ir=On("M"),sr=On("y"),ar=kn("milliseconds"),lr=kn("seconds"),ur=kn("minutes"),cr=kn("hours"),dr=kn("days"),hr=kn("months"),fr=kn("years"),pr=Math.round,gr={s:45,m:45,h:22,d:26,M:11},mr=Math.abs,vr=Ne.prototype;vr.abs=vn,vr.add=yn,vr.subtract=bn,vr.as=En,vr.asMilliseconds=Qo,vr.asSeconds=er,vr.asMinutes=tr,vr.asHours=nr,vr.asDays=or,vr.asWeeks=rr,vr.asMonths=ir,vr.asYears=sr,vr.valueOf=Tn,vr._bubble=Rn,vr.get=Mn,vr.milliseconds=ar,vr.seconds=lr,vr.minutes=ur,vr.hours=cr,vr.days=dr,vr.weeks=Hn,vr.months=hr,vr.years=fr,vr.humanize=Pn,vr.toISOString=Nn,vr.toString=Nn,vr.toJSON=Nn,vr.locale=yt,vr.localeData=bt,vr.toIsoString=ne("toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)",Nn),vr.lang=Ao,N("X",0,0,"unix"),N("x",0,0,"valueOf"),F("x",no),F("X",ro),Y("X",function(e,t,n){n._d=new Date(1e3*parseFloat(e,10))}),Y("x",function(e,t,n){n._d=new Date(w(e))}),e.version="2.10.6",o(De),e.fn=Yo,e.min=xe,e.max=Pe,e.utc=u,e.unix=Qt,e.months=hn,e.isDate=i,e.locale=S,e.invalid=f,e.duration=Je,e.isMoment=m,e.weekdays=pn,e.parseZone=en,e.localeData=T,e.isDuration=Le,e.monthsShort=fn,e.weekdaysMin=mn,e.defineLocale=E,e.weekdaysShort=gn,e.normalizeUnits=M,e.relativeTimeThreshold=xn;var wr=e;return wr})},{}],numeral:[function(t,n,o){"use strict";(function(){function t(e){this._value=e}function o(e,t,n,o){var r,i,s=Math.pow(10,t);return i=(n(e*s)/s).toFixed(t),o&&(r=new RegExp("0{1,"+o+"}$"),i=i.replace(r,"")),i}function r(e,t,n){var o;return o=t.indexOf("$")>-1?s(e,t,n):t.indexOf("%")>-1?a(e,t,n):t.indexOf(":")>-1?l(e,t):c(e._value,t,n)}function i(e,t){var n,o,r,i,s,a=t,l=["KB","MB","GB","TB","PB","EB","ZB","YB"],c=!1;if(t.indexOf(":")>-1)e._value=u(t);else if(t===w)e._value=0;else{for("."!==m[v].delimiters.decimal&&(t=t.replace(/\./g,"").replace(m[v].delimiters.decimal,".")),n=new RegExp("[^a-zA-Z]"+m[v].abbreviations.thousand+"(?:\\)|(\\"+m[v].currency.symbol+")?(?:\\))?)?$"),o=new RegExp("[^a-zA-Z]"+m[v].abbreviations.million+"(?:\\)|(\\"+m[v].currency.symbol+")?(?:\\))?)?$"),r=new RegExp("[^a-zA-Z]"+m[v].abbreviations.billion+"(?:\\)|(\\"+m[v].currency.symbol+")?(?:\\))?)?$"),i=new RegExp("[^a-zA-Z]"+m[v].abbreviations.trillion+"(?:\\)|(\\"+m[v].currency.symbol+")?(?:\\))?)?$"),s=0;s<=l.length&&!(c=t.indexOf(l[s])>-1?Math.pow(1024,s+1):!1);s++);e._value=(c?c:1)*(a.match(n)?Math.pow(10,3):1)*(a.match(o)?Math.pow(10,6):1)*(a.match(r)?Math.pow(10,9):1)*(a.match(i)?Math.pow(10,12):1)*(t.indexOf("%")>-1?.01:1)*((t.split("-").length+Math.min(t.split("(").length-1,t.split(")").length-1))%2?1:-1)*Number(t.replace(/[^0-9\.]+/g,"")),e._value=c?Math.ceil(e._value):e._value}return e._value}function s(e,t,n){var o,r,i=t.indexOf("$"),s=t.indexOf("("),a=t.indexOf("-"),l="";return t.indexOf(" $")>-1?(l=" ",t=t.replace(" $","")):t.indexOf("$ ")>-1?(l=" ",t=t.replace("$ ","")):t=t.replace("$",""),r=c(e._value,t,n),1>=i?r.indexOf("(")>-1||r.indexOf("-")>-1?(r=r.split(""),o=1,(s>i||a>i)&&(o=0),r.splice(o,0,m[v].currency.symbol+l),r=r.join("")):r=m[v].currency.symbol+l+r:r.indexOf(")")>-1?(r=r.split(""),r.splice(-1,0,l+m[v].currency.symbol),r=r.join("")):r=r+l+m[v].currency.symbol,r}function a(e,t,n){var o,r="",i=100*e._value;return t.indexOf(" %")>-1?(r=" ",t=t.replace(" %","")):t=t.replace("%",""),o=c(i,t,n),o.indexOf(")")>-1?(o=o.split(""),o.splice(-1,0,r+"%"),o=o.join("")):o=o+r+"%",o}function l(e){var t=Math.floor(e._value/60/60),n=Math.floor((e._value-60*t*60)/60),o=Math.round(e._value-60*t*60-60*n);return t+":"+(10>n?"0"+n:n)+":"+(10>o?"0"+o:o)}function u(e){var t=e.split(":"),n=0;return 3===t.length?(n+=60*Number(t[0])*60,n+=60*Number(t[1]),n+=Number(t[2])):2===t.length&&(n+=60*Number(t[0]),n+=Number(t[1])),Number(n)}function c(e,t,n){var r,i,s,a,l,u,c=!1,d=!1,h=!1,f="",p=!1,g=!1,y=!1,b=!1,C=!1,R="",_="",S=Math.abs(e),E=["B","KB","MB","GB","TB","PB","EB","ZB","YB"],T="",O=!1;if(0===e&&null!==w)return w;if(t.indexOf("(")>-1?(c=!0,t=t.slice(1,-1)):t.indexOf("+")>-1&&(d=!0,t=t.replace(/\+/g,"")),t.indexOf("a")>-1&&(p=t.indexOf("aK")>=0,g=t.indexOf("aM")>=0,y=t.indexOf("aB")>=0,b=t.indexOf("aT")>=0,C=p||g||y||b,t.indexOf(" a")>-1?(f=" ",t=t.replace(" a","")):t=t.replace("a",""),S>=Math.pow(10,12)&&!C||b?(f+=m[v].abbreviations.trillion,e/=Math.pow(10,12)):S=Math.pow(10,9)&&!C||y?(f+=m[v].abbreviations.billion,e/=Math.pow(10,9)):S=Math.pow(10,6)&&!C||g?(f+=m[v].abbreviations.million,e/=Math.pow(10,6)):(S=Math.pow(10,3)&&!C||p)&&(f+=m[v].abbreviations.thousand,e/=Math.pow(10,3))),t.indexOf("b")>-1)for(t.indexOf(" b")>-1?(R=" ",t=t.replace(" b","")):t=t.replace("b",""),s=0;s<=E.length;s++)if(r=Math.pow(1024,s),i=Math.pow(1024,s+1),e>=r&&i>e){R+=E[s],r>0&&(e/=r);break}return t.indexOf("o")>-1&&(t.indexOf(" o")>-1?(_=" ",t=t.replace(" o","")):t=t.replace("o",""),_+=m[v].ordinal(e)),t.indexOf("[.]")>-1&&(h=!0,t=t.replace("[.]",".")),a=e.toString().split(".")[0],l=t.split(".")[1],u=t.indexOf(","),l?(l.indexOf("[")>-1?(l=l.replace("]",""),l=l.split("["),T=o(e,l[0].length+l[1].length,n,l[1].length)):T=o(e,l.length,n),a=T.split(".")[0],T=T.split(".")[1].length?m[v].delimiters.decimal+T.split(".")[1]:"",h&&0===Number(T.slice(1))&&(T="")):a=o(e,null,n),a.indexOf("-")>-1&&(a=a.slice(1),O=!0),u>-1&&(a=a.toString().replace(/(\d)(?=(\d{3})+(?!\d))/g,"$1"+m[v].delimiters.thousands)),0===t.indexOf(".")&&(a=""),(c&&O?"(":"")+(!c&&O?"-":"")+(!O&&d?"+":"")+a+T+(_?_:"")+(f?f:"")+(R?R:"")+(c&&O?")":"")}function d(e,t){m[e]=t}function h(e){var t=e.toString().split(".");return t.length<2?1:Math.pow(10,t[1].length)}function f(){var e=Array.prototype.slice.call(arguments);return e.reduce(function(e,t){var n=h(e),o=h(t);return n>o?n:o},-(1/0))}var p,g="1.5.3",m={},v="en",w=null,y="0,0",b="undefined"!=typeof n&&n.exports;p=function(e){return p.isNumeral(e)?e=e.value():0===e||"undefined"==typeof e?e=0:Number(e)||(e=p.fn.unformat(e)),new t(Number(e))},p.version=g,p.isNumeral=function(e){return e instanceof t},p.language=function(e,t){if(!e)return v;if(e&&!t){if(!m[e])throw new Error("Unknown language : "+e);v=e}return(t||!m[e])&&d(e,t),p},p.languageData=function(e){if(!e)return m[v];if(!m[e])throw new Error("Unknown language : "+e);return m[e]},p.language("en",{delimiters:{thousands:",",decimal:"."},abbreviations:{thousand:"k",million:"m",billion:"b",trillion:"t"},ordinal:function(e){var t=e%10;return 1===~~(e%100/10)?"th":1===t?"st":2===t?"nd":3===t?"rd":"th"},currency:{symbol:"$"}}),p.zeroFormat=function(e){w="string"==typeof e?e:null},p.defaultFormat=function(e){y="string"==typeof e?e:"0.0"},p.validate=function(e,t){var n,o,r,i,s,a,l,u;if("string"!=typeof e&&(e+="",console.warn&&console.warn("Numeral.js: Value is not string. It has been co-erced to: ",e)),e=e.trim(),""===e)return!1;e=e.replace(/^[+-]?/,"");try{l=p.languageData(t)}catch(c){l=p.languageData(p.language())}return r=l.currency.symbol,s=l.abbreviations,n=l.delimiters.decimal,o="."===l.delimiters.thousands?"\\.":l.delimiters.thousands,u=e.match(/^[^\d\.\,]+/),null!==u&&(e=e.substr(1),u[0]!==r)?!1:(u=e.match(/[^\d]+$/),null!==u&&(e=e.slice(0,-1),u[0]!==s.thousand&&u[0]!==s.million&&u[0]!==s.billion&&u[0]!==s.trillion)?!1:e.match(/^\d+$/)?!0:(a=new RegExp(o+"{2}"),e.match(/[^\d.,]/g)?!1:(i=e.split(n),i.length>2?!1:i.length<2?!!i[0].match(/^\d+.*\d$/)&&!i[0].match(a):""===i[0]?!i[0].match(a)&&!!i[1].match(/^\d+$/):1===i[0].length?!!i[0].match(/^\d+$/)&&!i[0].match(a)&&!!i[1].match(/^\d+$/):!!i[0].match(/^\d+.*\d$/)&&!i[0].match(a)&&!!i[1].match(/^\d+$/))))},"function"!=typeof Array.prototype.reduce&&(Array.prototype.reduce=function(e,t){if(null===this||"undefined"==typeof this)throw new TypeError("Array.prototype.reduce called on null or undefined");if("function"!=typeof e)throw new TypeError(e+" is not a function");var n,o,r=this.length>>>0,i=!1;for(1n;++n)this.hasOwnProperty(n)&&(i?o=e(o,this[n],n,this):(o=this[n],i=!0));if(!i)throw new TypeError("Reduce of empty array with no initial value");return o}),p.fn=t.prototype={clone:function(){return p(this)},format:function(e,t){return r(this,e?e:y,void 0!==t?t:Math.round)},unformat:function(e){return"[object Number]"===Object.prototype.toString.call(e)?e:i(this,e?e:y)},value:function(){return this._value},valueOf:function(){return this._value},set:function(e){return this._value=Number(e),this},add:function(e){function t(e,t,o,r){return e+n*t}var n=f.call(null,this._value,e);return this._value=[this._value,e].reduce(t,0)/n,this},subtract:function(e){function t(e,t,o,r){return e-n*t}var n=f.call(null,this._value,e);return this._value=[e].reduce(t,this._value*n)/n,this},multiply:function(e){function t(e,t,n,o){var r=f(e,t);return e*r*(t*r)/(r*r)}return this._value=[this._value,e].reduce(t,1),this},divide:function(e){function t(e,t,n,o){var r=f(e,t);return e*r/(t*r)}return this._value=[this._value,e].reduce(t),this},difference:function(e){return Math.abs(p(this._value).subtract(e).value())}},b&&(n.exports=p),"undefined"==typeof ender&&(this.numeral=p),"function"==typeof e&&e.amd&&e([],function(){return p})}).call(window)},{}],pikaday:[function(t,n,o){/*! * Pikaday * * Copyright © 2014 David Bushell | BSD & MIT license | https://github.com/dbushell/Pikaday @@ -56,4 +56,4 @@ zo.utc=ze,zo.local=Ye,zo.parseZone=Ue,zo.hasAlignedHourOffset=Ge,zo.isDST=$e,zo. * http://zeroclipboard.org/ * v2.2.0 */ -!function(t,o){"use strict";var r,i,s,a=t,l=a.document,u=a.navigator,c=a.setTimeout,d=a.clearTimeout,h=a.setInterval,f=a.clearInterval,p=a.getComputedStyle,g=a.encodeURIComponent,m=a.ActiveXObject,v=a.Error,w=a.Number.parseInt||a.parseInt,y=a.Number.parseFloat||a.parseFloat,b=a.Number.isNaN||a.isNaN,C=a.Date.now,R=a.Object.keys,_=a.Object.defineProperty,S=a.Object.prototype.hasOwnProperty,E=a.Array.prototype.slice,T=function(){var e=function(e){return e};if("function"==typeof a.wrap&&"function"==typeof a.unwrap)try{var t=l.createElement("div"),n=a.unwrap(t);1===t.nodeType&&n&&1===n.nodeType&&(e=a.unwrap)}catch(o){}return e}(),O=function(e){return E.call(e,0)},M=function(){var e,t,n,r,i,s,a=O(arguments),l=a[0]||{};for(e=1,t=a.length;t>e;e++)if(null!=(n=a[e]))for(r in n)S.call(n,r)&&(i=l[r],s=n[r],l!==s&&s!==o&&(l[r]=s));return l},k=function(e){var t,n,o,r;if("object"!=typeof e||null==e||"number"==typeof e.nodeType)t=e;else if("number"==typeof e.length)for(t=[],n=0,o=e.length;o>n;n++)S.call(e,n)&&(t[n]=k(e[n]));else{t={};for(r in e)S.call(e,r)&&(t[r]=k(e[r]))}return t},H=function(e,t){for(var n={},o=0,r=t.length;r>o;o++)t[o]in e&&(n[t[o]]=e[t[o]]);return n},D=function(e,t){var n={};for(var o in e)-1===t.indexOf(o)&&(n[o]=e[o]);return n},x=function(e){if(e)for(var t in e)S.call(e,t)&&delete e[t];return e},A=function(e,t){if(e&&1===e.nodeType&&e.ownerDocument&&t&&(1===t.nodeType&&t.ownerDocument&&t.ownerDocument===e.ownerDocument||9===t.nodeType&&!t.ownerDocument&&t===e.ownerDocument))do{if(e===t)return!0;e=e.parentNode}while(e);return!1},P=function(e){var t;return"string"==typeof e&&e&&(t=e.split("#")[0].split("?")[0],t=e.slice(0,e.lastIndexOf("/")+1)),t},N=function(e){var t,n;return"string"==typeof e&&e&&(n=e.match(/^(?:|[^:@]*@|.+\)@(?=http[s]?|file)|.+?\s+(?: at |@)(?:[^:\(]+ )*[\(]?)((?:http[s]?|file):\/\/[\/]?.+?\/[^:\)]*?)(?::\d+)(?::\d+)?/),n&&n[1]?t=n[1]:(n=e.match(/\)@((?:http[s]?|file):\/\/[\/]?.+?\/[^:\)]*?)(?::\d+)(?::\d+)?/),n&&n[1]&&(t=n[1]))),t},L=function(){var e,t;try{throw new v}catch(n){t=n}return t&&(e=t.sourceURL||t.fileName||N(t.stack)),e},W=function(){var e,t,n;if(l.currentScript&&(e=l.currentScript.src))return e;if(t=l.getElementsByTagName("script"),1===t.length)return t[0].src||o;if("readyState"in t[0])for(n=t.length;n--;)if("interactive"===t[n].readyState&&(e=t[n].src))return e;return"loading"===l.readyState&&(e=t[t.length-1].src)?e:(e=L())?e:o},I=function(){var e,t,n,r=l.getElementsByTagName("script");for(e=r.length;e--;){if(!(n=r[e].src)){t=null;break}if(n=P(n),null==t)t=n;else if(t!==n){t=null;break}}return t||o},j=function(){var e=P(W())||I()||"";return e+"ZeroClipboard.swf"},B=function(){return null==t.opener&&(!!t.top&&t!=t.top||!!t.parent&&t!=t.parent)}(),F={bridge:null,version:"0.0.0",pluginType:"unknown",disabled:null,outdated:null,sandboxed:null,unavailable:null,degraded:null,deactivated:null,overdue:null,ready:null},V="11.0.0",z={},Y={},U=null,G=0,$=0,K={ready:"Flash communication is established",error:{"flash-disabled":"Flash is disabled or not installed. May also be attempting to run Flash in a sandboxed iframe, which is impossible.","flash-outdated":"Flash is too outdated to support ZeroClipboard","flash-sandboxed":"Attempting to run Flash in a sandboxed iframe, which is impossible","flash-unavailable":"Flash is unable to communicate bidirectionally with JavaScript","flash-degraded":"Flash is unable to preserve data fidelity when communicating with JavaScript","flash-deactivated":"Flash is too outdated for your browser and/or is configured as click-to-activate.\nThis may also mean that the ZeroClipboard SWF object could not be loaded, so please check your `swfPath` configuration and/or network connectivity.\nMay also be attempting to run Flash in a sandboxed iframe, which is impossible.","flash-overdue":"Flash communication was established but NOT within the acceptable time limit","version-mismatch":"ZeroClipboard JS version number does not match ZeroClipboard SWF version number","clipboard-error":"At least one error was thrown while ZeroClipboard was attempting to inject your data into the clipboard","config-mismatch":"ZeroClipboard configuration does not match Flash's reality","swf-not-found":"The ZeroClipboard SWF object could not be loaded, so please check your `swfPath` configuration and/or network connectivity"}},X=["flash-unavailable","flash-degraded","flash-overdue","version-mismatch","config-mismatch","clipboard-error"],q=["flash-disabled","flash-outdated","flash-sandboxed","flash-unavailable","flash-degraded","flash-deactivated","flash-overdue"],Z=new RegExp("^flash-("+q.map(function(e){return e.replace(/^flash-/,"")}).join("|")+")$"),J=new RegExp("^flash-("+q.slice(1).map(function(e){return e.replace(/^flash-/,"")}).join("|")+")$"),Q={swfPath:j(),trustedDomains:t.location.host?[t.location.host]:[],cacheBust:!0,forceEnhancedClipboard:!1,flashLoadTimeout:3e4,autoActivate:!0,bubbleEvents:!0,containerId:"global-zeroclipboard-html-bridge",containerClass:"global-zeroclipboard-container",swfObjectId:"global-zeroclipboard-flash-bridge",hoverClass:"zeroclipboard-is-hover",activeClass:"zeroclipboard-is-active",forceHandCursor:!1,title:null,zIndex:999999999},ee=function(e){if("object"==typeof e&&null!==e)for(var t in e)if(S.call(e,t))if(/^(?:forceHandCursor|title|zIndex|bubbleEvents)$/.test(t))Q[t]=e[t];else if(null==F.bridge)if("containerId"===t||"swfObjectId"===t){if(!ge(e[t]))throw new Error("The specified `"+t+"` value is not valid as an HTML4 Element ID");Q[t]=e[t]}else Q[t]=e[t];{if("string"!=typeof e||!e)return k(Q);if(S.call(Q,e))return Q[e]}},te=function(){return $e(),{browser:H(u,["userAgent","platform","appName"]),flash:D(F,["bridge"]),zeroclipboard:{version:Xe.version,config:Xe.config()}}},ne=function(){return!!(F.disabled||F.outdated||F.sandboxed||F.unavailable||F.degraded||F.deactivated)},oe=function(e,t){var n,i,s,a={};if("string"==typeof e&&e)s=e.toLowerCase().split(/\s+/);else if("object"==typeof e&&e&&"undefined"==typeof t)for(n in e)S.call(e,n)&&"string"==typeof n&&n&&"function"==typeof e[n]&&Xe.on(n,e[n]);if(s&&s.length){for(n=0,i=s.length;i>n;n++)e=s[n].replace(/^on/,""),a[e]=!0,z[e]||(z[e]=[]),z[e].push(t);if(a.ready&&F.ready&&Xe.emit({type:"ready"}),a.error){for(n=0,i=q.length;i>n;n++)if(F[q[n].replace(/^flash-/,"")]===!0){Xe.emit({type:"error",name:q[n]});break}r!==o&&Xe.version!==r&&Xe.emit({type:"error",name:"version-mismatch",jsVersion:Xe.version,swfVersion:r})}}return Xe},re=function(e,t){var n,o,r,i,s;if(0===arguments.length)i=R(z);else if("string"==typeof e&&e)i=e.split(/\s+/);else if("object"==typeof e&&e&&"undefined"==typeof t)for(n in e)S.call(e,n)&&"string"==typeof n&&n&&"function"==typeof e[n]&&Xe.off(n,e[n]);if(i&&i.length)for(n=0,o=i.length;o>n;n++)if(e=i[n].toLowerCase().replace(/^on/,""),s=z[e],s&&s.length)if(t)for(r=s.indexOf(t);-1!==r;)s.splice(r,1),r=s.indexOf(t,r);else s.length=0;return Xe},ie=function(e){var t;return t="string"==typeof e&&e?k(z[e])||null:k(z)},se=function(e){var t,n,o;return e=me(e),e&&!_e(e)?"ready"===e.type&&F.overdue===!0?Xe.emit({type:"error",name:"flash-overdue"}):(t=M({},e),Ce.call(this,t),"copy"===e.type&&(o=De(Y),n=o.data,U=o.formatMap),n):void 0},ae=function(){var e=F.sandboxed;if($e(),"boolean"!=typeof F.ready&&(F.ready=!1),F.sandboxed!==e&&F.sandboxed===!0)F.ready=!1,Xe.emit({type:"error",name:"flash-sandboxed"});else if(!Xe.isFlashUnusable()&&null===F.bridge){var t=Q.flashLoadTimeout;"number"==typeof t&&t>=0&&(G=c(function(){"boolean"!=typeof F.deactivated&&(F.deactivated=!0),F.deactivated===!0&&Xe.emit({type:"error",name:"flash-deactivated"})},t)),F.overdue=!1,ke()}},le=function(){Xe.clearData(),Xe.blur(),Xe.emit("destroy"),He(),Xe.off()},ue=function(e,t){var n;if("object"==typeof e&&e&&"undefined"==typeof t)n=e,Xe.clearData();else{if("string"!=typeof e||!e)return;n={},n[e]=t}for(var o in n)"string"==typeof o&&o&&S.call(n,o)&&"string"==typeof n[o]&&n[o]&&(Y[o]=n[o])},ce=function(e){"undefined"==typeof e?(x(Y),U=null):"string"==typeof e&&S.call(Y,e)&&delete Y[e]},de=function(e){return"undefined"==typeof e?k(Y):"string"==typeof e&&S.call(Y,e)?Y[e]:void 0},he=function(e){if(e&&1===e.nodeType){i&&(je(i,Q.activeClass),i!==e&&je(i,Q.hoverClass)),i=e,Ie(e,Q.hoverClass);var t=e.getAttribute("title")||Q.title;if("string"==typeof t&&t){var n=Me(F.bridge);n&&n.setAttribute("title",t)}var o=Q.forceHandCursor===!0||"pointer"===Be(e,"cursor");Ue(o),Ye()}},fe=function(){var e=Me(F.bridge);e&&(e.removeAttribute("title"),e.style.left="0px",e.style.top="-9999px",e.style.width="1px",e.style.height="1px"),i&&(je(i,Q.hoverClass),je(i,Q.activeClass),i=null)},pe=function(){return i||null},ge=function(e){return"string"==typeof e&&e&&/^[A-Za-z][A-Za-z0-9_:\-\.]*$/.test(e)},me=function(e){var t;if("string"==typeof e&&e?(t=e,e={}):"object"==typeof e&&e&&"string"==typeof e.type&&e.type&&(t=e.type),t){t=t.toLowerCase(),!e.target&&(/^(copy|aftercopy|_click)$/.test(t)||"error"===t&&"clipboard-error"===e.name)&&(e.target=s),M(e,{type:t,target:e.target||i||null,relatedTarget:e.relatedTarget||null,currentTarget:F&&F.bridge||null,timeStamp:e.timeStamp||C()||null});var n=K[e.type];return"error"===e.type&&e.name&&n&&(n=n[e.name]),n&&(e.message=n),"ready"===e.type&&M(e,{target:null,version:F.version}),"error"===e.type&&(Z.test(e.name)&&M(e,{target:null,minimumVersion:V}),J.test(e.name)&&M(e,{version:F.version})),"copy"===e.type&&(e.clipboardData={setData:Xe.setData,clearData:Xe.clearData}),"aftercopy"===e.type&&(e=xe(e,U)),e.target&&!e.relatedTarget&&(e.relatedTarget=ve(e.target)),we(e)}},ve=function(e){var t=e&&e.getAttribute&&e.getAttribute("data-clipboard-target");return t?l.getElementById(t):null},we=function(e){if(e&&/^_(?:click|mouse(?:over|out|down|up|move))$/.test(e.type)){var t=e.target,n="_mouseover"===e.type&&e.relatedTarget?e.relatedTarget:o,r="_mouseout"===e.type&&e.relatedTarget?e.relatedTarget:o,i=Fe(t),s=a.screenLeft||a.screenX||0,u=a.screenTop||a.screenY||0,c=l.body.scrollLeft+l.documentElement.scrollLeft,d=l.body.scrollTop+l.documentElement.scrollTop,h=i.left+("number"==typeof e._stageX?e._stageX:0),f=i.top+("number"==typeof e._stageY?e._stageY:0),p=h-c,g=f-d,m=s+p,v=u+g,w="number"==typeof e.movementX?e.movementX:0,y="number"==typeof e.movementY?e.movementY:0;delete e._stageX,delete e._stageY,M(e,{srcElement:t,fromElement:n,toElement:r,screenX:m,screenY:v,pageX:h,pageY:f,clientX:p,clientY:g,x:p,y:g,movementX:w,movementY:y,offsetX:0,offsetY:0,layerX:0,layerY:0})}return e},ye=function(e){var t=e&&"string"==typeof e.type&&e.type||"";return!/^(?:(?:before)?copy|destroy)$/.test(t)},be=function(e,t,n,o){o?c(function(){e.apply(t,n)},0):e.apply(t,n)},Ce=function(e){if("object"==typeof e&&e&&e.type){var t=ye(e),n=z["*"]||[],o=z[e.type]||[],r=n.concat(o);if(r&&r.length){var i,s,l,u,c,d=this;for(i=0,s=r.length;s>i;i++)l=r[i],u=d,"string"==typeof l&&"function"==typeof a[l]&&(l=a[l]),"object"==typeof l&&l&&"function"==typeof l.handleEvent&&(u=l,l=l.handleEvent),"function"==typeof l&&(c=M({},e),be(l,u,[c],t))}return this}},Re=function(e){var t=null;return(B===!1||e&&"error"===e.type&&e.name&&-1!==X.indexOf(e.name))&&(t=!1),t},_e=function(e){var t=e.target||i||null,n="swf"===e._source;switch(delete e._source,e.type){case"error":var o="flash-sandboxed"===e.name||Re(e);"boolean"==typeof o&&(F.sandboxed=o),-1!==q.indexOf(e.name)?M(F,{disabled:"flash-disabled"===e.name,outdated:"flash-outdated"===e.name,unavailable:"flash-unavailable"===e.name,degraded:"flash-degraded"===e.name,deactivated:"flash-deactivated"===e.name,overdue:"flash-overdue"===e.name,ready:!1}):"version-mismatch"===e.name&&(r=e.swfVersion,M(F,{disabled:!1,outdated:!1,unavailable:!1,degraded:!1,deactivated:!1,overdue:!1,ready:!1})),ze();break;case"ready":r=e.swfVersion;var a=F.deactivated===!0;M(F,{disabled:!1,outdated:!1,sandboxed:!1,unavailable:!1,degraded:!1,deactivated:!1,overdue:a,ready:!a}),ze();break;case"beforecopy":s=t;break;case"copy":var l,u,c=e.relatedTarget;!Y["text/html"]&&!Y["text/plain"]&&c&&(u=c.value||c.outerHTML||c.innerHTML)&&(l=c.value||c.textContent||c.innerText)?(e.clipboardData.clearData(),e.clipboardData.setData("text/plain",l),u!==l&&e.clipboardData.setData("text/html",u)):!Y["text/plain"]&&e.target&&(l=e.target.getAttribute("data-clipboard-text"))&&(e.clipboardData.clearData(),e.clipboardData.setData("text/plain",l));break;case"aftercopy":Se(e),Xe.clearData(),t&&t!==We()&&t.focus&&t.focus();break;case"_mouseover":Xe.focus(t),Q.bubbleEvents===!0&&n&&(t&&t!==e.relatedTarget&&!A(e.relatedTarget,t)&&Ee(M({},e,{type:"mouseenter",bubbles:!1,cancelable:!1})),Ee(M({},e,{type:"mouseover"})));break;case"_mouseout":Xe.blur(),Q.bubbleEvents===!0&&n&&(t&&t!==e.relatedTarget&&!A(e.relatedTarget,t)&&Ee(M({},e,{type:"mouseleave",bubbles:!1,cancelable:!1})),Ee(M({},e,{type:"mouseout"})));break;case"_mousedown":Ie(t,Q.activeClass),Q.bubbleEvents===!0&&n&&Ee(M({},e,{type:e.type.slice(1)}));break;case"_mouseup":je(t,Q.activeClass),Q.bubbleEvents===!0&&n&&Ee(M({},e,{type:e.type.slice(1)}));break;case"_click":s=null,Q.bubbleEvents===!0&&n&&Ee(M({},e,{type:e.type.slice(1)}));break;case"_mousemove":Q.bubbleEvents===!0&&n&&Ee(M({},e,{type:e.type.slice(1)}))}return/^_(?:click|mouse(?:over|out|down|up|move))$/.test(e.type)?!0:void 0},Se=function(e){if(e.errors&&e.errors.length>0){var t=k(e);M(t,{type:"error",name:"clipboard-error"}),delete t.success,c(function(){Xe.emit(t)},0)}},Ee=function(e){if(e&&"string"==typeof e.type&&e){var t,n=e.target||null,o=n&&n.ownerDocument||l,r={view:o.defaultView||a,canBubble:!0,cancelable:!0,detail:"click"===e.type?1:0,button:"number"==typeof e.which?e.which-1:"number"==typeof e.button?e.button:o.createEvent?0:1},i=M(r,e);n&&o.createEvent&&n.dispatchEvent&&(i=[i.type,i.canBubble,i.cancelable,i.view,i.detail,i.screenX,i.screenY,i.clientX,i.clientY,i.ctrlKey,i.altKey,i.shiftKey,i.metaKey,i.button,i.relatedTarget],t=o.createEvent("MouseEvents"),t.initMouseEvent&&(t.initMouseEvent.apply(t,i),t._source="js",n.dispatchEvent(t)))}},Te=function(){var e=Q.flashLoadTimeout;if("number"==typeof e&&e>=0){var t=Math.min(1e3,e/10),n=Q.swfObjectId+"_fallbackContent";$=h(function(){var e=l.getElementById(n);Ve(e)&&(ze(),F.deactivated=null,Xe.emit({type:"error",name:"swf-not-found"}))},t)}},Oe=function(){var e=l.createElement("div");return e.id=Q.containerId,e.className=Q.containerClass,e.style.position="absolute",e.style.left="0px",e.style.top="-9999px",e.style.width="1px",e.style.height="1px",e.style.zIndex=""+Ge(Q.zIndex),e},Me=function(e){for(var t=e&&e.parentNode;t&&"OBJECT"===t.nodeName&&t.parentNode;)t=t.parentNode;return t||null},ke=function(){var e,t=F.bridge,n=Me(t);if(!t){var o=Le(a.location.host,Q),r="never"===o?"none":"all",i=Pe(M({jsVersion:Xe.version},Q)),s=Q.swfPath+Ae(Q.swfPath,Q);n=Oe();var u=l.createElement("div");n.appendChild(u),l.body.appendChild(n);var c=l.createElement("div"),d="activex"===F.pluginType;c.innerHTML='"+(d?'':"")+'
 
',t=c.firstChild,c=null,T(t).ZeroClipboard=Xe,n.replaceChild(t,u),Te()}return t||(t=l[Q.swfObjectId],t&&(e=t.length)&&(t=t[e-1]),!t&&n&&(t=n.firstChild)),F.bridge=t||null,t},He=function(){var e=F.bridge;if(e){var t=Me(e);t&&("activex"===F.pluginType&&"readyState"in e?(e.style.display="none",function n(){if(4===e.readyState){for(var o in e)"function"==typeof e[o]&&(e[o]=null);e.parentNode&&e.parentNode.removeChild(e),t.parentNode&&t.parentNode.removeChild(t)}else c(n,10)}()):(e.parentNode&&e.parentNode.removeChild(e),t.parentNode&&t.parentNode.removeChild(t))),ze(),F.ready=null,F.bridge=null,F.deactivated=null,r=o}},De=function(e){var t={},n={};if("object"==typeof e&&e){for(var o in e)if(o&&S.call(e,o)&&"string"==typeof e[o]&&e[o])switch(o.toLowerCase()){case"text/plain":case"text":case"air:text":case"flash:text":t.text=e[o],n.text=o;break;case"text/html":case"html":case"air:html":case"flash:html":t.html=e[o],n.html=o;break;case"application/rtf":case"text/rtf":case"rtf":case"richtext":case"air:rtf":case"flash:rtf":t.rtf=e[o],n.rtf=o}return{data:t,formatMap:n}}},xe=function(e,t){if("object"!=typeof e||!e||"object"!=typeof t||!t)return e;var n={};for(var o in e)if(S.call(e,o))if("errors"===o){n[o]=e[o]?e[o].slice():[];for(var r=0,i=n[o].length;i>r;r++)n[o][r].format=t[n[o][r].format]}else if("success"!==o&&"data"!==o)n[o]=e[o];else{n[o]={};var s=e[o];for(var a in s)a&&S.call(s,a)&&S.call(t,a)&&(n[o][t[a]]=s[a])}return n},Ae=function(e,t){var n=null==t||t&&t.cacheBust===!0;return n?(-1===e.indexOf("?")?"?":"&")+"noCache="+C():""},Pe=function(e){var t,n,o,r,i="",s=[];if(e.trustedDomains&&("string"==typeof e.trustedDomains?r=[e.trustedDomains]:"object"==typeof e.trustedDomains&&"length"in e.trustedDomains&&(r=e.trustedDomains)),r&&r.length)for(t=0,n=r.length;n>t;t++)if(S.call(r,t)&&r[t]&&"string"==typeof r[t]){if(o=Ne(r[t]),!o)continue;if("*"===o){s.length=0,s.push(o);break}s.push.apply(s,[o,"//"+o,a.location.protocol+"//"+o])}return s.length&&(i+="trustedOrigins="+g(s.join(","))),e.forceEnhancedClipboard===!0&&(i+=(i?"&":"")+"forceEnhancedClipboard=true"),"string"==typeof e.swfObjectId&&e.swfObjectId&&(i+=(i?"&":"")+"swfObjectId="+g(e.swfObjectId)),"string"==typeof e.jsVersion&&e.jsVersion&&(i+=(i?"&":"")+"jsVersion="+g(e.jsVersion)),i},Ne=function(e){if(null==e||""===e)return null;if(e=e.replace(/^\s+|\s+$/g,""),""===e)return null;var t=e.indexOf("//");e=-1===t?e:e.slice(t+2);var n=e.indexOf("/");return e=-1===n?e:-1===t||0===n?null:e.slice(0,n),e&&".swf"===e.slice(-4).toLowerCase()?null:e||null},Le=function(){var e=function(e){var t,n,o,r=[];if("string"==typeof e&&(e=[e]),"object"!=typeof e||!e||"number"!=typeof e.length)return r;for(t=0,n=e.length;n>t;t++)if(S.call(e,t)&&(o=Ne(e[t]))){if("*"===o){r.length=0,r.push("*");break}-1===r.indexOf(o)&&r.push(o)}return r};return function(t,n){var o=Ne(n.swfPath);null===o&&(o=t);var r=e(n.trustedDomains),i=r.length;if(i>0){if(1===i&&"*"===r[0])return"always";if(-1!==r.indexOf(t))return 1===i&&t===o?"sameDomain":"always"}return"never"}}(),We=function(){try{return l.activeElement}catch(e){return null}},Ie=function(e,t){var n,o,r,i=[];if("string"==typeof t&&t&&(i=t.split(/\s+/)),e&&1===e.nodeType&&i.length>0)if(e.classList)for(n=0,o=i.length;o>n;n++)e.classList.add(i[n]);else if(e.hasOwnProperty("className")){for(r=" "+e.className+" ",n=0,o=i.length;o>n;n++)-1===r.indexOf(" "+i[n]+" ")&&(r+=i[n]+" ");e.className=r.replace(/^\s+|\s+$/g,"")}return e},je=function(e,t){var n,o,r,i=[];if("string"==typeof t&&t&&(i=t.split(/\s+/)),e&&1===e.nodeType&&i.length>0)if(e.classList&&e.classList.length>0)for(n=0,o=i.length;o>n;n++)e.classList.remove(i[n]);else if(e.className){for(r=(" "+e.className+" ").replace(/[\r\n\t]/g," "),n=0,o=i.length;o>n;n++)r=r.replace(" "+i[n]+" "," ");e.className=r.replace(/^\s+|\s+$/g,"")}return e},Be=function(e,t){var n=p(e,null).getPropertyValue(t);return"cursor"!==t||n&&"auto"!==n||"A"!==e.nodeName?n:"pointer"},Fe=function(e){var t={left:0,top:0,width:0,height:0};if(e.getBoundingClientRect){var n=e.getBoundingClientRect(),o=a.pageXOffset,r=a.pageYOffset,i=l.documentElement.clientLeft||0,s=l.documentElement.clientTop||0,u=0,c=0;if("relative"===Be(l.body,"position")){var d=l.body.getBoundingClientRect(),h=l.documentElement.getBoundingClientRect();u=d.left-h.left||0,c=d.top-h.top||0}t.left=n.left+o-i-u,t.top=n.top+r-s-c,t.width="width"in n?n.width:n.right-n.left,t.height="height"in n?n.height:n.bottom-n.top}return t},Ve=function(e){if(!e)return!1;var t=p(e,null),n=y(t.height)>0,o=y(t.width)>0,r=y(t.top)>=0,i=y(t.left)>=0,s=n&&o&&r&&i,a=s?null:Fe(e),l="none"!==t.display&&"collapse"!==t.visibility&&(s||!!a&&(n||a.height>0)&&(o||a.width>0)&&(r||a.top>=0)&&(i||a.left>=0));return l},ze=function(){d(G),G=0,f($),$=0},Ye=function(){var e;if(i&&(e=Me(F.bridge))){var t=Fe(i);M(e.style,{width:t.width+"px",height:t.height+"px",top:t.top+"px",left:t.left+"px",zIndex:""+Ge(Q.zIndex)})}},Ue=function(e){F.ready===!0&&(F.bridge&&"function"==typeof F.bridge.setHandCursor?F.bridge.setHandCursor(e):F.ready=!1)},Ge=function(e){if(/^(?:auto|inherit)$/.test(e))return e;var t;return"number"!=typeof e||b(e)?"string"==typeof e&&(t=Ge(w(e,10))):t=e,"number"==typeof t?t:"auto"},$e=function(e){var n,o,r,i=F.sandboxed,s=null;if(e=e===!0,B===!1)s=!1;else{try{o=t.frameElement||null}catch(a){r={name:a.name,message:a.message}}if(o&&1===o.nodeType&&"IFRAME"===o.nodeName)try{s=o.hasAttribute("sandbox")}catch(a){s=null}else{try{n=document.domain||null}catch(a){n=null}(null===n||r&&"SecurityError"===r.name&&/(^|[\s\(\[@])sandbox(es|ed|ing|[\s\.,!\)\]@]|$)/.test(r.message.toLowerCase()))&&(s=!0)}}return F.sandboxed=s,i===s||e||Ke(m),s},Ke=function(e){function t(e){var t=e.match(/[\d]+/g);return t.length=3,t.join(".")}function n(e){return!!e&&(e=e.toLowerCase())&&(/^(pepflashplayer\.dll|libpepflashplayer\.so|pepperflashplayer\.plugin)$/.test(e)||"chrome.plugin"===e.slice(-13))}function o(e){e&&(a=!0,e.version&&(d=t(e.version)),!d&&e.description&&(d=t(e.description)),e.filename&&(c=n(e.filename)))}var r,i,s,a=!1,l=!1,c=!1,d="";if(u.plugins&&u.plugins.length)r=u.plugins["Shockwave Flash"],o(r),u.plugins["Shockwave Flash 2.0"]&&(a=!0,d="2.0.0.11");else if(u.mimeTypes&&u.mimeTypes.length)s=u.mimeTypes["application/x-shockwave-flash"],r=s&&s.enabledPlugin,o(r);else if("undefined"!=typeof e){l=!0;try{i=new e("ShockwaveFlash.ShockwaveFlash.7"),a=!0,d=t(i.GetVariable("$version"))}catch(h){try{i=new e("ShockwaveFlash.ShockwaveFlash.6"),a=!0,d="6.0.21"}catch(f){try{i=new e("ShockwaveFlash.ShockwaveFlash"),a=!0,d=t(i.GetVariable("$version"))}catch(p){l=!1}}}}F.disabled=a!==!0,F.outdated=d&&y(d)n;n++)e=s[n].replace(/^on/,""),a[e]=!0,u[e]||(u[e]=[]),u[e].push(t);if(a.ready&&F.ready&&this.emit({type:"ready",client:this}),a.error){for(n=0,i=q.length;i>n;n++)if(F[q[n].replace(/^flash-/,"")]){this.emit({type:"error",name:q[n],client:this});break}r!==o&&Xe.version!==r&&this.emit({type:"error",name:"version-mismatch",jsVersion:Xe.version,swfVersion:r})}}return this},ot=function(e,t){var n,o,r,i,s,a=Ze[this.id],l=a&&a.handlers;if(!l)return this;if(0===arguments.length)i=R(l);else if("string"==typeof e&&e)i=e.split(/\s+/);else if("object"==typeof e&&e&&"undefined"==typeof t)for(n in e)S.call(e,n)&&"string"==typeof n&&n&&"function"==typeof e[n]&&this.off(n,e[n]);if(i&&i.length)for(n=0,o=i.length;o>n;n++)if(e=i[n].toLowerCase().replace(/^on/,""),s=l[e],s&&s.length)if(t)for(r=s.indexOf(t);-1!==r;)s.splice(r,1),r=s.indexOf(t,r);else s.length=0;return this},rt=function(e){var t=null,n=Ze[this.id]&&Ze[this.id].handlers;return n&&(t="string"==typeof e&&e?n[e]?n[e].slice(0):[]:k(n)),t},it=function(e){if(ct.call(this,e)){"object"==typeof e&&e&&"string"==typeof e.type&&e.type&&(e=M({},e));var t=M({},me(e),{client:this});dt.call(this,t)}return this},st=function(e){if(!Ze[this.id])throw new Error("Attempted to clip element(s) to a destroyed ZeroClipboard client instance");e=ht(e);for(var t=0;t0,r=!e.target||o&&-1!==n.indexOf(e.target),i=e.relatedTarget&&o&&-1!==n.indexOf(e.relatedTarget),s=e.client&&e.client===this;return t&&(r||i||s)?!0:!1},dt=function(e){var t=Ze[this.id];if("object"==typeof e&&e&&e.type&&t){var n=ye(e),o=t&&t.handlers["*"]||[],r=t&&t.handlers[e.type]||[],i=o.concat(r);if(i&&i.length){var s,l,u,c,d,h=this;for(s=0,l=i.length;l>s;s++)u=i[s],c=h,"string"==typeof u&&"function"==typeof a[u]&&(u=a[u]),"object"==typeof u&&u&&"function"==typeof u.handleEvent&&(c=u,u=u.handleEvent),"function"==typeof u&&(d=M({},e),be(u,c,[d],n))}}},ht=function(e){return"string"==typeof e&&(e=[]),"number"!=typeof e.length?[e]:e},ft=function(e){if(e&&1===e.nodeType){var t=function(e){(e||(e=a.event))&&("js"!==e._source&&(e.stopImmediatePropagation(),e.preventDefault()),delete e._source)},n=function(n){(n||(n=a.event))&&(t(n),Xe.focus(e))};e.addEventListener("mouseover",n,!1),e.addEventListener("mouseout",t,!1),e.addEventListener("mouseenter",t,!1),e.addEventListener("mouseleave",t,!1),e.addEventListener("mousemove",t,!1),et[e.zcClippingId]={mouseover:n,mouseout:t,mouseenter:t,mouseleave:t,mousemove:t}}},pt=function(e){if(e&&1===e.nodeType){var t=et[e.zcClippingId];if("object"==typeof t&&t){for(var n,o,r=["move","leave","enter","out","over"],i=0,s=r.length;s>i;i++)n="mouse"+r[i],o=t[n],"function"==typeof o&&e.removeEventListener(n,o,!1);delete et[e.zcClippingId]}}};Xe._createClient=function(){tt.apply(this,O(arguments))},Xe.prototype.on=function(){return nt.apply(this,O(arguments))},Xe.prototype.off=function(){return ot.apply(this,O(arguments))},Xe.prototype.handlers=function(){return rt.apply(this,O(arguments))},Xe.prototype.emit=function(){return it.apply(this,O(arguments))},Xe.prototype.clip=function(){return st.apply(this,O(arguments))},Xe.prototype.unclip=function(){return at.apply(this,O(arguments))},Xe.prototype.elements=function(){return lt.apply(this,O(arguments))},Xe.prototype.destroy=function(){return ut.apply(this,O(arguments))},Xe.prototype.setText=function(e){if(!Ze[this.id])throw new Error("Attempted to set pending clipboard data from a destroyed ZeroClipboard client instance");return Xe.setData("text/plain",e),this},Xe.prototype.setHtml=function(e){if(!Ze[this.id])throw new Error("Attempted to set pending clipboard data from a destroyed ZeroClipboard client instance");return Xe.setData("text/html",e),this},Xe.prototype.setRichText=function(e){if(!Ze[this.id])throw new Error("Attempted to set pending clipboard data from a destroyed ZeroClipboard client instance");return Xe.setData("application/rtf",e),this},Xe.prototype.setData=function(){if(!Ze[this.id])throw new Error("Attempted to set pending clipboard data from a destroyed ZeroClipboard client instance");return Xe.setData.apply(this,O(arguments)),this},Xe.prototype.clearData=function(){if(!Ze[this.id])throw new Error("Attempted to clear pending clipboard data from a destroyed ZeroClipboard client instance");return Xe.clearData.apply(this,O(arguments)),this},Xe.prototype.getData=function(){if(!Ze[this.id])throw new Error("Attempted to get pending clipboard data from a destroyed ZeroClipboard client instance");return Xe.getData.apply(this,O(arguments))},"function"==typeof e&&e.amd?e(function(){return Xe}):"object"==typeof n&&n&&"object"==typeof n.exports&&n.exports?n.exports=Xe:t.ZeroClipboard=Xe}(function(){return this||window}())},{}]},{},[23,59,61,60,62,83,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,84,85,86,87,100,101,102,90,91,92,93,94,95,31,35,32,33,40,34,36,37,38,39])("zeroclipboard")}); \ No newline at end of file +!function(t,o){"use strict";var r,i,s,a=t,l=a.document,u=a.navigator,c=a.setTimeout,d=a.clearTimeout,h=a.setInterval,f=a.clearInterval,p=a.getComputedStyle,g=a.encodeURIComponent,m=a.ActiveXObject,v=a.Error,w=a.Number.parseInt||a.parseInt,y=a.Number.parseFloat||a.parseFloat,b=a.Number.isNaN||a.isNaN,C=a.Date.now,R=a.Object.keys,_=a.Object.defineProperty,S=a.Object.prototype.hasOwnProperty,E=a.Array.prototype.slice,T=function(){var e=function(e){return e};if("function"==typeof a.wrap&&"function"==typeof a.unwrap)try{var t=l.createElement("div"),n=a.unwrap(t);1===t.nodeType&&n&&1===n.nodeType&&(e=a.unwrap)}catch(o){}return e}(),O=function(e){return E.call(e,0)},M=function(){var e,t,n,r,i,s,a=O(arguments),l=a[0]||{};for(e=1,t=a.length;t>e;e++)if(null!=(n=a[e]))for(r in n)S.call(n,r)&&(i=l[r],s=n[r],l!==s&&s!==o&&(l[r]=s));return l},k=function(e){var t,n,o,r;if("object"!=typeof e||null==e||"number"==typeof e.nodeType)t=e;else if("number"==typeof e.length)for(t=[],n=0,o=e.length;o>n;n++)S.call(e,n)&&(t[n]=k(e[n]));else{t={};for(r in e)S.call(e,r)&&(t[r]=k(e[r]))}return t},H=function(e,t){for(var n={},o=0,r=t.length;r>o;o++)t[o]in e&&(n[t[o]]=e[t[o]]);return n},D=function(e,t){var n={};for(var o in e)-1===t.indexOf(o)&&(n[o]=e[o]);return n},A=function(e){if(e)for(var t in e)S.call(e,t)&&delete e[t];return e},x=function(e,t){if(e&&1===e.nodeType&&e.ownerDocument&&t&&(1===t.nodeType&&t.ownerDocument&&t.ownerDocument===e.ownerDocument||9===t.nodeType&&!t.ownerDocument&&t===e.ownerDocument))do{if(e===t)return!0;e=e.parentNode}while(e);return!1},P=function(e){var t;return"string"==typeof e&&e&&(t=e.split("#")[0].split("?")[0],t=e.slice(0,e.lastIndexOf("/")+1)),t},N=function(e){var t,n;return"string"==typeof e&&e&&(n=e.match(/^(?:|[^:@]*@|.+\)@(?=http[s]?|file)|.+?\s+(?: at |@)(?:[^:\(]+ )*[\(]?)((?:http[s]?|file):\/\/[\/]?.+?\/[^:\)]*?)(?::\d+)(?::\d+)?/),n&&n[1]?t=n[1]:(n=e.match(/\)@((?:http[s]?|file):\/\/[\/]?.+?\/[^:\)]*?)(?::\d+)(?::\d+)?/),n&&n[1]&&(t=n[1]))),t},L=function(){var e,t;try{throw new v}catch(n){t=n}return t&&(e=t.sourceURL||t.fileName||N(t.stack)),e},W=function(){var e,t,n;if(l.currentScript&&(e=l.currentScript.src))return e;if(t=l.getElementsByTagName("script"),1===t.length)return t[0].src||o;if("readyState"in t[0])for(n=t.length;n--;)if("interactive"===t[n].readyState&&(e=t[n].src))return e;return"loading"===l.readyState&&(e=t[t.length-1].src)?e:(e=L())?e:o},I=function(){var e,t,n,r=l.getElementsByTagName("script");for(e=r.length;e--;){if(!(n=r[e].src)){t=null;break}if(n=P(n),null==t)t=n;else if(t!==n){t=null;break}}return t||o},j=function(){var e=P(W())||I()||"";return e+"ZeroClipboard.swf"},B=function(){return null==t.opener&&(!!t.top&&t!=t.top||!!t.parent&&t!=t.parent)}(),F={bridge:null,version:"0.0.0",pluginType:"unknown",disabled:null,outdated:null,sandboxed:null,unavailable:null,degraded:null,deactivated:null,overdue:null,ready:null},V="11.0.0",z={},Y={},U=null,G=0,$=0,K={ready:"Flash communication is established",error:{"flash-disabled":"Flash is disabled or not installed. May also be attempting to run Flash in a sandboxed iframe, which is impossible.","flash-outdated":"Flash is too outdated to support ZeroClipboard","flash-sandboxed":"Attempting to run Flash in a sandboxed iframe, which is impossible","flash-unavailable":"Flash is unable to communicate bidirectionally with JavaScript","flash-degraded":"Flash is unable to preserve data fidelity when communicating with JavaScript","flash-deactivated":"Flash is too outdated for your browser and/or is configured as click-to-activate.\nThis may also mean that the ZeroClipboard SWF object could not be loaded, so please check your `swfPath` configuration and/or network connectivity.\nMay also be attempting to run Flash in a sandboxed iframe, which is impossible.","flash-overdue":"Flash communication was established but NOT within the acceptable time limit","version-mismatch":"ZeroClipboard JS version number does not match ZeroClipboard SWF version number","clipboard-error":"At least one error was thrown while ZeroClipboard was attempting to inject your data into the clipboard","config-mismatch":"ZeroClipboard configuration does not match Flash's reality","swf-not-found":"The ZeroClipboard SWF object could not be loaded, so please check your `swfPath` configuration and/or network connectivity"}},X=["flash-unavailable","flash-degraded","flash-overdue","version-mismatch","config-mismatch","clipboard-error"],q=["flash-disabled","flash-outdated","flash-sandboxed","flash-unavailable","flash-degraded","flash-deactivated","flash-overdue"],Z=new RegExp("^flash-("+q.map(function(e){return e.replace(/^flash-/,"")}).join("|")+")$"),J=new RegExp("^flash-("+q.slice(1).map(function(e){return e.replace(/^flash-/,"")}).join("|")+")$"),Q={swfPath:j(),trustedDomains:t.location.host?[t.location.host]:[],cacheBust:!0,forceEnhancedClipboard:!1,flashLoadTimeout:3e4,autoActivate:!0,bubbleEvents:!0,containerId:"global-zeroclipboard-html-bridge",containerClass:"global-zeroclipboard-container",swfObjectId:"global-zeroclipboard-flash-bridge",hoverClass:"zeroclipboard-is-hover",activeClass:"zeroclipboard-is-active",forceHandCursor:!1,title:null,zIndex:999999999},ee=function(e){if("object"==typeof e&&null!==e)for(var t in e)if(S.call(e,t))if(/^(?:forceHandCursor|title|zIndex|bubbleEvents)$/.test(t))Q[t]=e[t];else if(null==F.bridge)if("containerId"===t||"swfObjectId"===t){if(!ge(e[t]))throw new Error("The specified `"+t+"` value is not valid as an HTML4 Element ID");Q[t]=e[t]}else Q[t]=e[t];{if("string"!=typeof e||!e)return k(Q);if(S.call(Q,e))return Q[e]}},te=function(){return $e(),{browser:H(u,["userAgent","platform","appName"]),flash:D(F,["bridge"]),zeroclipboard:{version:Xe.version,config:Xe.config()}}},ne=function(){return!!(F.disabled||F.outdated||F.sandboxed||F.unavailable||F.degraded||F.deactivated)},oe=function(e,t){var n,i,s,a={};if("string"==typeof e&&e)s=e.toLowerCase().split(/\s+/);else if("object"==typeof e&&e&&"undefined"==typeof t)for(n in e)S.call(e,n)&&"string"==typeof n&&n&&"function"==typeof e[n]&&Xe.on(n,e[n]);if(s&&s.length){for(n=0,i=s.length;i>n;n++)e=s[n].replace(/^on/,""),a[e]=!0,z[e]||(z[e]=[]),z[e].push(t);if(a.ready&&F.ready&&Xe.emit({type:"ready"}),a.error){for(n=0,i=q.length;i>n;n++)if(F[q[n].replace(/^flash-/,"")]===!0){Xe.emit({type:"error",name:q[n]});break}r!==o&&Xe.version!==r&&Xe.emit({type:"error",name:"version-mismatch",jsVersion:Xe.version,swfVersion:r})}}return Xe},re=function(e,t){var n,o,r,i,s;if(0===arguments.length)i=R(z);else if("string"==typeof e&&e)i=e.split(/\s+/);else if("object"==typeof e&&e&&"undefined"==typeof t)for(n in e)S.call(e,n)&&"string"==typeof n&&n&&"function"==typeof e[n]&&Xe.off(n,e[n]);if(i&&i.length)for(n=0,o=i.length;o>n;n++)if(e=i[n].toLowerCase().replace(/^on/,""),s=z[e],s&&s.length)if(t)for(r=s.indexOf(t);-1!==r;)s.splice(r,1),r=s.indexOf(t,r);else s.length=0;return Xe},ie=function(e){var t;return t="string"==typeof e&&e?k(z[e])||null:k(z)},se=function(e){var t,n,o;return e=me(e),e&&!_e(e)?"ready"===e.type&&F.overdue===!0?Xe.emit({type:"error",name:"flash-overdue"}):(t=M({},e),Ce.call(this,t),"copy"===e.type&&(o=De(Y),n=o.data,U=o.formatMap),n):void 0},ae=function(){var e=F.sandboxed;if($e(),"boolean"!=typeof F.ready&&(F.ready=!1),F.sandboxed!==e&&F.sandboxed===!0)F.ready=!1,Xe.emit({type:"error",name:"flash-sandboxed"});else if(!Xe.isFlashUnusable()&&null===F.bridge){var t=Q.flashLoadTimeout;"number"==typeof t&&t>=0&&(G=c(function(){"boolean"!=typeof F.deactivated&&(F.deactivated=!0),F.deactivated===!0&&Xe.emit({type:"error",name:"flash-deactivated"})},t)),F.overdue=!1,ke()}},le=function(){Xe.clearData(),Xe.blur(),Xe.emit("destroy"),He(),Xe.off()},ue=function(e,t){var n;if("object"==typeof e&&e&&"undefined"==typeof t)n=e,Xe.clearData();else{if("string"!=typeof e||!e)return;n={},n[e]=t}for(var o in n)"string"==typeof o&&o&&S.call(n,o)&&"string"==typeof n[o]&&n[o]&&(Y[o]=n[o])},ce=function(e){"undefined"==typeof e?(A(Y),U=null):"string"==typeof e&&S.call(Y,e)&&delete Y[e]},de=function(e){return"undefined"==typeof e?k(Y):"string"==typeof e&&S.call(Y,e)?Y[e]:void 0},he=function(e){if(e&&1===e.nodeType){i&&(je(i,Q.activeClass),i!==e&&je(i,Q.hoverClass)),i=e,Ie(e,Q.hoverClass);var t=e.getAttribute("title")||Q.title;if("string"==typeof t&&t){var n=Me(F.bridge);n&&n.setAttribute("title",t)}var o=Q.forceHandCursor===!0||"pointer"===Be(e,"cursor");Ue(o),Ye()}},fe=function(){var e=Me(F.bridge);e&&(e.removeAttribute("title"),e.style.left="0px",e.style.top="-9999px",e.style.width="1px",e.style.height="1px"),i&&(je(i,Q.hoverClass),je(i,Q.activeClass),i=null)},pe=function(){return i||null},ge=function(e){return"string"==typeof e&&e&&/^[A-Za-z][A-Za-z0-9_:\-\.]*$/.test(e)},me=function(e){var t;if("string"==typeof e&&e?(t=e,e={}):"object"==typeof e&&e&&"string"==typeof e.type&&e.type&&(t=e.type),t){t=t.toLowerCase(),!e.target&&(/^(copy|aftercopy|_click)$/.test(t)||"error"===t&&"clipboard-error"===e.name)&&(e.target=s),M(e,{type:t,target:e.target||i||null,relatedTarget:e.relatedTarget||null,currentTarget:F&&F.bridge||null,timeStamp:e.timeStamp||C()||null});var n=K[e.type];return"error"===e.type&&e.name&&n&&(n=n[e.name]),n&&(e.message=n),"ready"===e.type&&M(e,{target:null,version:F.version}),"error"===e.type&&(Z.test(e.name)&&M(e,{target:null,minimumVersion:V}),J.test(e.name)&&M(e,{version:F.version})),"copy"===e.type&&(e.clipboardData={setData:Xe.setData,clearData:Xe.clearData}),"aftercopy"===e.type&&(e=Ae(e,U)),e.target&&!e.relatedTarget&&(e.relatedTarget=ve(e.target)),we(e)}},ve=function(e){var t=e&&e.getAttribute&&e.getAttribute("data-clipboard-target");return t?l.getElementById(t):null},we=function(e){if(e&&/^_(?:click|mouse(?:over|out|down|up|move))$/.test(e.type)){var t=e.target,n="_mouseover"===e.type&&e.relatedTarget?e.relatedTarget:o,r="_mouseout"===e.type&&e.relatedTarget?e.relatedTarget:o,i=Fe(t),s=a.screenLeft||a.screenX||0,u=a.screenTop||a.screenY||0,c=l.body.scrollLeft+l.documentElement.scrollLeft,d=l.body.scrollTop+l.documentElement.scrollTop,h=i.left+("number"==typeof e._stageX?e._stageX:0),f=i.top+("number"==typeof e._stageY?e._stageY:0),p=h-c,g=f-d,m=s+p,v=u+g,w="number"==typeof e.movementX?e.movementX:0,y="number"==typeof e.movementY?e.movementY:0;delete e._stageX,delete e._stageY,M(e,{srcElement:t,fromElement:n,toElement:r,screenX:m,screenY:v,pageX:h,pageY:f,clientX:p,clientY:g,x:p,y:g,movementX:w,movementY:y,offsetX:0,offsetY:0,layerX:0,layerY:0})}return e},ye=function(e){var t=e&&"string"==typeof e.type&&e.type||"";return!/^(?:(?:before)?copy|destroy)$/.test(t)},be=function(e,t,n,o){o?c(function(){e.apply(t,n)},0):e.apply(t,n)},Ce=function(e){if("object"==typeof e&&e&&e.type){var t=ye(e),n=z["*"]||[],o=z[e.type]||[],r=n.concat(o);if(r&&r.length){var i,s,l,u,c,d=this;for(i=0,s=r.length;s>i;i++)l=r[i],u=d,"string"==typeof l&&"function"==typeof a[l]&&(l=a[l]),"object"==typeof l&&l&&"function"==typeof l.handleEvent&&(u=l,l=l.handleEvent),"function"==typeof l&&(c=M({},e),be(l,u,[c],t))}return this}},Re=function(e){var t=null;return(B===!1||e&&"error"===e.type&&e.name&&-1!==X.indexOf(e.name))&&(t=!1),t},_e=function(e){var t=e.target||i||null,n="swf"===e._source;switch(delete e._source,e.type){case"error":var o="flash-sandboxed"===e.name||Re(e);"boolean"==typeof o&&(F.sandboxed=o),-1!==q.indexOf(e.name)?M(F,{disabled:"flash-disabled"===e.name,outdated:"flash-outdated"===e.name,unavailable:"flash-unavailable"===e.name,degraded:"flash-degraded"===e.name,deactivated:"flash-deactivated"===e.name,overdue:"flash-overdue"===e.name,ready:!1}):"version-mismatch"===e.name&&(r=e.swfVersion,M(F,{disabled:!1,outdated:!1,unavailable:!1,degraded:!1,deactivated:!1,overdue:!1,ready:!1})),ze();break;case"ready":r=e.swfVersion;var a=F.deactivated===!0;M(F,{disabled:!1,outdated:!1,sandboxed:!1,unavailable:!1,degraded:!1,deactivated:!1,overdue:a,ready:!a}),ze();break;case"beforecopy":s=t;break;case"copy":var l,u,c=e.relatedTarget;!Y["text/html"]&&!Y["text/plain"]&&c&&(u=c.value||c.outerHTML||c.innerHTML)&&(l=c.value||c.textContent||c.innerText)?(e.clipboardData.clearData(),e.clipboardData.setData("text/plain",l),u!==l&&e.clipboardData.setData("text/html",u)):!Y["text/plain"]&&e.target&&(l=e.target.getAttribute("data-clipboard-text"))&&(e.clipboardData.clearData(),e.clipboardData.setData("text/plain",l));break;case"aftercopy":Se(e),Xe.clearData(),t&&t!==We()&&t.focus&&t.focus();break;case"_mouseover":Xe.focus(t),Q.bubbleEvents===!0&&n&&(t&&t!==e.relatedTarget&&!x(e.relatedTarget,t)&&Ee(M({},e,{type:"mouseenter",bubbles:!1,cancelable:!1})),Ee(M({},e,{type:"mouseover"})));break;case"_mouseout":Xe.blur(),Q.bubbleEvents===!0&&n&&(t&&t!==e.relatedTarget&&!x(e.relatedTarget,t)&&Ee(M({},e,{type:"mouseleave",bubbles:!1,cancelable:!1})),Ee(M({},e,{type:"mouseout"})));break;case"_mousedown":Ie(t,Q.activeClass),Q.bubbleEvents===!0&&n&&Ee(M({},e,{type:e.type.slice(1)}));break;case"_mouseup":je(t,Q.activeClass),Q.bubbleEvents===!0&&n&&Ee(M({},e,{type:e.type.slice(1)}));break;case"_click":s=null,Q.bubbleEvents===!0&&n&&Ee(M({},e,{type:e.type.slice(1)}));break;case"_mousemove":Q.bubbleEvents===!0&&n&&Ee(M({},e,{type:e.type.slice(1)}))}return/^_(?:click|mouse(?:over|out|down|up|move))$/.test(e.type)?!0:void 0},Se=function(e){if(e.errors&&e.errors.length>0){var t=k(e);M(t,{type:"error",name:"clipboard-error"}),delete t.success,c(function(){Xe.emit(t)},0)}},Ee=function(e){if(e&&"string"==typeof e.type&&e){var t,n=e.target||null,o=n&&n.ownerDocument||l,r={view:o.defaultView||a,canBubble:!0,cancelable:!0,detail:"click"===e.type?1:0,button:"number"==typeof e.which?e.which-1:"number"==typeof e.button?e.button:o.createEvent?0:1},i=M(r,e);n&&o.createEvent&&n.dispatchEvent&&(i=[i.type,i.canBubble,i.cancelable,i.view,i.detail,i.screenX,i.screenY,i.clientX,i.clientY,i.ctrlKey,i.altKey,i.shiftKey,i.metaKey,i.button,i.relatedTarget],t=o.createEvent("MouseEvents"),t.initMouseEvent&&(t.initMouseEvent.apply(t,i),t._source="js",n.dispatchEvent(t)))}},Te=function(){var e=Q.flashLoadTimeout;if("number"==typeof e&&e>=0){var t=Math.min(1e3,e/10),n=Q.swfObjectId+"_fallbackContent";$=h(function(){var e=l.getElementById(n);Ve(e)&&(ze(),F.deactivated=null,Xe.emit({type:"error",name:"swf-not-found"}))},t)}},Oe=function(){var e=l.createElement("div");return e.id=Q.containerId,e.className=Q.containerClass,e.style.position="absolute",e.style.left="0px",e.style.top="-9999px",e.style.width="1px",e.style.height="1px",e.style.zIndex=""+Ge(Q.zIndex),e},Me=function(e){for(var t=e&&e.parentNode;t&&"OBJECT"===t.nodeName&&t.parentNode;)t=t.parentNode;return t||null},ke=function(){var e,t=F.bridge,n=Me(t);if(!t){var o=Le(a.location.host,Q),r="never"===o?"none":"all",i=Pe(M({jsVersion:Xe.version},Q)),s=Q.swfPath+xe(Q.swfPath,Q);n=Oe();var u=l.createElement("div");n.appendChild(u),l.body.appendChild(n);var c=l.createElement("div"),d="activex"===F.pluginType;c.innerHTML='"+(d?'':"")+'
 
',t=c.firstChild,c=null,T(t).ZeroClipboard=Xe,n.replaceChild(t,u),Te()}return t||(t=l[Q.swfObjectId],t&&(e=t.length)&&(t=t[e-1]),!t&&n&&(t=n.firstChild)),F.bridge=t||null,t},He=function(){var e=F.bridge;if(e){var t=Me(e);t&&("activex"===F.pluginType&&"readyState"in e?(e.style.display="none",function n(){if(4===e.readyState){for(var o in e)"function"==typeof e[o]&&(e[o]=null);e.parentNode&&e.parentNode.removeChild(e),t.parentNode&&t.parentNode.removeChild(t)}else c(n,10)}()):(e.parentNode&&e.parentNode.removeChild(e),t.parentNode&&t.parentNode.removeChild(t))),ze(),F.ready=null,F.bridge=null,F.deactivated=null,r=o}},De=function(e){var t={},n={};if("object"==typeof e&&e){for(var o in e)if(o&&S.call(e,o)&&"string"==typeof e[o]&&e[o])switch(o.toLowerCase()){case"text/plain":case"text":case"air:text":case"flash:text":t.text=e[o],n.text=o;break;case"text/html":case"html":case"air:html":case"flash:html":t.html=e[o],n.html=o;break;case"application/rtf":case"text/rtf":case"rtf":case"richtext":case"air:rtf":case"flash:rtf":t.rtf=e[o],n.rtf=o}return{data:t,formatMap:n}}},Ae=function(e,t){if("object"!=typeof e||!e||"object"!=typeof t||!t)return e;var n={};for(var o in e)if(S.call(e,o))if("errors"===o){n[o]=e[o]?e[o].slice():[];for(var r=0,i=n[o].length;i>r;r++)n[o][r].format=t[n[o][r].format]}else if("success"!==o&&"data"!==o)n[o]=e[o];else{n[o]={};var s=e[o];for(var a in s)a&&S.call(s,a)&&S.call(t,a)&&(n[o][t[a]]=s[a])}return n},xe=function(e,t){var n=null==t||t&&t.cacheBust===!0;return n?(-1===e.indexOf("?")?"?":"&")+"noCache="+C():""},Pe=function(e){var t,n,o,r,i="",s=[];if(e.trustedDomains&&("string"==typeof e.trustedDomains?r=[e.trustedDomains]:"object"==typeof e.trustedDomains&&"length"in e.trustedDomains&&(r=e.trustedDomains)),r&&r.length)for(t=0,n=r.length;n>t;t++)if(S.call(r,t)&&r[t]&&"string"==typeof r[t]){if(o=Ne(r[t]),!o)continue;if("*"===o){s.length=0,s.push(o);break}s.push.apply(s,[o,"//"+o,a.location.protocol+"//"+o])}return s.length&&(i+="trustedOrigins="+g(s.join(","))),e.forceEnhancedClipboard===!0&&(i+=(i?"&":"")+"forceEnhancedClipboard=true"),"string"==typeof e.swfObjectId&&e.swfObjectId&&(i+=(i?"&":"")+"swfObjectId="+g(e.swfObjectId)),"string"==typeof e.jsVersion&&e.jsVersion&&(i+=(i?"&":"")+"jsVersion="+g(e.jsVersion)),i},Ne=function(e){if(null==e||""===e)return null;if(e=e.replace(/^\s+|\s+$/g,""),""===e)return null;var t=e.indexOf("//");e=-1===t?e:e.slice(t+2);var n=e.indexOf("/");return e=-1===n?e:-1===t||0===n?null:e.slice(0,n),e&&".swf"===e.slice(-4).toLowerCase()?null:e||null},Le=function(){var e=function(e){var t,n,o,r=[];if("string"==typeof e&&(e=[e]),"object"!=typeof e||!e||"number"!=typeof e.length)return r;for(t=0,n=e.length;n>t;t++)if(S.call(e,t)&&(o=Ne(e[t]))){if("*"===o){r.length=0,r.push("*");break}-1===r.indexOf(o)&&r.push(o)}return r};return function(t,n){var o=Ne(n.swfPath);null===o&&(o=t);var r=e(n.trustedDomains),i=r.length;if(i>0){if(1===i&&"*"===r[0])return"always";if(-1!==r.indexOf(t))return 1===i&&t===o?"sameDomain":"always"}return"never"}}(),We=function(){try{return l.activeElement}catch(e){return null}},Ie=function(e,t){var n,o,r,i=[];if("string"==typeof t&&t&&(i=t.split(/\s+/)),e&&1===e.nodeType&&i.length>0)if(e.classList)for(n=0,o=i.length;o>n;n++)e.classList.add(i[n]);else if(e.hasOwnProperty("className")){for(r=" "+e.className+" ",n=0,o=i.length;o>n;n++)-1===r.indexOf(" "+i[n]+" ")&&(r+=i[n]+" ");e.className=r.replace(/^\s+|\s+$/g,"")}return e},je=function(e,t){var n,o,r,i=[];if("string"==typeof t&&t&&(i=t.split(/\s+/)),e&&1===e.nodeType&&i.length>0)if(e.classList&&e.classList.length>0)for(n=0,o=i.length;o>n;n++)e.classList.remove(i[n]);else if(e.className){for(r=(" "+e.className+" ").replace(/[\r\n\t]/g," "),n=0,o=i.length;o>n;n++)r=r.replace(" "+i[n]+" "," ");e.className=r.replace(/^\s+|\s+$/g,"")}return e},Be=function(e,t){var n=p(e,null).getPropertyValue(t);return"cursor"!==t||n&&"auto"!==n||"A"!==e.nodeName?n:"pointer"},Fe=function(e){var t={left:0,top:0,width:0,height:0};if(e.getBoundingClientRect){var n=e.getBoundingClientRect(),o=a.pageXOffset,r=a.pageYOffset,i=l.documentElement.clientLeft||0,s=l.documentElement.clientTop||0,u=0,c=0;if("relative"===Be(l.body,"position")){var d=l.body.getBoundingClientRect(),h=l.documentElement.getBoundingClientRect();u=d.left-h.left||0,c=d.top-h.top||0}t.left=n.left+o-i-u,t.top=n.top+r-s-c,t.width="width"in n?n.width:n.right-n.left,t.height="height"in n?n.height:n.bottom-n.top}return t},Ve=function(e){if(!e)return!1;var t=p(e,null),n=y(t.height)>0,o=y(t.width)>0,r=y(t.top)>=0,i=y(t.left)>=0,s=n&&o&&r&&i,a=s?null:Fe(e),l="none"!==t.display&&"collapse"!==t.visibility&&(s||!!a&&(n||a.height>0)&&(o||a.width>0)&&(r||a.top>=0)&&(i||a.left>=0));return l},ze=function(){d(G),G=0,f($),$=0},Ye=function(){var e;if(i&&(e=Me(F.bridge))){var t=Fe(i);M(e.style,{width:t.width+"px",height:t.height+"px",top:t.top+"px",left:t.left+"px",zIndex:""+Ge(Q.zIndex)})}},Ue=function(e){F.ready===!0&&(F.bridge&&"function"==typeof F.bridge.setHandCursor?F.bridge.setHandCursor(e):F.ready=!1)},Ge=function(e){if(/^(?:auto|inherit)$/.test(e))return e;var t;return"number"!=typeof e||b(e)?"string"==typeof e&&(t=Ge(w(e,10))):t=e,"number"==typeof t?t:"auto"},$e=function(e){var n,o,r,i=F.sandboxed,s=null;if(e=e===!0,B===!1)s=!1;else{try{o=t.frameElement||null}catch(a){r={name:a.name,message:a.message}}if(o&&1===o.nodeType&&"IFRAME"===o.nodeName)try{s=o.hasAttribute("sandbox")}catch(a){s=null}else{try{n=document.domain||null}catch(a){n=null}(null===n||r&&"SecurityError"===r.name&&/(^|[\s\(\[@])sandbox(es|ed|ing|[\s\.,!\)\]@]|$)/.test(r.message.toLowerCase()))&&(s=!0)}}return F.sandboxed=s,i===s||e||Ke(m),s},Ke=function(e){function t(e){var t=e.match(/[\d]+/g);return t.length=3,t.join(".")}function n(e){return!!e&&(e=e.toLowerCase())&&(/^(pepflashplayer\.dll|libpepflashplayer\.so|pepperflashplayer\.plugin)$/.test(e)||"chrome.plugin"===e.slice(-13))}function o(e){e&&(a=!0,e.version&&(d=t(e.version)),!d&&e.description&&(d=t(e.description)),e.filename&&(c=n(e.filename)))}var r,i,s,a=!1,l=!1,c=!1,d="";if(u.plugins&&u.plugins.length)r=u.plugins["Shockwave Flash"],o(r),u.plugins["Shockwave Flash 2.0"]&&(a=!0,d="2.0.0.11");else if(u.mimeTypes&&u.mimeTypes.length)s=u.mimeTypes["application/x-shockwave-flash"],r=s&&s.enabledPlugin,o(r);else if("undefined"!=typeof e){l=!0;try{i=new e("ShockwaveFlash.ShockwaveFlash.7"),a=!0,d=t(i.GetVariable("$version"))}catch(h){try{i=new e("ShockwaveFlash.ShockwaveFlash.6"),a=!0,d="6.0.21"}catch(f){try{i=new e("ShockwaveFlash.ShockwaveFlash"),a=!0,d=t(i.GetVariable("$version"))}catch(p){l=!1}}}}F.disabled=a!==!0,F.outdated=d&&y(d)n;n++)e=s[n].replace(/^on/,""),a[e]=!0,u[e]||(u[e]=[]),u[e].push(t);if(a.ready&&F.ready&&this.emit({type:"ready",client:this}),a.error){for(n=0,i=q.length;i>n;n++)if(F[q[n].replace(/^flash-/,"")]){this.emit({type:"error",name:q[n],client:this});break}r!==o&&Xe.version!==r&&this.emit({type:"error",name:"version-mismatch",jsVersion:Xe.version,swfVersion:r})}}return this},ot=function(e,t){var n,o,r,i,s,a=Ze[this.id],l=a&&a.handlers;if(!l)return this;if(0===arguments.length)i=R(l);else if("string"==typeof e&&e)i=e.split(/\s+/);else if("object"==typeof e&&e&&"undefined"==typeof t)for(n in e)S.call(e,n)&&"string"==typeof n&&n&&"function"==typeof e[n]&&this.off(n,e[n]);if(i&&i.length)for(n=0,o=i.length;o>n;n++)if(e=i[n].toLowerCase().replace(/^on/,""),s=l[e],s&&s.length)if(t)for(r=s.indexOf(t);-1!==r;)s.splice(r,1),r=s.indexOf(t,r);else s.length=0;return this},rt=function(e){var t=null,n=Ze[this.id]&&Ze[this.id].handlers;return n&&(t="string"==typeof e&&e?n[e]?n[e].slice(0):[]:k(n)),t},it=function(e){if(ct.call(this,e)){"object"==typeof e&&e&&"string"==typeof e.type&&e.type&&(e=M({},e));var t=M({},me(e),{client:this});dt.call(this,t)}return this},st=function(e){if(!Ze[this.id])throw new Error("Attempted to clip element(s) to a destroyed ZeroClipboard client instance");e=ht(e);for(var t=0;t0,r=!e.target||o&&-1!==n.indexOf(e.target),i=e.relatedTarget&&o&&-1!==n.indexOf(e.relatedTarget),s=e.client&&e.client===this;return t&&(r||i||s)?!0:!1},dt=function(e){var t=Ze[this.id];if("object"==typeof e&&e&&e.type&&t){var n=ye(e),o=t&&t.handlers["*"]||[],r=t&&t.handlers[e.type]||[],i=o.concat(r);if(i&&i.length){var s,l,u,c,d,h=this;for(s=0,l=i.length;l>s;s++)u=i[s],c=h,"string"==typeof u&&"function"==typeof a[u]&&(u=a[u]),"object"==typeof u&&u&&"function"==typeof u.handleEvent&&(c=u,u=u.handleEvent),"function"==typeof u&&(d=M({},e),be(u,c,[d],n))}}},ht=function(e){return"string"==typeof e&&(e=[]),"number"!=typeof e.length?[e]:e},ft=function(e){if(e&&1===e.nodeType){var t=function(e){(e||(e=a.event))&&("js"!==e._source&&(e.stopImmediatePropagation(),e.preventDefault()),delete e._source)},n=function(n){(n||(n=a.event))&&(t(n),Xe.focus(e))};e.addEventListener("mouseover",n,!1),e.addEventListener("mouseout",t,!1),e.addEventListener("mouseenter",t,!1),e.addEventListener("mouseleave",t,!1),e.addEventListener("mousemove",t,!1),et[e.zcClippingId]={mouseover:n,mouseout:t,mouseenter:t,mouseleave:t,mousemove:t}}},pt=function(e){if(e&&1===e.nodeType){var t=et[e.zcClippingId];if("object"==typeof t&&t){for(var n,o,r=["move","leave","enter","out","over"],i=0,s=r.length;s>i;i++)n="mouse"+r[i],o=t[n],"function"==typeof o&&e.removeEventListener(n,o,!1);delete et[e.zcClippingId]}}};Xe._createClient=function(){tt.apply(this,O(arguments))},Xe.prototype.on=function(){return nt.apply(this,O(arguments))},Xe.prototype.off=function(){return ot.apply(this,O(arguments))},Xe.prototype.handlers=function(){return rt.apply(this,O(arguments))},Xe.prototype.emit=function(){return it.apply(this,O(arguments))},Xe.prototype.clip=function(){return st.apply(this,O(arguments))},Xe.prototype.unclip=function(){return at.apply(this,O(arguments))},Xe.prototype.elements=function(){return lt.apply(this,O(arguments))},Xe.prototype.destroy=function(){return ut.apply(this,O(arguments))},Xe.prototype.setText=function(e){if(!Ze[this.id])throw new Error("Attempted to set pending clipboard data from a destroyed ZeroClipboard client instance");return Xe.setData("text/plain",e),this},Xe.prototype.setHtml=function(e){if(!Ze[this.id])throw new Error("Attempted to set pending clipboard data from a destroyed ZeroClipboard client instance");return Xe.setData("text/html",e),this},Xe.prototype.setRichText=function(e){if(!Ze[this.id])throw new Error("Attempted to set pending clipboard data from a destroyed ZeroClipboard client instance");return Xe.setData("application/rtf",e),this},Xe.prototype.setData=function(){if(!Ze[this.id])throw new Error("Attempted to set pending clipboard data from a destroyed ZeroClipboard client instance");return Xe.setData.apply(this,O(arguments)),this},Xe.prototype.clearData=function(){if(!Ze[this.id])throw new Error("Attempted to clear pending clipboard data from a destroyed ZeroClipboard client instance");return Xe.clearData.apply(this,O(arguments)),this},Xe.prototype.getData=function(){if(!Ze[this.id])throw new Error("Attempted to get pending clipboard data from a destroyed ZeroClipboard client instance");return Xe.getData.apply(this,O(arguments))},"function"==typeof e&&e.amd?e(function(){return Xe}):"object"==typeof n&&n&&"object"==typeof n.exports&&n.exports?n.exports=Xe:t.ZeroClipboard=Xe}(function(){return this||window}())},{}]},{},[23,59,61,60,62,83,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,84,85,86,87,100,101,102,90,91,92,93,94,95,31,35,32,33,40,34,36,37,38,39])("zeroclipboard")}); \ No newline at end of file diff --git a/bower_components/handsontable/dist/handsontable.js b/bower_components/handsontable/dist/handsontable.js index 61265d5..5f263e5 100644 --- a/bower_components/handsontable/dist/handsontable.js +++ b/bower_components/handsontable/dist/handsontable.js @@ -1187,7 +1187,7 @@ var Walkontable = function Walkontable(settings) { } } else if (coords.col < fixedColumns) { return this.wtOverlays.leftOverlay.clone.wtTable.getCell(coords); - } else if (coords.row >= totalRows - fixedRowsBottom) { + } else if (coords.row > totalRows - fixedRowsBottom) { if (this.wtOverlays.bottomOverlay.clone) { return this.wtOverlays.bottomOverlay.clone.wtTable.getCell(coords); } @@ -1698,7 +1698,7 @@ var $WalkontableLeftOverlay = WalkontableLeftOverlay; } }, onScroll: function() { - this.wot.getSetting('onScrollHorizontally'); + this.wot.getSetting('onScrollVertically'); }, sumCellSizes: function(from, to) { var sum = 0; @@ -1881,7 +1881,7 @@ var $WalkontableTopOverlay = WalkontableTopOverlay; } }, onScroll: function() { - this.wot.getSetting('onScrollVertically'); + this.wot.getSetting('onScrollHorizontally'); }, sumCellSizes: function(from, to) { var sum = 0; @@ -2135,6 +2135,9 @@ var WalkontableOverlays = function WalkontableOverlays(wotInstance) { left: null } }; + this.verticalScrolling = false; + this.horizontalScrolling = false; + this.delegatedScrollCallback = false; this.registerListeners(); }; ($traceurRuntime.createClass)(WalkontableOverlays, { @@ -2147,8 +2150,14 @@ var WalkontableOverlays = function WalkontableOverlays(wotInstance) { return; } this.wot.draw(true); - this.topOverlay.onScroll(); - this.leftOverlay.onScroll(); + if (this.verticalScrolling) { + this.leftOverlay.onScroll(); + } + if (this.horizontalScrolling) { + this.topOverlay.onScroll(); + } + this.verticalScrolling = false; + this.horizontalScrolling = false; }, registerListeners: function() { var $__3 = this; @@ -2271,6 +2280,7 @@ var WalkontableOverlays = function WalkontableOverlays(wotInstance) { var topOverlay; var leftOverlay; var bottomOverlay; + var delegatedScroll = false; if (this.topOverlay.needFullRender) { topOverlay = this.topOverlay.clone.wtTable.holder; } @@ -2286,26 +2296,32 @@ var WalkontableOverlays = function WalkontableOverlays(wotInstance) { if (target === master) { tempScrollValue = getScrollLeft(target); if (this.overlayScrollPositions.master.left !== tempScrollValue) { + this.horizontalScrolling = true; this.overlayScrollPositions.master.left = tempScrollValue; scrollValueChanged = true; if (topOverlay) { topOverlay.scrollLeft = tempScrollValue; + delegatedScroll = (this.mainTableScrollableElement !== window); } if (bottomOverlay) { bottomOverlay.scrollLeft = tempScrollValue; + delegatedScroll = (this.mainTableScrollableElement !== window); } } tempScrollValue = getScrollTop(target); if (this.overlayScrollPositions.master.top !== tempScrollValue) { + this.verticalScrolling = true; this.overlayScrollPositions.master.top = tempScrollValue; scrollValueChanged = true; if (leftOverlay) { leftOverlay.scrollTop = tempScrollValue; + delegatedScroll = (this.mainTableScrollableElement !== window); } } } else if (target === bottomOverlay) { tempScrollValue = getScrollLeft(target); if (this.overlayScrollPositions.bottom.left !== tempScrollValue) { + this.horizontalScrolling = true; this.overlayScrollPositions.bottom.left = tempScrollValue; scrollValueChanged = true; master.scrollLeft = tempScrollValue; @@ -2317,6 +2333,7 @@ var WalkontableOverlays = function WalkontableOverlays(wotInstance) { } else if (target === topOverlay) { tempScrollValue = getScrollLeft(target); if (this.overlayScrollPositions.top.left !== tempScrollValue) { + this.horizontalScrolling = true; this.overlayScrollPositions.top.left = tempScrollValue; scrollValueChanged = true; master.scrollLeft = tempScrollValue; @@ -2328,6 +2345,7 @@ var WalkontableOverlays = function WalkontableOverlays(wotInstance) { } else if (target === leftOverlay) { tempScrollValue = getScrollTop(target); if (this.overlayScrollPositions.left.top !== tempScrollValue) { + this.verticalScrolling = true; this.overlayScrollPositions.left.top = tempScrollValue; scrollValueChanged = true; master.scrollTop = tempScrollValue; @@ -2338,7 +2356,14 @@ var WalkontableOverlays = function WalkontableOverlays(wotInstance) { } } if (!this.keyPressed && scrollValueChanged && event.type === 'scroll') { - this.refreshAll(); + if (this.delegatedScrollCallback) { + this.delegatedScrollCallback = false; + } else { + this.refreshAll(); + } + if (delegatedScroll) { + this.delegatedScrollCallback = true; + } } }, syncScrollWithMaster: function() { @@ -3823,9 +3848,9 @@ var domHelpers = ($__helpers_47_dom_47_element__ = require("helpers/dom/element" var domEventHelpers = ($__helpers_47_dom_47_event__ = require("helpers/dom/event"), $__helpers_47_dom_47_event__ && $__helpers_47_dom_47_event__.__esModule && $__helpers_47_dom_47_event__ || {default: $__helpers_47_dom_47_event__}); var HELPERS = [arrayHelpers, browserHelpers, dataHelpers, functionHelpers, mixedHelpers, numberHelpers, objectHelpers, settingHelpers, stringHelpers, unicodeHelpers]; var DOM = [domHelpers, domEventHelpers]; -Handsontable.buildDate = 'Thu Nov 19 2015 10:51:56 GMT+0100 (CET)'; +Handsontable.buildDate = 'Fri Dec 04 2015 11:56:12 GMT+0100 (CET)'; Handsontable.packageName = 'handsontable'; -Handsontable.version = '0.20.1'; +Handsontable.version = '0.20.2'; var baseVersion = '@@baseVersion'; if (!/^@@/.test(baseVersion)) { Handsontable.baseVersion = baseVersion; @@ -5518,6 +5543,9 @@ Handsontable.Core = function Core(rootElement, userSettings) { this.addHook = function(key, callback) { Handsontable.hooks.add(key, callback, instance); }; + this.hasHook = function(key) { + return Handsontable.hooks.has(key, instance); + }; this.addHookOnce = function(key, callback) { Handsontable.hooks.once(key, callback, instance); }; @@ -7796,6 +7824,9 @@ SelectEditor.prototype.init = function() { }; SelectEditor.prototype.registerHooks = function() { var $__5 = this; + this.instance.addHook('afterScrollHorizontally', (function() { + return $__5.refreshDimensions(); + })); this.instance.addHook('afterScrollVertically', (function() { return $__5.refreshDimensions(); })); @@ -8261,6 +8292,9 @@ TextEditor.prototype.bindEvents = function() { this.eventManager.addEventListener(this.TEXTAREA, 'paste', function(event) { stopPropagation(event); }); + this.instance.addHook('afterScrollHorizontally', function() { + editor.refreshDimensions(); + }); this.instance.addHook('afterScrollVertically', function() { editor.refreshDimensions(); }); @@ -9870,7 +9904,7 @@ function deepClone(obj) { function clone(object) { var result = {}; objectEach(object, (function(value, key) { - return result[key] = value; + result[key] = value; })); return result; } @@ -10019,6 +10053,12 @@ Object.defineProperties(exports, { isPercentValue: {get: function() { return isPercentValue; }}, + substitute: {get: function() { + return substitute; + }}, + padStart: {get: function() { + return padStart; + }}, __esModule: {value: true} }); var $__mixed__, @@ -10075,6 +10115,36 @@ function randomString() { function isPercentValue(value) { return /^([0-9][0-9]?\%$)|(^100\%$)/.test(value); } +function substitute(template) { + var variables = arguments[1] !== (void 0) ? arguments[1] : {}; + return (template + '').replace(/(?:\\)?\[([^\[\]]+)]/g, function(match, name) { + if (match.charAt(0) === '\\') { + return match.substr(1, match.length - 1); + } + return variables[name] === void 0 ? '' : variables[name]; + }); +} +function padStart(string, maxLength) { + var fillString = arguments[2] !== (void 0) ? arguments[2] : ' '; + string = string + ''; + if (string.length >= maxLength) { + return string; + } + fillString = String(fillString); + var fillStringLength = fillString.length; + if (!fillStringLength) { + fillString = ' '; + } + var fillLen = maxLength - string.length; + var timesToRepeat = Math.ceil(fillLen / fillString.length); + var truncatedString = ''; + rangeEach(timesToRepeat, (function(index) { + truncatedString += fillString; + })); + truncatedString = truncatedString.slice(0, fillLen); + return truncatedString + string; +} +; //# },{"mixed":48,"number":49}],53:[function(require,module,exports){ @@ -10273,7 +10343,7 @@ Object.defineProperties(exports, { }); var $__helpers_47_array__, $__helpers_47_object__; -var REGISTERED_HOOKS = ['afterCellMetaReset', 'afterChange', 'afterChangesObserved', 'afterColumnMove', 'afterColumnResize', 'afterContextMenuDefaultOptions', 'afterContextMenuHide', 'afterContextMenuShow', 'afterCopyLimit', 'afterCreateCol', 'afterCreateRow', 'afterDeselect', 'afterDestroy', 'afterDocumentKeyDown', 'afterGetCellMeta', 'afterGetColHeader', 'afterGetRowHeader', 'afterInit', 'afterIsMultipleSelectionCheck', 'afterLoadData', 'afterMomentumScroll', 'afterOnCellCornerMouseDown', 'afterOnCellMouseDown', 'afterOnCellMouseOver', 'afterRemoveCol', 'afterRemoveRow', 'afterRender', 'afterRenderer', 'afterScrollHorizontally', 'afterScrollVertically', 'afterSelection', 'afterSelectionByProp', 'afterSelectionEnd', 'afterSelectionEndByProp', 'afterSetCellMeta', 'afterUpdateSettings', 'afterValidate', 'beforeAutofill', 'beforeCellAlignment', 'beforeChange', 'beforeChangeRender', 'beforeDrawBorders', 'beforeGetCellMeta', 'beforeInit', 'beforeInitWalkontable', 'beforeKeyDown', 'beforeOnCellMouseDown', 'beforeRemoveCol', 'beforeRemoveRow', 'beforeRender', 'beforeSetRangeEnd', 'beforeTouchScroll', 'beforeValidate', 'construct', 'init', 'modifyCol', 'modifyColumnHeader', 'modifyColWidth', 'modifyRow', 'modifyRowHeader', 'modifyRowHeight', 'persistentStateLoad', 'persistentStateReset', 'persistentStateSave', 'beforeColumnSort', 'afterColumnSort', 'afterAutofillApplyValues', 'modifyCopyableRange', 'beforeColumnMove', 'afterColumnMove', 'beforeRowMove', 'afterRowMove', 'beforeColumnResize', 'afterColumnResize', 'beforeRowResize', 'afterRowResize']; +var REGISTERED_HOOKS = ['afterCellMetaReset', 'afterChange', 'afterChangesObserved', 'afterContextMenuDefaultOptions', 'afterContextMenuHide', 'afterContextMenuShow', 'afterCopyLimit', 'afterCreateCol', 'afterCreateRow', 'afterDeselect', 'afterDestroy', 'afterDocumentKeyDown', 'afterGetCellMeta', 'afterGetColHeader', 'afterGetRowHeader', 'afterInit', 'afterLoadData', 'afterMomentumScroll', 'afterOnCellCornerMouseDown', 'afterOnCellMouseDown', 'afterOnCellMouseOver', 'afterRemoveCol', 'afterRemoveRow', 'afterRender', 'afterRenderer', 'afterScrollHorizontally', 'afterScrollVertically', 'afterSelection', 'afterSelectionByProp', 'afterSelectionEnd', 'afterSelectionEndByProp', 'afterSetCellMeta', 'afterUpdateSettings', 'afterValidate', 'beforeAutofill', 'beforeCellAlignment', 'beforeChange', 'beforeChangeRender', 'beforeDrawBorders', 'beforeGetCellMeta', 'beforeInit', 'beforeInitWalkontable', 'beforeKeyDown', 'beforeOnCellMouseDown', 'beforeRemoveCol', 'beforeRemoveRow', 'beforeRender', 'beforeSetRangeEnd', 'beforeTouchScroll', 'beforeValidate', 'construct', 'init', 'modifyCol', 'modifyColHeader', 'modifyColWidth', 'modifyRow', 'modifyRowHeader', 'modifyRowHeight', 'persistentStateLoad', 'persistentStateReset', 'persistentStateSave', 'beforeColumnSort', 'afterColumnSort', 'afterAutofillApplyValues', 'modifyCopyableRange', 'beforeColumnMove', 'afterColumnMove', 'beforeRowMove', 'afterRowMove', 'beforeColumnResize', 'afterColumnResize', 'beforeRowResize', 'afterRowResize']; var arrayEach = ($__helpers_47_array__ = require("helpers/array"), $__helpers_47_array__ && $__helpers_47_array__.__esModule && $__helpers_47_array__ || {default: $__helpers_47_array__}).arrayEach; var objectEach = ($__helpers_47_object__ = require("helpers/object"), $__helpers_47_object__ && $__helpers_47_object__.__esModule && $__helpers_47_object__ || {default: $__helpers_47_object__}).objectEach; var Hooks = function Hooks() { @@ -11964,6 +12034,9 @@ var $Comments = Comments; this.addHook('afterRenderer', (function(TD, row, col, prop, value, cellProperties) { return $__6.onAfterRenderer(TD, cellProperties); })); + this.addHook('afterScrollHorizontally', (function() { + return $__6.refreshEditorPosition(); + })); this.addHook('afterScrollVertically', (function() { return $__6.refreshEditorPosition(); })); @@ -12343,7 +12416,10 @@ var $ContextMenu = ContextMenu; $__11.hot.runHooks('afterContextMenuDefaultOptions', predefinedItems); $__11.itemsFactory.setPredefinedItems(predefinedItems.items); var menuItems = $__11.itemsFactory.getVisibleItems(settings); - $__11.menu = new Menu($__11.hot, {className: 'htContextMenu'}); + $__11.menu = new Menu($__11.hot, { + className: 'htContextMenu', + keepInViewport: true + }); $__11.menu.setMenuItems(menuItems); $__11.menu.addLocalHook('afterOpen', (function() { return $__11.onMenuAfterOpen(); diff --git a/bower_components/handsontable/dist/handsontable.min.js b/bower_components/handsontable/dist/handsontable.min.js index d7bfc92..3a56d00 100644 --- a/bower_components/handsontable/dist/handsontable.min.js +++ b/bower_components/handsontable/dist/handsontable.min.js @@ -24,16 +24,16 @@ TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -!function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var t;t="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this,t.Handsontable=e()}}(function(){var e;return function(e,t,n){return function o(e,t,n){function r(l,a){if(!t[l]){if(!e[l]){var u="function"==typeof require&&require;if(!a&&u)return u(l,!0);if(i)return i(l,!0);if(s[l]&&"undefined"!=typeof window[s[l]])return window[s[l]];var c=new Error("Cannot find module '"+l+"'");throw c.code="MODULE_NOT_FOUND",c}var d=t[l]={exports:{}};e[l][0].call(d.exports,function(t){var n=e[l][1][t];return r(n?n:t)},d,d.exports,o,e,t,n)}return t[l].exports}for(var i="function"==typeof require&&require,s=JSON.parse('{"zeroclipboard":"ZeroClipboard","moment":"moment","pikaday":"Pikaday"}')||{},l=0;l1)for(t=1,o=arguments.length;o>t;t++)r.push(arguments[t]);if(a){if("undefined"==typeof a[e])throw new Error("Handsontable do not provide action: "+e);i=a[e].apply(a,r),"destroy"===e&&l.removeData()}return i}}(window,jQuery,Handsontable)},{}],2:[function(e,t,n){"use strict";Object.defineProperties(n,{WalkontableBorder:{get:function(){return C}},__esModule:{value:!0}});var o,r,i,s,l,a=(o=e("helpers/dom/element"),o&&o.__esModule&&o||{"default":o}),u=a.getComputedStyle,c=a.getTrimmingContainer,d=a.innerWidth,h=a.innerHeight,f=a.offset,g=a.outerHeight,p=a.outerWidth,m=(r=e("helpers/dom/event"),r&&r.__esModule&&r||{"default":r}).stopImmediatePropagation,w=(i=e("eventManager"),i&&i.__esModule&&i||{"default":i}).EventManager,v=(s=e("cell/coords"),s&&s.__esModule&&s||{"default":s}).WalkontableCellCoords,b=(l=e("overlay/_base.js"),l&&l.__esModule&&l||{"default":l}).WalkontableOverlay,C=function(e,t){t&&(this.eventManager=new w(e),this.instance=e,this.wot=e,this.settings=t,this.mouseDown=!1,this.main=null,this.top=null,this.left=null,this.bottom=null,this.right=null,this.topStyle=null,this.leftStyle=null,this.bottomStyle=null,this.rightStyle=null,this.cornerDefaultStyle={width:"5px",height:"5px",borderWidth:"2px",borderStyle:"solid",borderColor:"#FFF"},this.corner=null,this.cornerStyle=null,this.createBorders(t),this.registerListeners())};$traceurRuntime.createClass(C,{registerListeners:function(){var e=this;this.eventManager.addEventListener(document.body,"mousedown",function(){return e.onMouseDown()}),this.eventManager.addEventListener(document.body,"mouseup",function(){return e.onMouseUp()});for(var t=this,n=function(n,o){t.eventManager.addEventListener(t.main.childNodes[n],"mouseenter",function(t){return e.onMouseEnter(t,e.main.childNodes[n])})},o=0,r=this.main.childNodes.length;r>o;o++)n(o,r)},onMouseDown:function(){this.mouseDown=!0},onMouseUp:function(){this.mouseDown=!1},onMouseEnter:function(e,t){function n(e){return e.clientYMath.ceil(i.top+i.height)?!0:e.clientXMath.ceil(i.left+i.width)?!0:void 0}function o(e){n(e)&&(r.eventManager.removeEventListener(document.body,"mousemove",o),t.style.display="block")}if(this.mouseDown&&this.wot.getSetting("hideBorderOnMouseDownOver")){e.preventDefault(),m(e);var r=this,i=t.getBoundingClientRect();t.style.display="none",this.eventManager.addEventListener(document.body,"mousemove",o)}},createBorders:function(e){this.main=document.createElement("div");var t=["top","left","bottom","right","corner"],n=this.main.style;n.position="absolute",n.top=0,n.left=0;for(var o=0;5>o;o++){var r=t[o],i=document.createElement("div");i.className="wtBorder "+(this.settings.className||""),this.settings[r]&&this.settings[r].hide&&(i.className+=" hidden"),n=i.style,n.backgroundColor=this.settings[r]&&this.settings[r].color?this.settings[r].color:e.border.color,n.height=this.settings[r]&&this.settings[r].width?this.settings[r].width+"px":e.border.width+"px",n.width=this.settings[r]&&this.settings[r].width?this.settings[r].width+"px":e.border.width+"px",this.main.appendChild(i)}this.top=this.main.childNodes[0],this.left=this.main.childNodes[1],this.bottom=this.main.childNodes[2],this.right=this.main.childNodes[3],this.topStyle=this.top.style,this.leftStyle=this.left.style,this.bottomStyle=this.bottom.style,this.rightStyle=this.right.style,this.corner=this.main.childNodes[4],this.corner.className+=" corner",this.cornerStyle=this.corner.style,this.cornerStyle.width=this.cornerDefaultStyle.width,this.cornerStyle.height=this.cornerDefaultStyle.height,this.cornerStyle.border=[this.cornerDefaultStyle.borderWidth,this.cornerDefaultStyle.borderStyle,this.cornerDefaultStyle.borderColor].join(" "),Handsontable.mobileBrowser&&this.createMultipleSelectorHandles(),this.disappear(),this.wot.wtTable.bordersHolder||(this.wot.wtTable.bordersHolder=document.createElement("div"),this.wot.wtTable.bordersHolder.className="htBorders",this.wot.wtTable.spreader.appendChild(this.wot.wtTable.bordersHolder)),this.wot.wtTable.bordersHolder.insertBefore(this.main,this.wot.wtTable.bordersHolder.firstChild)},createMultipleSelectorHandles:function(){this.selectionHandles={topLeft:document.createElement("DIV"),topLeftHitArea:document.createElement("DIV"),bottomRight:document.createElement("DIV"),bottomRightHitArea:document.createElement("DIV")};var e=10,t=40;this.selectionHandles.topLeft.className="topLeftSelectionHandle",this.selectionHandles.topLeftHitArea.className="topLeftSelectionHandle-HitArea",this.selectionHandles.bottomRight.className="bottomRightSelectionHandle",this.selectionHandles.bottomRightHitArea.className="bottomRightSelectionHandle-HitArea",this.selectionHandles.styles={topLeft:this.selectionHandles.topLeft.style,topLeftHitArea:this.selectionHandles.topLeftHitArea.style,bottomRight:this.selectionHandles.bottomRight.style,bottomRightHitArea:this.selectionHandles.bottomRightHitArea.style};var n={position:"absolute",height:t+"px",width:t+"px","border-radius":parseInt(t/1.5,10)+"px"};for(var o in n)n.hasOwnProperty(o)&&(this.selectionHandles.styles.bottomRightHitArea[o]=n[o],this.selectionHandles.styles.topLeftHitArea[o]=n[o]);var r={position:"absolute",height:e+"px",width:e+"px","border-radius":parseInt(e/1.5,10)+"px",background:"#F5F5FF",border:"1px solid #4285c8"};for(var i in r)r.hasOwnProperty(i)&&(this.selectionHandles.styles.bottomRight[i]=r[i],this.selectionHandles.styles.topLeft[i]=r[i]);this.main.appendChild(this.selectionHandles.topLeft),this.main.appendChild(this.selectionHandles.bottomRight),this.main.appendChild(this.selectionHandles.topLeftHitArea),this.main.appendChild(this.selectionHandles.bottomRightHitArea)},isPartRange:function(e,t){return!this.wot.selections.area.cellRange||e==this.wot.selections.area.cellRange.to.row&&t==this.wot.selections.area.cellRange.to.col?!1:!0},updateMultipleSelectionHandlesPosition:function(e,t,n,o,r,i){var s=parseInt(this.selectionHandles.styles.topLeft.width,10),l=parseInt(this.selectionHandles.styles.topLeftHitArea.width,10);this.selectionHandles.styles.topLeft.top=parseInt(n-s,10)+"px",this.selectionHandles.styles.topLeft.left=parseInt(o-s,10)+"px",this.selectionHandles.styles.topLeftHitArea.top=parseInt(n-l/4*3,10)+"px",this.selectionHandles.styles.topLeftHitArea.left=parseInt(o-l/4*3,10)+"px",this.selectionHandles.styles.bottomRight.top=parseInt(n+i,10)+"px",this.selectionHandles.styles.bottomRight.left=parseInt(o+r,10)+"px",this.selectionHandles.styles.bottomRightHitArea.top=parseInt(n+i-l/4,10)+"px",this.selectionHandles.styles.bottomRightHitArea.left=parseInt(o+r-l/4,10)+"px",this.settings.border.multipleSelectionHandlesVisible&&this.settings.border.multipleSelectionHandlesVisible()?(this.selectionHandles.styles.topLeft.display="block",this.selectionHandles.styles.topLeftHitArea.display="block",this.isPartRange(e,t)?(this.selectionHandles.styles.bottomRight.display="none",this.selectionHandles.styles.bottomRightHitArea.display="none"):(this.selectionHandles.styles.bottomRight.display="block",this.selectionHandles.styles.bottomRightHitArea.display="block")):(this.selectionHandles.styles.topLeft.display="none",this.selectionHandles.styles.bottomRight.display="none",this.selectionHandles.styles.topLeftHitArea.display="none",this.selectionHandles.styles.bottomRightHitArea.display="none"),e==this.wot.wtSettings.getSetting("fixedRowsTop")||t==this.wot.wtSettings.getSetting("fixedColumnsLeft")?(this.selectionHandles.styles.topLeft.zIndex="9999",this.selectionHandles.styles.topLeftHitArea.zIndex="9999"):(this.selectionHandles.styles.topLeft.zIndex="",this.selectionHandles.styles.topLeftHitArea.zIndex="")},appear:function(e){if(!this.disabled){var t,n,o,r,i,s,l,a,m,w,C,y,R,E,S,T,O,_,M;M=b.isOverlayTypeOf(this.wot.cloneOverlay,b.CLONE_TOP)||b.isOverlayTypeOf(this.wot.cloneOverlay,b.CLONE_TOP_LEFT_CORNER)?this.wot.getSetting("fixedRowsTop"):b.isOverlayTypeOf(this.wot.cloneOverlay,b.CLONE_BOTTOM)||b.isOverlayTypeOf(this.wot.cloneOverlay,b.CLONE_BOTTOM_LEFT_CORNER)?this.wot.getSetting("fixedRowsBottom"):this.wot.wtTable.getRenderedRowsCount();for(var H=0;M>H;H++){var k=this.wot.wtTable.rowFilter.renderedToSource(H);if(k>=e[0]&&k<=e[2]){R=k;break}}for(var A=M-1;A>=0;A--){var P=this.wot.wtTable.rowFilter.renderedToSource(A);if(P>=e[0]&&P<=e[2]){S=P;break}}M=this.wot.wtTable.getRenderedColumnsCount();for(var x=0;M>x;x++){var D=this.wot.wtTable.columnFilter.renderedToSource(x);if(D>=e[1]&&D<=e[3]){E=D;break}}for(var N=M-1;N>=0;N--){var L=this.wot.wtTable.columnFilter.renderedToSource(N);if(L>=e[1]&&L<=e[3]){T=L;break}}if(void 0===R||void 0===E)return void this.disappear();t=R!==S||E!==T,n=this.wot.wtTable.getCell(new v(R,E)),o=t?this.wot.wtTable.getCell(new v(S,T)):n,r=f(n),i=t?f(o):r,s=f(this.wot.wtTable.TABLE),a=r.top,C=i.top+g(o)-a,w=r.left,y=i.left+p(o)-w,l=a-s.top-1,m=w-s.left-1;var W=u(n);parseInt(W.borderTopWidth,10)>0&&(l+=1,C=C>0?C-1:0),parseInt(W.borderLeftWidth,10)>0&&(m+=1,y=y>0?y-1:0),this.topStyle.top=l+"px",this.topStyle.left=m+"px",this.topStyle.width=y+"px",this.topStyle.display="block",this.leftStyle.top=l+"px",this.leftStyle.left=m+"px",this.leftStyle.height=C+"px",this.leftStyle.display="block";var I=Math.floor(this.settings.border.width/2);this.bottomStyle.top=l+C-I+"px",this.bottomStyle.left=m+"px",this.bottomStyle.width=y+"px",this.bottomStyle.display="block",this.rightStyle.top=l+"px",this.rightStyle.left=m+y-I+"px",this.rightStyle.height=C+1+"px",this.rightStyle.display="block",Handsontable.mobileBrowser||!this.hasSetting(this.settings.border.cornerVisible)||this.isPartRange(S,T)?this.cornerStyle.display="none":(this.cornerStyle.top=l+C-4+"px",this.cornerStyle.left=m+y-4+"px",this.cornerStyle.borderRightWidth=this.cornerDefaultStyle.borderWidth,this.cornerStyle.width=this.cornerDefaultStyle.width,this.cornerStyle.display="block",O=c(this.wot.wtTable.TABLE),T===this.wot.getSetting("totalColumns")-1&&(_=o.offsetLeft+p(o)>=d(O),_&&(this.cornerStyle.left=Math.floor(m+y-3-parseInt(this.cornerDefaultStyle.width)/2)+"px",this.cornerStyle.borderRightWidth=0)),S===this.wot.getSetting("totalRows")-1&&(_=o.offsetTop+g(o)>=h(O),_&&(this.cornerStyle.top=Math.floor(l+C-3-parseInt(this.cornerDefaultStyle.height)/2)+"px",this.cornerStyle.borderBottomWidth=0))),Handsontable.mobileBrowser&&this.updateMultipleSelectionHandlesPosition(R,E,l,m,y,C)}},disappear:function(){this.topStyle.display="none",this.leftStyle.display="none",this.bottomStyle.display="none",this.rightStyle.display="none",this.cornerStyle.display="none",Handsontable.mobileBrowser&&(this.selectionHandles.styles.topLeft.display="none",this.selectionHandles.styles.bottomRight.display="none")},hasSetting:function(e){return"function"==typeof e?e():!!e}},{}),window.WalkontableBorder=C},{"cell/coords":5,eventManager:41,"helpers/dom/element":45,"helpers/dom/event":46,"overlay/_base.js":11}],3:[function(e,t,n){"use strict";Object.defineProperties(n,{WalkontableViewportColumnsCalculator:{get:function(){return r}},__esModule:{value:!0}});var o=new WeakMap,r=function(e,t,n,r,i,s,l){o.set(this,{viewportWidth:e,scrollOffset:t,totalColumns:n,columnWidthFn:r,overrideFn:i,onlyFullyVisible:s}),this.count=0,this.startColumn=null,this.endColumn=null,this.startPosition=null,this.stretchAllRatio=0,this.stretchLastWidth=0,this.stretch=l,this.totalTargetWidth=0,this.needVerifyLastColumnWidth=!0,this.stretchAllColumnsWidth=[],this.calculate()},i=r;$traceurRuntime.createClass(r,{calculate:function(){for(var e,t=0,n=!0,r=[],i=o.get(this),s=i.onlyFullyVisible,l=i.overrideFn,a=i.scrollOffset,u=i.totalColumns,c=i.viewportWidth,d=0;u>d;d++)if(e=this._getColumnWidth(d),a>=t&&!s&&(this.startColumn=d),t>=a&&a+c>=t+e&&(null==this.startColumn&&(this.startColumn=d),this.endColumn=d),r.push(t),t+=e,s||(this.endColumn=d),t>=a+c){n=!1;break}if(this.endColumn===u-1&&n)for(this.startColumn=this.endColumn;this.startColumn>0;){var h=r[this.endColumn]+e-r[this.startColumn-1];if((c>=h||!s)&&this.startColumn--,h>c)break}null!==this.startColumn&&l&&l(this),this.startPosition=r[this.startColumn],void 0==this.startPosition&&(this.startPosition=null),null!==this.startColumn&&(this.count=this.endColumn-this.startColumn+1)},refreshStretching:function(e){if("none"!==this.stretch){for(var t,n,r=0,i=o.get(this),s=i.totalColumns,l=0;s>l;l++)t=this._getColumnWidth(l),r+=t;this.totalTargetWidth=e,n=r-e,"all"===this.stretch&&0>n?(this.stretchAllRatio=e/r,this.stretchAllColumnsWidth=[],this.needVerifyLastColumnWidth=!0):"last"===this.stretch&&e!==1/0&&(this.stretchLastWidth=-n+this._getColumnWidth(s-1))}},getStretchedColumnWidth:function(e,t){var n=null;return"all"===this.stretch&&0!==this.stretchAllRatio?n=this._getStretchedAllColumnWidth(e,t):"last"===this.stretch&&0!==this.stretchLastWidth&&(n=this._getStretchedLastColumnWidth(e)),n},_getStretchedAllColumnWidth:function(e,t){var n=0,r=o.get(this),i=r.totalColumns;if(this.stretchAllColumnsWidth[e]||(this.stretchAllColumnsWidth[e]=Math.round(t*this.stretchAllRatio)),this.stretchAllColumnsWidth.length===i&&this.needVerifyLastColumnWidth){this.needVerifyLastColumnWidth=!1;for(var s=0;sf;f++){var g=a(f);if(void 0===g&&(g=i.DEFAULT_HEIGHT),u>=e&&!s&&(this.startRow=f),e>=u&&u+d-h>=e+g&&(null===this.startRow&&(this.startRow=f),this.endRow=f),n.push(e),e+=g,s||(this.endRow=f),e>=u+d-h){t=!1;break}}if(this.endRow===c-1&&t)for(this.startRow=this.endRow;this.startRow>0;){var p=n[this.endRow]+g-n[this.startRow-1];if((d-h>=p||!s)&&this.startRow--,p>=d-h)break}null!==this.startRow&&l&&l(this),this.startPosition=n[this.startRow],void 0==this.startPosition&&(this.startPosition=null),null!==this.startRow&&(this.count=this.endRow-this.startRow+1)}},{get DEFAULT_HEIGHT(){return 23}}),window.WalkontableViewportRowsCalculator=r},{}],5:[function(e,t,n){"use strict";Object.defineProperties(n,{WalkontableCellCoords:{get:function(){return o}},__esModule:{value:!0}});var o=function(e,t){"undefined"!=typeof e&&"undefined"!=typeof t?(this.row=e,this.col=t):(this.row=null,this.col=null)};$traceurRuntime.createClass(o,{isValid:function(e){return this.row<0||this.col<0?!1:this.row>=e.getSetting("totalRows")||this.col>=e.getSetting("totalColumns")?!1:!0},isEqual:function(e){return e===this?!0:this.row===e.row&&this.col===e.col},isSouthEastOf:function(e){return this.row>=e.row&&this.col>=e.col},isNorthWestOf:function(e){return this.row<=e.row&&this.col<=e.col},isSouthWestOf:function(e){return this.row>=e.row&&this.col<=e.col},isNorthEastOf:function(e){return this.row<=e.row&&this.col>=e.col}},{}),window.WalkontableCellCoords=o},{}],6:[function(e,t,n){"use strict";Object.defineProperties(n,{WalkontableCellRange:{get:function(){return i}},__esModule:{value:!0}});var o,r=(o=e("cell/coords"),o&&o.__esModule&&o||{"default":o}).WalkontableCellCoords,i=function(e,t,n){this.highlight=e,this.from=t,this.to=n},s=i;$traceurRuntime.createClass(i,{isValid:function(e){return this.from.isValid(e)&&this.to.isValid(e)},isSingle:function(){return this.from.row===this.to.row&&this.from.col===this.to.col},getHeight:function(){return Math.max(this.from.row,this.to.row)-Math.min(this.from.row,this.to.row)+1},getWidth:function(){return Math.max(this.from.col,this.to.col)-Math.min(this.from.col,this.to.col)+1},includes:function(e){var t=this.getTopLeftCorner(),n=this.getBottomRightCorner();return e.row<0&&(e.row=0),e.col<0&&(e.col=0),t.row<=e.row&&n.row>=e.row&&t.col<=e.col&&n.col>=e.col},includesRange:function(e){return this.includes(e.getTopLeftCorner())&&this.includes(e.getBottomRightCorner())},isEqual:function(e){return Math.min(this.from.row,this.to.row)==Math.min(e.from.row,e.to.row)&&Math.max(this.from.row,this.to.row)==Math.max(e.from.row,e.to.row)&&Math.min(this.from.col,this.to.col)==Math.min(e.from.col,e.to.col)&&Math.max(this.from.col,this.to.col)==Math.max(e.from.col,e.to.col)},overlaps:function(e){return e.isSouthEastOf(this.getTopLeftCorner())&&e.isNorthWestOf(this.getBottomRightCorner())},isSouthEastOf:function(e){return this.getTopLeftCorner().isSouthEastOf(e)||this.getBottomRightCorner().isSouthEastOf(e)},isNorthWestOf:function(e){return this.getTopLeftCorner().isNorthWestOf(e)||this.getBottomRightCorner().isNorthWestOf(e)},expand:function(e){var t=this.getTopLeftCorner(),n=this.getBottomRightCorner();return e.rown.row||e.col>n.col?(this.from=new r(Math.min(t.row,e.row),Math.min(t.col,e.col)),this.to=new r(Math.max(n.row,e.row),Math.max(n.col,e.col)),!0):!1},expandByRange:function(e){if(this.includesRange(e)||!this.overlaps(e))return!1;var t=this.getTopLeftCorner(),n=this.getBottomRightCorner(),o=(this.getTopRightCorner(),this.getBottomLeftCorner(),e.getTopLeftCorner()),i=e.getBottomRightCorner(),l=Math.min(t.row,o.row),a=Math.min(t.col,o.col),u=Math.max(n.row,i.row),c=Math.max(n.col,i.col),d=new r(l,a),h=new r(u,c),f=new s(d,d,h).isCorner(this.from,e),g=e.isEqual(new s(d,d,h));return f&&!g&&(this.from.col>d.col&&(d.col=c,h.col=a),this.from.row>d.row&&(d.row=u,h.row=l)),this.from=d,this.to=h,!0},getDirection:function(){return this.from.isNorthWestOf(this.to)?"NW-SE":this.from.isNorthEastOf(this.to)?"NE-SW":this.from.isSouthEastOf(this.to)?"SE-NW":this.from.isSouthWestOf(this.to)?"SW-NE":void 0},setDirection:function(e){switch(e){case"NW-SE":this.from=this.getTopLeftCorner(),this.to=this.getBottomRightCorner();break;case"NE-SW":this.from=this.getTopRightCorner(),this.to=this.getBottomLeftCorner();break;case"SE-NW":this.from=this.getBottomRightCorner(),this.to=this.getTopLeftCorner();break;case"SW-NE":this.from=this.getBottomLeftCorner(),this.to=this.getTopRightCorner()}},getTopLeftCorner:function(){return new r(Math.min(this.from.row,this.to.row),Math.min(this.from.col,this.to.col))},getBottomRightCorner:function(){return new r(Math.max(this.from.row,this.to.row),Math.max(this.from.col,this.to.col))},getTopRightCorner:function(){return new r(Math.min(this.from.row,this.to.row),Math.max(this.from.col,this.to.col))},getBottomLeftCorner:function(){return new r(Math.max(this.from.row,this.to.row),Math.min(this.from.col,this.to.col))},isCorner:function(e,t){return t&&t.includes(e)&&(this.getTopLeftCorner().isEqual(new r(t.from.row,t.from.col))||this.getTopRightCorner().isEqual(new r(t.from.row,t.to.col))||this.getBottomLeftCorner().isEqual(new r(t.to.row,t.from.col))||this.getBottomRightCorner().isEqual(new r(t.to.row,t.to.col)))?!0:e.isEqual(this.getTopLeftCorner())||e.isEqual(this.getTopRightCorner())||e.isEqual(this.getBottomLeftCorner())||e.isEqual(this.getBottomRightCorner())},getOppositeCorner:function(e,t){if(!(e instanceof r))return!1;if(t&&t.includes(e)){if(this.getTopLeftCorner().isEqual(new r(t.from.row,t.from.col)))return this.getBottomRightCorner();if(this.getTopRightCorner().isEqual(new r(t.from.row,t.to.col)))return this.getBottomLeftCorner();if(this.getBottomLeftCorner().isEqual(new r(t.to.row,t.from.col)))return this.getTopRightCorner();if(this.getBottomRightCorner().isEqual(new r(t.to.row,t.to.col)))return this.getTopLeftCorner()}return e.isEqual(this.getBottomRightCorner())?this.getTopLeftCorner():e.isEqual(this.getTopLeftCorner())?this.getBottomRightCorner():e.isEqual(this.getTopRightCorner())?this.getBottomLeftCorner():e.isEqual(this.getBottomLeftCorner())?this.getTopRightCorner():void 0},getBordersSharedWith:function(e){if(!this.includesRange(e))return[];var t={top:Math.min(this.from.row,this.to.row),bottom:Math.max(this.from.row,this.to.row),left:Math.min(this.from.col,this.to.col),right:Math.max(this.from.col,this.to.col)},n={top:Math.min(e.from.row,e.to.row),bottom:Math.max(e.from.row,e.to.row),left:Math.min(e.from.col,e.to.col),right:Math.max(e.from.col,e.to.col)},o=[];return t.top==n.top&&o.push("top"),t.right==n.right&&o.push("right"),t.bottom==n.bottom&&o.push("bottom"),t.left==n.left&&o.push("left"),o},getInner:function(){for(var e=this.getTopLeftCorner(),t=this.getBottomRightCorner(),n=[],o=e.row;o<=t.row;o++)for(var i=e.col;i<=t.col;i++)this.from.row===o&&this.from.col===i||this.to.row===o&&this.to.col===i||n.push(new r(o,i));return n},getAll:function(){for(var e=this.getTopLeftCorner(),t=this.getBottomRightCorner(),n=[],o=e.row;o<=t.row;o++)for(var i=e.col;i<=t.col;i++)e.row===o&&e.col===i?n.push(e):t.row===o&&t.col===i?n.push(t):n.push(new r(o,i));return n},forAll:function(e){for(var t=this.getTopLeftCorner(),n=this.getBottomRightCorner(),o=t.row;o<=n.row;o++)for(var r=t.col;r<=n.col;r++){var i=e(o,r);if(i===!1)return}}},{}),window.WalkontableCellRange=i},{"cell/coords":5}],7:[function(e,t,n){"use strict";Object.defineProperties(n,{Walkontable:{get:function(){return P}},__esModule:{value:!0}});var o,r,i,s,l,a,u,c,d,h,f,g,p,m,w=(o=e("helpers/dom/element"),o&&o.__esModule&&o||{"default":o}),v=w.addClass,b=w.fastInnerText,C=w.isVisible,y=w.removeClass,R=(r=e("helpers/object"),r&&r.__esModule&&r||{"default":r}).objectEach,E=(i=e("helpers/string"),i&&i.__esModule&&i||{"default":i}),S=E.toUpperCaseFirst,T=E.randomString,O=(s=e("event"),s&&s.__esModule&&s||{"default":s}).WalkontableEvent,_=(l=e("overlays"),l&&l.__esModule&&l||{"default":l}).WalkontableOverlays,M=(a=e("scroll"),a&&a.__esModule&&a||{"default":a}).WalkontableScroll,H=(u=e("settings"),u&&u.__esModule&&u||{"default":u}).WalkontableSettings,k=(c=e("table"),c&&c.__esModule&&c||{"default":c}).WalkontableTable,A=(d=e("viewport"),d&&d.__esModule&&d||{"default":d}).WalkontableViewport,P=((h=e("overlay/_base.js"),h&&h.__esModule&&h||{"default":h}).WalkontableOverlay,(f=e("overlay/top.js"),f&&f.__esModule&&f||{"default":f}).WalkontableTopOverlay,(g=e("overlay/left.js"),g&&g.__esModule&&g||{"default":g}).WalkontableLeftOverlay,(p=e("overlay/debug.js"),p&&p.__esModule&&p||{"default":p}).WalkontableDebugOverlay,(m=e("overlay/topLeftCorner.js"),m&&m.__esModule&&m||{"default":m}).WalkontableTopLeftCornerOverlay,function(e){var t=[];if(this.guid="wt_"+T(),e.cloneSource?(this.cloneSource=e.cloneSource,this.cloneOverlay=e.cloneOverlay,this.wtSettings=e.cloneSource.wtSettings,this.wtTable=new k(this,e.table,e.wtRootElement),this.wtScroll=new M(this),this.wtViewport=e.cloneSource.wtViewport,this.wtEvent=new O(this),this.selections=this.cloneSource.selections):(this.wtSettings=new H(this,e),this.wtTable=new k(this,e.table),this.wtScroll=new M(this),this.wtViewport=new A(this),this.wtEvent=new O(this),this.selections=this.getSetting("selections"),this.wtOverlays=new _(this),this.exportSettingsAsClassNames()),this.wtTable.THEAD.childNodes.length&&this.wtTable.THEAD.childNodes[0].childNodes.length){for(var n=0,o=this.wtTable.THEAD.childNodes[0].childNodes.length;o>n;n++)t.push(this.wtTable.THEAD.childNodes[0].childNodes[n].innerHTML);this.getSetting("columnHeaders").length||this.update("columnHeaders",[function(e,n){b(n,t[e])}])}this.drawn=!1,this.drawInterrupted=!1});$traceurRuntime.createClass(P,{draw:function(){var e=void 0!==arguments[0]?arguments[0]:!1;return this.drawInterrupted=!1,e||C(this.wtTable.TABLE)?this.wtTable.draw(e):this.drawInterrupted=!0,this},getCell:function(e){var t=void 0!==arguments[1]?arguments[1]:!1;if(!t)return this.wtTable.getCell(e);var n=this.wtSettings.getSetting("totalRows"),o=this.wtSettings.getSetting("fixedRowsTop"),r=this.wtSettings.getSetting("fixedRowsBottom"),i=this.wtSettings.getSetting("fixedColumnsLeft");if(e.row=n-r){if(this.wtOverlays.bottomLeftCornerOverlay.clone)return this.wtOverlays.bottomLeftCornerOverlay.clone.wtTable.getCell(e)}else{if(e.col=n-r&&this.wtOverlays.bottomOverlay.clone)return this.wtOverlays.bottomOverlay.clone.wtTable.getCell(e)}return this.wtTable.getCell(e)},update:function(e,t){return this.wtSettings.update(e,t)},scrollVertical:function(e){return this.wtOverlays.topOverlay.scrollTo(e),this.getSetting("onScrollVertically"),this},scrollHorizontal:function(e){return this.wtOverlays.leftOverlay.scrollTo(e),this.getSetting("onScrollHorizontally"),this},scrollViewport:function(e){return this.wtScroll.scrollViewport(e),this},getViewport:function(){return[this.wtTable.getFirstVisibleRow(),this.wtTable.getFirstVisibleColumn(),this.wtTable.getLastVisibleRow(),this.wtTable.getLastVisibleColumn()]},getOverlayName:function(){return this.cloneOverlay?this.cloneOverlay.type:"master"},exportSettingsAsClassNames:function(){var e=this,t={rowHeaders:["array"],columnHeaders:["array"]},n=[],o=[];R(t,function(t,r){t.indexOf("array")>-1&&e.getSetting(r).length&&o.push("ht"+S(r)),n.push("ht"+S(r))}),y(this.wtTable.wtRootElement.parentNode,n),v(this.wtTable.wtRootElement.parentNode,o)},getSetting:function(e,t,n,o,r){return this.wtSettings.getSetting(e,t,n,o,r)},hasSetting:function(e){return this.wtSettings.has(e)},destroy:function(){this.wtOverlays.destroy(),this.wtEvent.destroy()}},{}),window.Walkontable=P},{event:8,"helpers/dom/element":45,"helpers/object":50,"helpers/string":52,"overlay/_base.js":11,"overlay/debug.js":12,"overlay/left.js":13,"overlay/top.js":14,"overlay/topLeftCorner.js":15,overlays:16,scroll:17,settings:19,table:20,viewport:22}],8:[function(e,t,n){"use strict";function o(e){var t=this,n=c(e);this.instance=e;var o=[null,null];this.dblClickTimeout=[null,null];var r,i,s=function(e){var n=t.parentCell(e.realTarget);a(e.realTarget,"corner")?t.instance.getSetting("onCellCornerMouseDown",e,e.realTarget):n.TD&&t.instance.hasSetting("onCellMouseDown")&&t.instance.getSetting("onCellMouseDown",e,n.coords,n.TD,t.instance),2!==e.button&&n.TD&&(o[0]=n.TD,clearTimeout(t.dblClickTimeout[0]),t.dblClickTimeout[0]=setTimeout(function(){o[0]=null},1e3))},d=function(e){t.instance.touchMoving=!0},h=function(e){n.addEventListener(this,"touchmove",d),t.checkIfTouchMove=setTimeout(function(){return t.instance.touchMoving===!0?(t.instance.touchMoving=void 0,void n.removeEventListener("touchmove",d,!1)):void s(e)},30)},f=function(e){var n,o;t.instance.hasSetting("onCellMouseOver")&&(n=t.instance.wtTable.TABLE,o=l(e.realTarget,["TD","TH"],n),o&&o!==i&&u(o,n)&&(i=o,t.instance.getSetting("onCellMouseOver",e,t.instance.wtTable.getCoords(o),o,t.instance)))},g=function(e){if(2!==e.button){var n=t.parentCell(e.realTarget);n.TD===o[0]&&n.TD===o[1]?(a(e.realTarget,"corner")?t.instance.getSetting("onCellCornerDblClick",e,n.coords,n.TD,t.instance):t.instance.getSetting("onCellDblClick",e,n.coords,n.TD,t.instance),o[0]=null,o[1]=null):n.TD===o[0]&&(o[1]=n.TD,clearTimeout(t.dblClickTimeout[1]),t.dblClickTimeout[1]=setTimeout(function(){o[1]=null},500))}},p=function(e){clearTimeout(r),e.preventDefault(),g(e)};if(n.addEventListener(this.instance.wtTable.holder,"mousedown",s),n.addEventListener(this.instance.wtTable.TABLE,"mouseover",f),n.addEventListener(this.instance.wtTable.holder,"mouseup",g),this.instance.wtTable.holder.parentNode.parentNode&&Handsontable.mobileBrowser&&!t.instance.wtTable.isWorkingOnClone()){var m="."+this.instance.wtTable.holder.parentNode.className.split(" ").join(".");n.addEventListener(this.instance.wtTable.holder,"touchstart",function(e){t.instance.touchApplied=!0,u(e.target,m)&&h.call(e.target,e)}),n.addEventListener(this.instance.wtTable.holder,"touchend",function(e){t.instance.touchApplied=!1,u(e.target,m)&&p.call(e.target,e)}),t.instance.momentumScrolling||(t.instance.momentumScrolling={}),n.addEventListener(this.instance.wtTable.holder,"scroll",function(e){clearTimeout(t.instance.momentumScrolling._timeout),t.instance.momentumScrolling.ongoing||t.instance.getSetting("onBeforeTouchScroll"),t.instance.momentumScrolling.ongoing=!0,t.instance.momentumScrolling._timeout=setTimeout(function(){t.instance.touchApplied||(t.instance.momentumScrolling.ongoing=!1,t.instance.getSetting("onAfterMomentumScroll"))},200)})}n.addEventListener(window,"resize",function(){"none"!==t.instance.getSetting("stretchH")&&t.instance.draw()}),this.destroy=function(){clearTimeout(this.dblClickTimeout[0]),clearTimeout(this.dblClickTimeout[1]),n.destroy()}}Object.defineProperties(n,{WalkontableEvent:{get:function(){return o}},__esModule:{value:!0}});var r,i,s=(r=e("helpers/dom/element"),r&&r.__esModule&&r||{"default":r}),l=s.closest,a=s.hasClass,u=s.isChildOf,c=(i=e("eventManager"),i&&i.__esModule&&i||{"default":i}).eventManager;o.prototype.parentCell=function(e){var t={},n=this.instance.wtTable.TABLE,o=l(e,["TD","TH"],n);return o&&u(o,n)?(t.coords=this.instance.wtTable.getCoords(o),t.TD=o):a(e,"wtBorder")&&a(e,"current")?(t.coords=this.instance.selections.current.cellRange.highlight,t.TD=this.instance.wtTable.getCell(t.coords)):a(e,"wtBorder")&&a(e,"area")&&this.instance.selections.area.cellRange&&(t.coords=this.instance.selections.area.cellRange.to,t.TD=this.instance.wtTable.getCell(t.coords)),t},window.WalkontableEvent=o},{eventManager:41,"helpers/dom/element":45}],9:[function(e,t,n){"use strict";Object.defineProperties(n,{WalkontableColumnFilter:{get:function(){return o}},__esModule:{value:!0}});var o=function(e,t,n){this.offset=e,this.total=t,this.countTH=n};$traceurRuntime.createClass(o,{offsetted:function(e){return e+this.offset},unOffsetted:function(e){return e-this.offset},renderedToSource:function(e){return this.offsetted(e)},sourceToRendered:function(e){return this.unOffsetted(e)},offsettedTH:function(e){return e-this.countTH},unOffsettedTH:function(e){return e+this.countTH},visibleRowHeadedColumnToSourceColumn:function(e){return this.renderedToSource(this.offsettedTH(e))},sourceColumnToVisibleRowHeadedColumn:function(e){return this.unOffsettedTH(this.sourceToRendered(e))}},{}),window.WalkontableColumnFilter=o; -},{}],10:[function(e,t,n){"use strict";Object.defineProperties(n,{WalkontableRowFilter:{get:function(){return o}},__esModule:{value:!0}});var o=function(e,t,n){this.offset=e,this.total=t,this.countTH=n};$traceurRuntime.createClass(o,{offsetted:function(e){return e+this.offset},unOffsetted:function(e){return e-this.offset},renderedToSource:function(e){return this.offsetted(e)},sourceToRendered:function(e){return this.unOffsetted(e)},offsettedTH:function(e){return e-this.countTH},unOffsettedTH:function(e){return e+this.countTH},visibleColHeadedRowToSourceRow:function(e){return this.renderedToSource(this.offsettedTH(e))},sourceRowToVisibleColHeadedRow:function(e){return this.unOffsettedTH(this.sourceToRendered(e))}},{}),window.WalkontableRowFilter=o},{}],11:[function(e,t,n){"use strict";Object.defineProperties(n,{WalkontableOverlay:{get:function(){return h}},__esModule:{value:!0}});var o,r,i,s=(o=e("helpers/dom/element"),o&&o.__esModule&&o||{"default":o}),l=s.getScrollableElement,a=s.getTrimmingContainer,u=(r=e("helpers/object"),r&&r.__esModule&&r||{"default":r}).defineGetter,c=(i=e("eventManager"),i&&i.__esModule&&i||{"default":i}).eventManager,d={},h=function(e){u(this,"wot",e,{writable:!1}),this.instance=this.wot,this.type="",this.TABLE=this.wot.wtTable.TABLE,this.hider=this.wot.wtTable.hider,this.spreader=this.wot.wtTable.spreader,this.holder=this.wot.wtTable.holder,this.wtRootElement=this.wot.wtTable.wtRootElement,this.trimmingContainer=a(this.hider.parentNode.parentNode),this.mainTableScrollableElement=l(this.wot.wtTable.TABLE),this.needFullRender=this.shouldBeRendered(),this.areElementSizesAdjusted=!1},f=h;$traceurRuntime.createClass(h,{shouldBeRendered:function(){return!0},makeClone:function(e){if(-1===f.CLONE_TYPES.indexOf(e))throw new Error('Clone type "'+e+'" is not supported.');var t=document.createElement("DIV"),n=document.createElement("TABLE");return t.className="ht_clone_"+e+" handsontable",t.style.position="absolute",t.style.top=0,t.style.left=0,t.style.overflow="hidden",n.className=this.wot.wtTable.TABLE.className,t.appendChild(n),this.type=e,this.wot.wtTable.wtRootElement.parentNode.appendChild(t),new Walkontable({cloneSource:this.wot,cloneOverlay:this,table:n})},refresh:function(){var e=void 0!==arguments[0]?arguments[0]:!1,t=this.shouldBeRendered();this.clone&&(this.needFullRender||t)&&this.clone.draw(e),this.needFullRender=t},destroy:function(){c(this.clone).destroy()}},{get CLONE_TOP(){return"top"},get CLONE_BOTTOM(){return"bottom"},get CLONE_LEFT(){return"left"},get CLONE_TOP_LEFT_CORNER(){return"top_left_corner"},get CLONE_BOTTOM_LEFT_CORNER(){return"bottom_left_corner"},get CLONE_DEBUG(){return"debug"},get CLONE_TYPES(){return[f.CLONE_TOP,f.CLONE_BOTTOM,f.CLONE_LEFT,f.CLONE_TOP_LEFT_CORNER,f.CLONE_BOTTOM_LEFT_CORNER,f.CLONE_DEBUG]},registerOverlay:function(e,t){if(-1===f.CLONE_TYPES.indexOf(e))throw new Error("Unsupported overlay ("+e+").");d[e]=t},createOverlay:function(e,t){return new d[e](t)},isOverlayTypeOf:function(e,t){return e&&d[t]?e instanceof d[t]:!1}}),window.WalkontableOverlay=h},{eventManager:41,"helpers/dom/element":45,"helpers/object":50}],12:[function(e,t,n){"use strict";Object.defineProperties(n,{WalkontableDebugOverlay:{get:function(){return l}},__esModule:{value:!0}});var o,r,i=(o=e("helpers/dom/element"),o&&o.__esModule&&o||{"default":o}).addClass,s=(r=e("_base"),r&&r.__esModule&&r||{"default":r}).WalkontableOverlay,l=function(e){$traceurRuntime.superConstructor(a).call(this,e),this.clone=this.makeClone(s.CLONE_DEBUG),this.clone.wtTable.holder.style.opacity=.4,this.clone.wtTable.holder.style.textShadow="0 0 2px #ff0000",i(this.clone.wtTable.holder.parentNode,"wtDebugVisible")},a=l;$traceurRuntime.createClass(l,{},{},s),window.WalkontableDebugOverlay=l,s.registerOverlay(s.CLONE_DEBUG,l)},{_base:11,"helpers/dom/element":45}],13:[function(e,t,n){"use strict";Object.defineProperties(n,{WalkontableLeftOverlay:{get:function(){return p}},__esModule:{value:!0}});var o,r,i=(o=e("helpers/dom/element"),o&&o.__esModule&&o||{"default":o}),s=i.addClass,l=i.getScrollbarWidth,a=i.getScrollLeft,u=i.getWindowScrollTop,c=i.hasClass,d=i.outerWidth,h=i.removeClass,f=i.setOverlayPosition,g=(r=e("_base"),r&&r.__esModule&&r||{"default":r}).WalkontableOverlay,p=function(e){$traceurRuntime.superConstructor(m).call(this,e),this.clone=this.makeClone(g.CLONE_LEFT)},m=p;$traceurRuntime.createClass(p,{shouldBeRendered:function(){return this.wot.getSetting("fixedColumnsLeft")||this.wot.getSetting("rowHeaders").length?!0:!1},resetFixedPosition:function(){if(this.needFullRender&&this.wot.wtTable.holder.parentNode){var e=this.clone.wtTable.holder.parentNode,t=0;if(this.trimmingContainer===window){var n,o,r=this.wot.wtTable.hider.getBoundingClientRect(),i=Math.ceil(r.left),s=Math.ceil(r.right);o=this.wot.wtTable.hider.style.top,o=""===o?0:o,n=0>i&&s-e.offsetWidth>0?-i:0,t=n,n+="px",f(e,n,o)}else t=this.getScrollPosition();this.adjustHeaderBordersPosition(t),this.adjustElementsSize()}},setScrollPosition:function(e){this.mainTableScrollableElement===window?window.scrollTo(e,u()):this.mainTableScrollableElement.scrollLeft=e},onScroll:function(){this.wot.getSetting("onScrollHorizontally")},sumCellSizes:function(e,t){for(var n=0,o=this.wot.wtSettings.defaultColumnWidth;t>e;)n+=this.wot.wtTable.getStretchedColumnWidth(e)||o,e++;return n},adjustElementsSize:function(){var e=void 0!==arguments[0]?arguments[0]:!1;(this.needFullRender||e)&&(this.adjustRootElementSize(),this.adjustRootChildrenSize(),e||(this.areElementSizesAdjusted=!0))},adjustRootElementSize:function(){var e,t=this.wot.wtTable.holder,n=t.clientHeight===t.offsetHeight?0:l(),o=this.clone.wtTable.holder.parentNode,r=o.style;this.trimmingContainer!==window&&(r.height=this.wot.wtViewport.getWorkspaceHeight()-n+"px"),this.clone.wtTable.holder.style.height=r.height,e=d(this.clone.wtTable.TABLE),r.width=(0===e?e:e+4)+"px"},adjustRootChildrenSize:function(){var e=l();this.clone.wtTable.hider.style.height=this.hider.style.height,this.clone.wtTable.holder.style.height=this.clone.wtTable.holder.parentNode.style.height,0===e&&(e=30),this.clone.wtTable.holder.style.width=parseInt(this.clone.wtTable.holder.parentNode.style.width,10)+e+"px"},applyToDOM:function(){var e=this.wot.getSetting("totalColumns");if(this.areElementSizesAdjusted||this.adjustElementsSize(),"number"==typeof this.wot.wtViewport.columnsRenderCalculator.startPosition)this.spreader.style.left=this.wot.wtViewport.columnsRenderCalculator.startPosition+"px";else{if(0!==e)throw new Error("Incorrect value of the columnsRenderCalculator");this.spreader.style.left="0"}this.spreader.style.right="",this.needFullRender&&this.syncOverlayOffset()},syncOverlayOffset:function(){"number"==typeof this.wot.wtViewport.rowsRenderCalculator.startPosition?this.clone.wtTable.spreader.style.top=this.wot.wtViewport.rowsRenderCalculator.startPosition+"px":this.clone.wtTable.spreader.style.top=""},scrollTo:function(e,t){var n=this.getTableParentOffset(),o=this.wot.cloneSource?this.wot.cloneSource:this.wot,r=o.wtTable.holder,i=0;t&&r.offsetWidth!==r.clientWidth&&(i=l()),t?(n+=this.sumCellSizes(0,e+1),n-=this.wot.wtViewport.getViewportWidth()):n+=this.sumCellSizes(this.wot.getSetting("fixedColumnsLeft"),e),n+=i,this.setScrollPosition(n)},getTableParentOffset:function(){return this.trimmingContainer===window?this.wot.wtTable.holderOffset.left:0},getScrollPosition:function(){return a(this.mainTableScrollableElement)},adjustHeaderBordersPosition:function(e){var t=this.wot.wtTable.holder.parentNode,n=this.wot.getSetting("rowHeaders"),o=this.wot.getSetting("fixedColumnsLeft");if(o&&!n.length)s(t,"innerBorderLeft");else if(!o&&n.length){var r=c(t,"innerBorderLeft");e?s(t,"innerBorderLeft"):h(t,"innerBorderLeft"),(!r&&e||r&&!e)&&this.wot.wtOverlays.adjustElementsSize()}}},{},g),window.WalkontableLeftOverlay=p,g.registerOverlay(g.CLONE_LEFT,p)},{_base:11,"helpers/dom/element":45}],14:[function(e,t,n){"use strict";Object.defineProperties(n,{WalkontableTopOverlay:{get:function(){return p}},__esModule:{value:!0}});var o,r,i=(o=e("helpers/dom/element"),o&&o.__esModule&&o||{"default":o}),s=i.addClass,l=i.getScrollbarWidth,a=i.getScrollTop,u=i.getWindowScrollLeft,c=i.hasClass,d=i.outerHeight,h=i.removeClass,f=i.setOverlayPosition,g=(r=e("_base"),r&&r.__esModule&&r||{"default":r}).WalkontableOverlay,p=function(e){$traceurRuntime.superConstructor(m).call(this,e),this.clone=this.makeClone(g.CLONE_TOP)},m=p;$traceurRuntime.createClass(p,{shouldBeRendered:function(){return this.wot.getSetting("fixedRowsTop")||this.wot.getSetting("columnHeaders").length?!0:!1},resetFixedPosition:function(){if(this.needFullRender&&this.wot.wtTable.holder.parentNode){var e=this.clone.wtTable.holder.parentNode,t=0;if(this.wot.wtOverlays.leftOverlay.trimmingContainer===window){var n,o,r=this.wot.wtTable.hider.getBoundingClientRect(),i=Math.ceil(r.top),s=Math.ceil(r.bottom);n=this.wot.wtTable.hider.style.left,n=""===n?0:n,o=0>i&&s-e.offsetHeight>0?-i:0,t=o,o+="px",f(e,n,o)}else t=this.getScrollPosition();this.adjustHeaderBordersPosition(t),this.adjustElementsSize()}},setScrollPosition:function(e){this.mainTableScrollableElement===window?window.scrollTo(u(),e):this.mainTableScrollableElement.scrollTop=e},onScroll:function(){this.wot.getSetting("onScrollVertically")},sumCellSizes:function(e,t){for(var n=0,o=this.wot.wtSettings.settings.defaultRowHeight;t>e;){var r=this.wot.wtTable.getRowHeight(e);n+=void 0===r?o:r,e++}return n},adjustElementsSize:function(){var e=void 0!==arguments[0]?arguments[0]:!1;(this.needFullRender||e)&&(this.adjustRootElementSize(),this.adjustRootChildrenSize(),e||(this.areElementSizesAdjusted=!0))},adjustRootElementSize:function(){var e,t=this.wot.wtTable.holder,n=t.clientWidth===t.offsetWidth?0:l(),o=this.clone.wtTable.holder.parentNode,r=o.style;this.trimmingContainer!==window&&(r.width=this.wot.wtViewport.getWorkspaceWidth()-n+"px"),this.clone.wtTable.holder.style.width=r.width,e=d(this.clone.wtTable.TABLE),r.height=(0===e?e:e+4)+"px"},adjustRootChildrenSize:function(){var e=l();this.clone.wtTable.hider.style.width=this.hider.style.width,this.clone.wtTable.holder.style.width=this.clone.wtTable.holder.parentNode.style.width,0===e&&(e=30),this.clone.wtTable.holder.style.height=parseInt(this.clone.wtTable.holder.parentNode.style.height,10)+e+"px"},applyToDOM:function(){var e=this.wot.getSetting("totalRows");if(this.areElementSizesAdjusted||this.adjustElementsSize(),"number"==typeof this.wot.wtViewport.rowsRenderCalculator.startPosition)this.spreader.style.top=this.wot.wtViewport.rowsRenderCalculator.startPosition+"px";else{if(0!==e)throw new Error("Incorrect value of the rowsRenderCalculator");this.spreader.style.top="0"}this.spreader.style.bottom="",this.needFullRender&&this.syncOverlayOffset()},syncOverlayOffset:function(){"number"==typeof this.wot.wtViewport.columnsRenderCalculator.startPosition?this.clone.wtTable.spreader.style.left=this.wot.wtViewport.columnsRenderCalculator.startPosition+"px":this.clone.wtTable.spreader.style.left=""},scrollTo:function(e,t){var n=this.getTableParentOffset(),o=this.wot.cloneSource?this.wot.cloneSource:this.wot,r=o.wtTable.holder,i=0;if(t&&r.offsetHeight!==r.clientHeight&&(i=l()),t){var s=this.wot.getSetting("fixedRowsBottom"),a=(this.wot.getSetting("fixedRowsTop"),this.wot.getSetting("totalRows"));n+=this.sumCellSizes(0,e+1),n-=this.wot.wtViewport.getViewportHeight()-this.sumCellSizes(a-s,a),n+=1}else n+=this.sumCellSizes(this.wot.getSetting("fixedRowsTop"),e);n+=i,this.setScrollPosition(n)},getTableParentOffset:function(){return this.mainTableScrollableElement===window?this.wot.wtTable.holderOffset.top:0},getScrollPosition:function(){return a(this.mainTableScrollableElement)},adjustHeaderBordersPosition:function(e){if(0===this.wot.getSetting("fixedRowsTop")&&this.wot.getSetting("columnHeaders").length>0){var t=this.wot.wtTable.holder.parentNode,n=c(t,"innerBorderTop");e?s(t,"innerBorderTop"):h(t,"innerBorderTop"),(!n&&e||n&&!e)&&this.wot.wtOverlays.adjustElementsSize()}if(0===this.wot.getSetting("rowHeaders").length){var o=this.clone.wtTable.THEAD.querySelectorAll("th:nth-of-type(2)");if(o)for(var r=0;rc&&h-e.offsetWidth>0?-c+"px":"0",r=0>u&&d-e.offsetHeight>0?-u+"px":"0",a(e,o,r)}e.style.height=(0===t?t:t+4)+"px",e.style.width=(0===n?n:n+4)+"px"}}},{},u),window.WalkontableTopLeftCornerOverlay=c,u.registerOverlay(u.CLONE_TOP_LEFT_CORNER,c)},{_base:11,"helpers/dom/element":45}],16:[function(e,t,n){"use strict";Object.defineProperties(n,{WalkontableOverlays:{get:function(){return f}},__esModule:{value:!0}});var o,r,i,s=(o=e("helpers/dom/element"),o&&o.__esModule&&o||{"default":o}),l=s.getScrollableElement,a=s.getScrollbarWidth,u=s.getScrollLeft,c=s.getScrollTop,d=(r=e("helpers/unicode"),r&&r.__esModule&&r||{"default":r}).isKey,h=(i=e("eventManager"),i&&i.__esModule&&i||{"default":i}).EventManager,f=function(e){this.wot=e,this.instance=this.wot,this.eventManager=new h(this.wot),this.wot.update("scrollbarWidth",a()),this.wot.update("scrollbarHeight",a()),this.mainTableScrollableElement=l(this.wot.wtTable.TABLE),this.topOverlay=WalkontableOverlay.createOverlay(WalkontableOverlay.CLONE_TOP,this.wot),"undefined"==typeof WalkontableBottomOverlay?this.bottomOverlay={needFullRender:!1}:this.bottomOverlay=WalkontableOverlay.createOverlay(WalkontableOverlay.CLONE_BOTTOM,this.wot),this.leftOverlay=WalkontableOverlay.createOverlay(WalkontableOverlay.CLONE_LEFT,this.wot),this.topOverlay.needFullRender&&this.leftOverlay.needFullRender&&(this.topLeftCornerOverlay=WalkontableOverlay.createOverlay(WalkontableOverlay.CLONE_TOP_LEFT_CORNER,this.wot)),this.bottomOverlay.needFullRender&&this.leftOverlay.needFullRender&&"undefined"!=typeof WalkontableBottomLeftCornerOverlay?this.bottomLeftCornerOverlay=WalkontableOverlay.createOverlay(WalkontableOverlay.CLONE_BOTTOM_LEFT_CORNER,this.wot):this.bottomLeftCornerOverlay={needFullRender:!1},this.wot.getSetting("debug")&&(this.debug=WalkontableOverlay.createOverlay(WalkontableOverlay.CLONE_DEBUG,this.wot)),this.destroyed=!1,this.keyPressed=!1,this.spreaderLastSize={width:null,height:null},this.overlayScrollPositions={master:{top:0,left:0},top:{top:null,left:0},bottom:{top:null,left:0},left:{top:0,left:null}},this.registerListeners()};$traceurRuntime.createClass(f,{refreshAll:function(){if(this.wot.drawn){if(!this.wot.wtTable.holder.parentNode)return void this.destroy();this.wot.draw(!0),this.topOverlay.onScroll(),this.leftOverlay.onScroll()}},registerListeners:function(){var e=this;this.eventManager.addEventListener(document.documentElement,"keydown",function(t){return e.onKeyDown(t)}),this.eventManager.addEventListener(document.documentElement,"keyup",function(){return e.onKeyUp()}),this.eventManager.addEventListener(document,"visibilitychange",function(){return e.onKeyUp()}),this.eventManager.addEventListener(this.mainTableScrollableElement,"scroll",function(t){return e.onTableScroll(t)}),this.topOverlay.needFullRender&&(this.eventManager.addEventListener(this.topOverlay.clone.wtTable.holder,"scroll",function(t){return e.onTableScroll(t)}),this.eventManager.addEventListener(this.topOverlay.clone.wtTable.holder,"wheel",function(t){return e.onTableScroll(t)})),this.bottomOverlay.needFullRender&&(this.eventManager.addEventListener(this.bottomOverlay.clone.wtTable.holder,"scroll",function(t){return e.onTableScroll(t)}),this.eventManager.addEventListener(this.bottomOverlay.clone.wtTable.holder,"wheel",function(t){return e.onTableScroll(t)})),this.leftOverlay.needFullRender&&(this.eventManager.addEventListener(this.leftOverlay.clone.wtTable.holder,"scroll",function(t){return e.onTableScroll(t)}),this.eventManager.addEventListener(this.leftOverlay.clone.wtTable.holder,"wheel",function(t){return e.onTableScroll(t)})),this.topOverlay.trimmingContainer!==window&&this.leftOverlay.trimmingContainer!==window&&this.eventManager.addEventListener(window,"wheel",function(t){var n,o=t.wheelDeltaY||t.deltaY,r=t.wheelDeltaX||t.deltaX;e.topOverlay.clone.wtTable.holder.contains(t.realTarget)?n="top":e.bottomOverlay.clone&&e.bottomOverlay.clone.wtTable.holder.contains(t.realTarget)?n="bottom":e.leftOverlay.clone.wtTable.holder.contains(t.realTarget)&&(n="left"),"top"==n&&0!==o?t.preventDefault():"left"==n&&0!==r?t.preventDefault():"bottom"==n&&0!==o&&t.preventDefault()})},onTableScroll:function(e){Handsontable.mobileBrowser||(!this.keyPressed||this.mainTableScrollableElement===window||e.target.contains(this.mainTableScrollableElement))&&("scroll"===e.type?this.syncScrollPositions(e):this.translateMouseWheelToScroll(e))},onKeyDown:function(e){this.keyPressed=d(e.keyCode,"ARROW_UP|ARROW_RIGHT|ARROW_DOWN|ARROW_LEFT")},onKeyUp:function(){this.keyPressed=!1},translateMouseWheelToScroll:function(e){for(var t,n=this.topOverlay.clone.wtTable.holder,o=this.bottomOverlay.clone?this.bottomOverlay.clone.wtTable.holder:null,r=this.leftOverlay.clone.wtTable.holder,i={type:"wheel"},s=e.target,l=e.wheelDeltaY||-1*e.deltaY,a=e.wheelDeltaX||-1*e.deltaX;s!=document&&null!=s;){if(s.className.indexOf("wtHolder")>-1){t=s;break}s=s.parentNode}return i.target=t,t==n?this.syncScrollPositions(i,-.2*l):t==o?this.syncScrollPositions(i,-.2*l):t==r&&this.syncScrollPositions(i,-.2*a),!1},syncScrollPositions:function(e){var t=void 0!==arguments[1]?arguments[1]:null;if(!this.destroyed){if(0===arguments.length)return void this.syncScrollWithMaster();var n,o,r,i=this.mainTableScrollableElement,s=e.target,l=0,a=!1;this.topOverlay.needFullRender&&(n=this.topOverlay.clone.wtTable.holder),this.bottomOverlay.needFullRender&&(r=this.bottomOverlay.clone.wtTable.holder),this.leftOverlay.needFullRender&&(o=this.leftOverlay.clone.wtTable.holder),s===document&&(s=window),s===i?(l=u(s),this.overlayScrollPositions.master.left!==l&&(this.overlayScrollPositions.master.left=l,a=!0,n&&(n.scrollLeft=l),r&&(r.scrollLeft=l)),l=c(s),this.overlayScrollPositions.master.top!==l&&(this.overlayScrollPositions.master.top=l,a=!0,o&&(o.scrollTop=l))):s===r?(l=u(s),this.overlayScrollPositions.bottom.left!==l&&(this.overlayScrollPositions.bottom.left=l,a=!0,i.scrollLeft=l),null!==t&&(a=!0,i.scrollTop+=t)):s===n?(l=u(s),this.overlayScrollPositions.top.left!==l&&(this.overlayScrollPositions.top.left=l,a=!0,i.scrollLeft=l),null!==t&&(a=!0,i.scrollTop+=t)):s===o&&(l=c(s),this.overlayScrollPositions.left.top!==l&&(this.overlayScrollPositions.left.top=l,a=!0,i.scrollTop=l),null!==t&&(a=!0,i.scrollLeft+=t)),!this.keyPressed&&a&&"scroll"===e.type&&this.refreshAll()}},syncScrollWithMaster:function(){var e=this.topOverlay.mainTableScrollableElement;this.topOverlay.needFullRender&&(this.topOverlay.clone.wtTable.holder.scrollLeft=e.scrollLeft),this.leftOverlay.needFullRender&&(this.leftOverlay.clone.wtTable.holder.scrollTop=e.scrollTop)},destroy:function(){this.eventManager.destroy(),this.topOverlay.destroy(),this.bottomOverlay.clone&&this.bottomOverlay.destroy(),this.leftOverlay.destroy(),this.topLeftCornerOverlay&&this.topLeftCornerOverlay.destroy(),this.bottomLeftCornerOverlay&&this.bottomLeftCornerOverlay.clone&&this.bottomLeftCornerOverlay.destroy(),this.debug&&this.debug.destroy(),this.destroyed=!0},refresh:function(){var e=void 0!==arguments[0]?arguments[0]:!1;if(this.topOverlay.areElementSizesAdjusted&&this.leftOverlay.areElementSizesAdjusted){var t=this.wot.wtTable.wtRootElement.parentNode||this.wot.wtTable.wtRootElement,n=t.clientWidth,o=t.clientHeight;(n!==this.spreaderLastSize.width||o!==this.spreaderLastSize.height)&&(this.spreaderLastSize.width=n,this.spreaderLastSize.height=o,this.adjustElementsSize())}this.bottomOverlay.clone&&this.bottomOverlay.refresh(e),this.leftOverlay.refresh(e),this.topOverlay.refresh(e),this.topLeftCornerOverlay&&this.topLeftCornerOverlay.refresh(e),this.bottomLeftCornerOverlay&&this.bottomLeftCornerOverlay.clone&&this.bottomLeftCornerOverlay.refresh(e),this.debug&&this.debug.refresh(e)},adjustElementsSize:function(){var e=void 0!==arguments[0]?arguments[0]:!1,t=this.wot.getSetting("totalColumns"),n=this.wot.getSetting("totalRows"),o=this.wot.wtViewport.getRowHeaderWidth(),r=this.wot.wtViewport.getColumnHeaderHeight(),i=this.wot.wtTable.hider.style;i.width=o+this.leftOverlay.sumCellSizes(0,t)+"px",i.height=r+this.topOverlay.sumCellSizes(0,n)+1+"px",this.topOverlay.adjustElementsSize(e),this.leftOverlay.adjustElementsSize(e),this.bottomOverlay.clone&&this.bottomOverlay.adjustElementsSize(e)},applyToDOM:function(){this.topOverlay.areElementSizesAdjusted&&this.leftOverlay.areElementSizesAdjusted||this.adjustElementsSize(),this.topOverlay.applyToDOM(),this.bottomOverlay.clone&&this.bottomOverlay.applyToDOM(),this.leftOverlay.applyToDOM()}},{}),window.WalkontableOverlays=f},{eventManager:41,"helpers/dom/element":45,"helpers/unicode":53}],17:[function(e,t,n){"use strict";Object.defineProperties(n,{WalkontableScroll:{get:function(){return o}},__esModule:{value:!0}});var o=function(e){this.wot=e,this.instance=e};$traceurRuntime.createClass(o,{scrollViewport:function(e){if(this.wot.drawn){var t=this.wot.getSetting("totalRows"),n=this.wot.getSetting("totalColumns"),o=this.instance.getSetting("fixedRowsTop"),r=this.instance.getSetting("fixedRowsBottom"),i=this.instance.getSetting("fixedColumnsLeft");if(e.row<0||e.row>t-1)throw new Error("row "+e.row+" does not exist");if(e.col<0||e.col>n-1)throw new Error("column "+e.col+" does not exist");e.row>this.instance.wtTable.getLastVisibleRow()&&e.row=o&&e.rowthis.instance.wtTable.getLastVisibleColumn()?this.wot.wtOverlays.leftOverlay.scrollTo(e.col,!0):e.col>=i&&e.colu;u++)o=e.wtTable.columnFilter.renderedToSource(u),o>=a[1]&&o<=a[3]&&(r=e.wtTable.getColumnHeader(o),r&&this.settings.highlightColumnClassName&&l(r,this.settings.highlightColumnClassName));for(var c=0;i>c;c++){n=e.wtTable.rowFilter.renderedToSource(c),n>=a[0]&&n<=a[2]&&(r=e.wtTable.getRowHeader(n),r&&this.settings.highlightRowClassName&&l(r,this.settings.highlightRowClassName));for(var d=0;s>d;d++)o=e.wtTable.columnFilter.renderedToSource(d),n>=a[0]&&n<=a[2]&&o>=a[1]&&o<=a[3]?this.settings.className&&this.addClassAtCoords(e,n,o,this.settings.className):n>=a[0]&&n<=a[2]?this.settings.highlightRowClassName&&this.addClassAtCoords(e,n,o,this.settings.highlightRowClassName):o>=a[1]&&o<=a[3]&&this.settings.highlightColumnClassName&&this.addClassAtCoords(e,n,o,this.settings.highlightColumnClassName)}if(e.getSetting("onBeforeDrawBorders",a,this.settings.className),this.settings.border){var h=this.getBorder(e);h&&h.appear(a)}}}},{}),window.WalkontableSelection=d},{border:2,"cell/coords":5,"cell/range":6,"helpers/dom/element":45}],19:[function(e,t,n){"use strict";Object.defineProperties(n,{WalkontableSettings:{get:function(){return i}},__esModule:{value:!0}});var o,r=(o=e("helpers/dom/element"),o&&o.__esModule&&o||{"default":o}).fastInnerText,i=function(e,t){var n=this;this.wot=e,this.instance=e,this.defaults={table:void 0,debug:!1,externalRowCalculator:!1,stretchH:"none",currentRowClassName:null,currentColumnClassName:null,data:void 0,fixedColumnsLeft:0,fixedRowsTop:0,fixedRowsBottom:0,minSpareRows:0,rowHeaders:function(){return[]},columnHeaders:function(){return[]},totalRows:void 0,totalColumns:void 0,cellRenderer:function(e,t,o){var i=n.getSetting("data",e,t);r(o,void 0===i||null===i?"":i)},columnWidth:function(e){},rowHeight:function(e){},defaultRowHeight:23,defaultColumnWidth:50,selections:null,hideBorderOnMouseDownOver:!1,viewportRowCalculatorOverride:null,viewportColumnCalculatorOverride:null,onCellMouseDown:null,onCellMouseOver:null,onCellDblClick:null,onCellCornerMouseDown:null,onCellCornerDblClick:null,beforeDraw:null,onDraw:null,onBeforeDrawBorders:null,onScrollVertically:null,onScrollHorizontally:null,onBeforeTouchScroll:null,onAfterMomentumScroll:null,scrollbarWidth:10,scrollbarHeight:10,renderAllRows:!1,groups:!1},this.settings={};for(var o in this.defaults)if(this.defaults.hasOwnProperty(o))if(void 0!==t[o])this.settings[o]=t[o];else{if(void 0===this.defaults[o])throw new Error('A required setting "'+o+'" was not provided');this.settings[o]=this.defaults[o]}};$traceurRuntime.createClass(i,{update:function(e,t){if(void 0===t)for(var n in e)e.hasOwnProperty(n)&&(this.settings[n]=e[n]);else this.settings[e]=t;return this.wot},getSetting:function(e,t,n,o,r){return"function"==typeof this.settings[e]?this.settings[e](t,n,o,r):void 0!==t&&Array.isArray(this.settings[e])?this.settings[e][t]:this.settings[e]},has:function(e){return!!this.settings[e]}},{}),window.WalkontableSettings=i},{"helpers/dom/element":45}],20:[function(e,t,n){"use strict";Object.defineProperties(n,{WalkontableTable:{get:function(){return y}},__esModule:{value:!0}});var o,r,i,s,l,a,u=(o=e("helpers/dom/element"),o&&o.__esModule&&o||{"default":o}),c=u.getStyle,d=u.getTrimmingContainer,h=u.hasClass,f=u.index,g=u.offset,p=u.removeClass,m=u.removeTextNodes,w=(u.overlayContainsElement,(r=e("cell/coords"),r&&r.__esModule&&r||{"default":r}).WalkontableCellCoords),v=((i=e("cell/range"),i&&i.__esModule&&i||{"default":i}).WalkontableCellRange,(s=e("filter/column"),s&&s.__esModule&&s||{"default":s}).WalkontableColumnFilter),b=(l=e("filter/row"),l&&l.__esModule&&l||{"default":l}).WalkontableRowFilter,C=(a=e("tableRenderer"),a&&a.__esModule&&a||{"default":a}).WalkontableTableRenderer,y=function(e,t){this.wot=e,this.instance=this.wot,this.TABLE=t,this.TBODY=null,this.THEAD=null,this.COLGROUP=null,this.tableOffset=0,this.holderOffset=0,m(this.TABLE),this.spreader=this.createSpreader(this.TABLE),this.hider=this.createHider(this.spreader),this.holder=this.createHolder(this.hider),this.wtRootElement=this.holder.parentNode,this.alignOverlaysWithTrimmingContainer(),this.fixTableDomTree(),this.colgroupChildrenLength=this.COLGROUP.childNodes.length,this.theadChildrenLength=this.THEAD.firstChild?this.THEAD.firstChild.childNodes.length:0,this.tbodyChildrenLength=this.TBODY.childNodes.length,this.rowFilter=null,this.columnFilter=null};$traceurRuntime.createClass(y,{fixTableDomTree:function(){this.TBODY=this.TABLE.querySelector("tbody"),this.TBODY||(this.TBODY=document.createElement("tbody"),this.TABLE.appendChild(this.TBODY)),this.THEAD=this.TABLE.querySelector("thead"),this.THEAD||(this.THEAD=document.createElement("thead"),this.TABLE.insertBefore(this.THEAD,this.TBODY)),this.COLGROUP=this.TABLE.querySelector("colgroup"),this.COLGROUP||(this.COLGROUP=document.createElement("colgroup"),this.TABLE.insertBefore(this.COLGROUP,this.THEAD)),this.wot.getSetting("columnHeaders").length&&!this.THEAD.childNodes.length&&this.THEAD.appendChild(document.createElement("TR"))},createSpreader:function(e){var t,n=e.parentNode;return n&&1===n.nodeType&&h(n,"wtHolder")||(t=document.createElement("div"),t.className="wtSpreader",n&&n.insertBefore(t,e),t.appendChild(e)),t.style.position="relative",t},createHider:function(e){var t,n=e.parentNode;return n&&1===n.nodeType&&h(n,"wtHolder")||(t=document.createElement("div"),t.className="wtHider",n&&n.insertBefore(t,e),t.appendChild(e)),t},createHolder:function(e){var t,n=e.parentNode;return n&&1===n.nodeType&&h(n,"wtHolder")||(t=document.createElement("div"),t.style.position="relative",t.className="wtHolder",n&&n.insertBefore(t,e),this.isWorkingOnClone()||(t.parentNode.className+="ht_master handsontable"),t.appendChild(e)),t},alignOverlaysWithTrimmingContainer:function(){var e=d(this.wtRootElement);this.isWorkingOnClone()||(this.holder.parentNode.style.position="relative",e===window?(this.holder.style.overflow="visible",this.wtRootElement.style.overflow="visible"):(this.holder.style.width=c(e,"width"),this.holder.style.height=c(e,"height"),this.holder.style.overflow=""))},isWorkingOnClone:function(){return!!this.wot.cloneSource},draw:function(e){var t=this.instance.getSetting("totalRows");if(this.isWorkingOnClone()||(this.holderOffset=g(this.holder),e=this.wot.wtViewport.createRenderCalculators(e)),e)this.isWorkingOnClone()||this.wot.wtViewport.createVisibleCalculators(),this.wot.wtOverlays&&this.wot.wtOverlays.refresh(!0);else{this.isWorkingOnClone()?this.tableOffset=this.wot.cloneSource.wtTable.tableOffset:this.tableOffset=g(this.TABLE);var n;n=WalkontableOverlay.isOverlayTypeOf(this.wot.cloneOverlay,WalkontableOverlay.CLONE_DEBUG)||WalkontableOverlay.isOverlayTypeOf(this.wot.cloneOverlay,WalkontableOverlay.CLONE_TOP)||WalkontableOverlay.isOverlayTypeOf(this.wot.cloneOverlay,WalkontableOverlay.CLONE_TOP_LEFT_CORNER)?0:WalkontableOverlay.isOverlayTypeOf(this.instance.cloneOverlay,WalkontableOverlay.CLONE_BOTTOM)||WalkontableOverlay.isOverlayTypeOf(this.instance.cloneOverlay,WalkontableOverlay.CLONE_BOTTOM_LEFT_CORNER)?t-this.wot.getSetting("fixedRowsBottom"):this.wot.wtViewport.rowsRenderCalculator.startRow;var o;o=WalkontableOverlay.isOverlayTypeOf(this.wot.cloneOverlay,WalkontableOverlay.CLONE_DEBUG)||WalkontableOverlay.isOverlayTypeOf(this.wot.cloneOverlay,WalkontableOverlay.CLONE_LEFT)||WalkontableOverlay.isOverlayTypeOf(this.wot.cloneOverlay,WalkontableOverlay.CLONE_TOP_LEFT_CORNER)||WalkontableOverlay.isOverlayTypeOf(this.wot.cloneOverlay,WalkontableOverlay.CLONE_BOTTOM_LEFT_CORNER)?0:this.wot.wtViewport.columnsRenderCalculator.startColumn, -this.rowFilter=new b(n,t,this.wot.getSetting("columnHeaders").length),this.columnFilter=new v(o,this.wot.getSetting("totalColumns"),this.wot.getSetting("rowHeaders").length),this._doDraw(),this.alignOverlaysWithTrimmingContainer()}return this.refreshSelections(e),this.isWorkingOnClone()||(this.wot.wtOverlays.topOverlay.resetFixedPosition(),this.wot.wtOverlays.bottomOverlay.clone&&this.wot.wtOverlays.bottomOverlay.resetFixedPosition(),this.wot.wtOverlays.leftOverlay.resetFixedPosition(),this.wot.wtOverlays.topLeftCornerOverlay&&this.wot.wtOverlays.topLeftCornerOverlay.resetFixedPosition(),this.instance.wtOverlays.bottomLeftCornerOverlay&&this.instance.wtOverlays.bottomLeftCornerOverlay.clone&&this.wot.wtOverlays.bottomLeftCornerOverlay.resetFixedPosition()),this.wot.drawn=!0,this},_doDraw:function(){var e=new C(this);e.render()},removeClassFromCells:function(e){for(var t=this.TABLE.querySelectorAll("."+e),n=0,o=t.length;o>n;n++)p(t[n],e)},refreshSelections:function(e){if(this.wot.selections){var t=this.wot.selections.length;if(e)for(var n=0;t>n;n++)this.wot.selections[n].settings.className&&this.removeClassFromCells(this.wot.selections[n].settings.className),this.wot.selections[n].settings.highlightRowClassName&&this.removeClassFromCells(this.wot.selections[n].settings.highlightRowClassName),this.wot.selections[n].settings.highlightColumnClassName&&this.removeClassFromCells(this.wot.selections[n].settings.highlightColumnClassName);for(var o=0;t>o;o++)this.wot.selections[o].draw(this.wot,e)}},getCell:function(e){if(this.isRowBeforeRenderedRows(e.row))return-1;if(this.isRowAfterRenderedRows(e.row))return-2;var t=this.TBODY.childNodes[this.rowFilter.sourceToRendered(e.row)];return t?t.childNodes[this.columnFilter.sourceColumnToVisibleRowHeadedColumn(e.col)]:void 0},getColumnHeader:function(e){var t=void 0!==arguments[1]?arguments[1]:0,n=this.THEAD.childNodes[t];return n?n.childNodes[this.columnFilter.sourceColumnToVisibleRowHeadedColumn(e)]:void 0},getRowHeader:function(e){if(0===this.columnFilter.sourceColumnToVisibleRowHeadedColumn(0))return null;var t=this.TBODY.childNodes[this.rowFilter.sourceToRendered(e)];return t?t.childNodes[0]:void 0},getCoords:function(e){var t=e.parentNode,n=f(t);n=t.parentNode===this.THEAD?this.rowFilter.visibleColHeadedRowToSourceRow(n):this.rowFilter.renderedToSource(n);var o=this.columnFilter.visibleRowHeadedColumnToSourceColumn(e.cellIndex);return new w(n,o)},getTrForRow:function(e){return this.TBODY.childNodes[this.rowFilter.sourceToRendered(e)]},getFirstRenderedRow:function(){return this.wot.wtViewport.rowsRenderCalculator.startRow},getFirstVisibleRow:function(){return this.wot.wtViewport.rowsVisibleCalculator.startRow},getFirstRenderedColumn:function(){return this.wot.wtViewport.columnsRenderCalculator.startColumn},getFirstVisibleColumn:function(){return this.wot.wtViewport.columnsVisibleCalculator.startColumn},getLastRenderedRow:function(){return this.wot.wtViewport.rowsRenderCalculator.endRow},getLastVisibleRow:function(){return this.wot.wtViewport.rowsVisibleCalculator.endRow},getLastRenderedColumn:function(){return this.wot.wtViewport.columnsRenderCalculator.endColumn},getLastVisibleColumn:function(){return this.wot.wtViewport.columnsVisibleCalculator.endColumn},isRowBeforeRenderedRows:function(e){return this.rowFilter.sourceToRendered(e)<0&&e>=0},isRowAfterViewport:function(e){return this.rowFilter.sourceToRendered(e)>this.getLastVisibleRow()},isRowAfterRenderedRows:function(e){return this.rowFilter.sourceToRendered(e)>this.getLastRenderedRow()},isColumnBeforeViewport:function(e){return this.columnFilter.sourceToRendered(e)<0&&e>=0},isColumnAfterViewport:function(e){return this.columnFilter.sourceToRendered(e)>this.getLastVisibleColumn()},isLastRowFullyVisible:function(){return this.getLastVisibleRow()===this.getLastRenderedRow()},isLastColumnFullyVisible:function(){return this.getLastVisibleColumn()===this.getLastRenderedColumn()},getRenderedColumnsCount:function(){return WalkontableOverlay.isOverlayTypeOf(this.wot.cloneOverlay,WalkontableOverlay.CLONE_DEBUG)?this.wot.getSetting("totalColumns"):WalkontableOverlay.isOverlayTypeOf(this.wot.cloneOverlay,WalkontableOverlay.CLONE_LEFT)||WalkontableOverlay.isOverlayTypeOf(this.wot.cloneOverlay,WalkontableOverlay.CLONE_TOP_LEFT_CORNER)||WalkontableOverlay.isOverlayTypeOf(this.wot.cloneOverlay,WalkontableOverlay.CLONE_BOTTOM_LEFT_CORNER)?this.wot.getSetting("fixedColumnsLeft"):this.wot.wtViewport.columnsRenderCalculator.count},getRenderedRowsCount:function(){return WalkontableOverlay.isOverlayTypeOf(this.wot.cloneOverlay,WalkontableOverlay.CLONE_DEBUG)?this.wot.getSetting("totalRows"):WalkontableOverlay.isOverlayTypeOf(this.wot.cloneOverlay,WalkontableOverlay.CLONE_TOP)||WalkontableOverlay.isOverlayTypeOf(this.wot.cloneOverlay,WalkontableOverlay.CLONE_TOP_LEFT_CORNER)?this.wot.getSetting("fixedRowsTop"):WalkontableOverlay.isOverlayTypeOf(this.wot.cloneOverlay,WalkontableOverlay.CLONE_BOTTOM)||WalkontableOverlay.isOverlayTypeOf(this.wot.cloneOverlay,WalkontableOverlay.CLONE_BOTTOM_LEFT_CORNER)?this.instance.getSetting("fixedRowsBottom"):this.wot.wtViewport.rowsRenderCalculator.count},getVisibleRowsCount:function(){return this.wot.wtViewport.rowsVisibleCalculator.count},allRowsInViewport:function(){return this.wot.getSetting("totalRows")==this.getVisibleRowsCount()},getRowHeight:function(e){var t=this.wot.wtSettings.settings.rowHeight(e),n=this.wot.wtViewport.oversizedRows[e];return void 0!==n&&(t=void 0===t?n:Math.max(t,n)),t},getColumnHeaderHeight:function(e){var t=this.wot.wtSettings.settings.defaultRowHeight,n=this.wot.wtViewport.oversizedColumnHeaders[e];return void 0!==n&&(t=t?Math.max(t,n):n),t},getVisibleColumnsCount:function(){return this.wot.wtViewport.columnsVisibleCalculator.count},allColumnsInViewport:function(){return this.wot.getSetting("totalColumns")==this.getVisibleColumnsCount()},getColumnWidth:function(e){var t=this.wot.wtSettings.settings.columnWidth;return"function"==typeof t?t=t(e):"object"==typeof t&&(t=t[e]),t||this.wot.wtSettings.settings.defaultColumnWidth},getStretchedColumnWidth:function(e){var t=this.getColumnWidth(e),n=-1===[void 0,null].indexOf(t)?t:this.instance.wtSettings.settings.defaultColumnWidth,o=this.wot.wtViewport.columnsRenderCalculator;if(o){var r=o.getStretchedColumnWidth(e,n);r&&(n=r)}return n}},{}),window.WalkontableTable=y},{"cell/coords":5,"cell/range":6,"filter/column":9,"filter/row":10,"helpers/dom/element":45,tableRenderer:21}],21:[function(e,t,n){"use strict";function o(e,t){var n=document.createElement("TH");return t.insertBefore(n,e),t.removeChild(e),n}function r(e,t){var n=document.createElement("TD");return t.insertBefore(n,e),t.removeChild(e),n}Object.defineProperties(n,{WalkontableTableRenderer:{get:function(){return h}},__esModule:{value:!0}});var i,s=(i=e("helpers/dom/element"),i&&i.__esModule&&i||{"default":i}),l=s.addClass,a=s.empty,u=s.getScrollbarWidth,c=s.hasClass,d=s.innerHeight,h=function(e){this.wtTable=e,this.wot=e.instance,this.instance=e.instance,this.rowFilter=e.rowFilter,this.columnFilter=e.columnFilter,this.TABLE=e.TABLE,this.THEAD=e.THEAD,this.TBODY=e.TBODY,this.COLGROUP=e.COLGROUP,this.rowHeaders=[],this.rowHeaderCount=0,this.columnHeaders=[],this.columnHeaderCount=0,this.fixedRowsTop=0,this.fixedRowsBottom=0};$traceurRuntime.createClass(h,{render:function(){this.wtTable.isWorkingOnClone()||this.wot.getSetting("beforeDraw",!0),this.rowHeaders=this.wot.getSetting("rowHeaders"),this.rowHeaderCount=this.rowHeaders.length,this.fixedRowsTop=this.wot.getSetting("fixedRowsTop"),this.fixedRowsBottom=this.wot.getSetting("fixedRowsBottom"),this.columnHeaders=this.wot.getSetting("columnHeaders"),this.columnHeaderCount=this.columnHeaders.length;var e,t=this.wtTable.getRenderedColumnsCount(),n=this.wtTable.getRenderedRowsCount(),o=this.wot.getSetting("totalColumns"),r=this.wot.getSetting("totalRows"),i=!1;if((WalkontableOverlay.isOverlayTypeOf(this.wot.cloneOverlay,WalkontableOverlay.CLONE_BOTTOM)||WalkontableOverlay.isOverlayTypeOf(this.wot.cloneOverlay,WalkontableOverlay.CLONE_BOTTOM_LEFT_CORNER))&&(this.columnHeaders=[],this.columnHeaderCount=0),o>0&&(this.adjustAvailableNodes(),i=!0,this.renderColumnHeaders(),this.renderRows(r,n,t),this.wtTable.isWorkingOnClone()||(e=this.wot.wtViewport.getWorkspaceWidth(),this.wot.wtViewport.containerWidth=null),this.adjustColumnHeaderHeights(),this.adjustColumnWidths(t),this.markOversizedColumns()),i||this.adjustAvailableNodes(),this.removeRedundantRows(n),this.wtTable.isWorkingOnClone()){if(WalkontableOverlay.isOverlayTypeOf(this.wot.cloneOverlay,WalkontableOverlay.CLONE_BOTTOM)){var s=this.wot.cloneOverlay.instance;this.wot.cloneOverlay.markOversizedFixedBottomRows(),s.wtOverlays.adjustElementsSize()}}else{if(this.markOversizedRows(),this.wot.wtViewport.createVisibleCalculators(),this.wot.wtOverlays.refresh(!1),this.wot.wtOverlays.applyToDOM(),e!==this.wot.wtViewport.getWorkspaceWidth()){this.wot.wtViewport.containerWidth=null;for(var l=this.wtTable.getFirstRenderedColumn(),a=this.wtTable.getLastRenderedColumn(),u=l;a>u;u++){var c=this.wtTable.getStretchedColumnWidth(u),d=this.columnFilter.sourceToRendered(u);this.COLGROUP.childNodes[d+this.rowHeaderCount].style.width=c+"px"}}this.wot.getSetting("onDraw",!0)}},removeRedundantRows:function(e){for(;this.wtTable.tbodyChildrenLength>e;)this.TBODY.removeChild(this.TBODY.lastChild),this.wtTable.tbodyChildrenLength--},renderRows:function(e,t,n){for(var o,r,i=0,s=this.rowFilter.renderedToSource(i),l=this.wtTable.isWorkingOnClone();e>s&&s>=0&&(i>1e3&&console.error("Security brake: Too much TRs. Please define height for your table, which will enforce scrollbars."),void 0===t||i!==t);){if(r=this.getOrCreateTrForRow(i,r),this.renderRowHeaders(s,r),this.adjustColumns(r,n+this.rowHeaderCount),o=this.renderCells(s,r,n),(!l||WalkontableOverlay.isOverlayTypeOf(this.wot.cloneOverlay,WalkontableOverlay.CLONE_BOTTOM))&&this.resetOversizedRow(s),r.firstChild){var a=this.wot.wtTable.getRowHeight(s);a?(a--,r.firstChild.style.height=a+"px"):r.firstChild.style.height=""}i++,s=this.rowFilter.renderedToSource(i)}},resetOversizedRow:function(e){this.wot.getSetting("externalRowCalculator")||this.wot.wtViewport.oversizedRows&&this.wot.wtViewport.oversizedRows[e]&&(this.wot.wtViewport.oversizedRows[e]=void 0)},markOversizedRows:function(){if(!this.wot.getSetting("externalRowCalculator")){var e,t,n,o,r,i=this.instance.wtTable.TBODY.childNodes.length,s=i*this.instance.wtSettings.settings.defaultRowHeight,l=d(this.instance.wtTable.TBODY)-1;this.instance.getSetting("totalRows");if(s!==l||this.instance.getSetting("fixedRowsBottom"))for(;i;)i--,n=this.instance.wtTable.rowFilter.renderedToSource(i),e=this.instance.wtTable.getRowHeight(n),o=this.instance.wtTable.getTrForRow(n),r=o.querySelector("th"),t=r?d(r):d(o)-1,(!e&&this.instance.wtSettings.settings.defaultRowHeighte)&&(this.instance.wtViewport.oversizedRows[n]=++t)}},markOversizedColumns:function(){var e=this.wot.getOverlayName();if(this.columnHeaderCount&&!this.wot.wtViewport.isMarkedOversizedColumn[e]&&!this.wtTable.isWorkingOnClone()){for(var t=this.wtTable.getRenderedColumnsCount(),n=0;no;o++)this.markIfOversizedColumnHeader(o);this.wot.wtViewport.isMarkedOversizedColumn[e]=!0}},adjustColumnHeaderHeights:function(){for(var e=this.wot.getSetting("columnHeaders"),t=this.wot.wtTable.THEAD.childNodes,n=this.wot.wtViewport.oversizedColumnHeaders,o=0,r=e.length;r>o;o++)if(n[o]){if(0===t[o].childNodes.length)return;t[o].childNodes[0].style.height=n[o]+"px"}},markIfOversizedColumnHeader:function(e){for(var t,n,o,r=this.wot.wtTable.columnFilter.renderedToSource(e),i=this.columnHeaderCount,s=this.wot.wtSettings.settings.defaultRowHeight;i;)i--,t=this.wot.wtTable.getColumnHeaderHeight(i),n=this.wot.wtTable.getColumnHeader(r,i),n&&(o=d(n),(!t&&o>s||o>t)&&(this.wot.wtViewport.oversizedColumnHeaders[i]=o))},renderCells:function(e,t,n){for(var o,i,s=0;n>s;s++)i=this.columnFilter.renderedToSource(s),o=0===s?t.childNodes[this.columnFilter.sourceColumnToVisibleRowHeadedColumn(i)]:o.nextSibling,"TH"==o.nodeName&&(o=r(o,t)),c(o,"hide")||(o.className=""),o.removeAttribute("style"),this.wot.wtSettings.settings.cellRenderer(e,i,o);return o},adjustColumnWidths:function(e){var t=0,n=this.wot.cloneSource?this.wot.cloneSource:this.wot,o=n.wtTable.holder;o.offsetHeightr;r++){var i=this.wtTable.getStretchedColumnWidth(this.columnFilter.renderedToSource(r));this.COLGROUP.childNodes[r+this.rowHeaderCount].style.width=i+"px"}},appendToTbody:function(e){this.TBODY.appendChild(e),this.wtTable.tbodyChildrenLength++},getOrCreateTrForRow:function(e,t){var n;return e>=this.wtTable.tbodyChildrenLength?(n=this.createRow(),this.appendToTbody(n)):n=0===e?this.TBODY.firstChild:t.nextSibling,n.className&&n.removeAttribute("class"),n},createRow:function(){for(var e=document.createElement("TR"),t=0;to;o++){var r=this.columnFilter.renderedToSource(o);this.renderColumnHeader(t,r,n.childNodes[o+this.rowHeaderCount])}},adjustColGroups:function(){for(var e=this.wtTable.getRenderedColumnsCount();this.wtTable.colgroupChildrenLengthe+this.rowHeaderCount;)this.COLGROUP.removeChild(this.COLGROUP.lastChild),this.wtTable.colgroupChildrenLength--;this.rowHeaderCount&&l(this.COLGROUP.childNodes[0],"rowHeader")},adjustThead:function(){var e=this.wtTable.getRenderedColumnsCount(),t=this.THEAD.firstChild;if(this.columnHeaders.length){for(var n=0,o=this.columnHeaders.length;o>n;n++){for(t=this.THEAD.childNodes[n],t||(t=document.createElement("TR"),this.THEAD.appendChild(t)),this.theadChildrenLength=t.childNodes.length;this.theadChildrenLengthe+this.rowHeaderCount;)t.removeChild(t.lastChild),this.theadChildrenLength--}var r=this.THEAD.childNodes.length;if(r>this.columnHeaders.length)for(var i=this.columnHeaders.length;r>i;i++)this.THEAD.removeChild(this.THEAD.lastChild)}else t&&a(t)},getTrForColumnHeaders:function(e){return this.THEAD.childNodes[e]},renderColumnHeader:function(e,t,n){return n.className="",n.removeAttribute("style"),this.columnHeaders[e](t,n,e)},adjustColumns:function(e,t){for(var n=e.childNodes.length;t>n;){var o=document.createElement("TD");e.appendChild(o),n++}for(;n>t;)e.removeChild(e.lastChild),n--},removeRedundantColumns:function(e){for(;this.wtTable.tbodyChildrenLength>e;)this.TBODY.removeChild(this.TBODY.lastChild),this.wtTable.tbodyChildrenLength--}},{}),window.WalkontableTableRenderer=h},{"helpers/dom/element":45}],22:[function(e,t,n){"use strict";Object.defineProperties(n,{WalkontableViewport:{get:function(){return w}},__esModule:{value:!0}});var o,r,i,s,l=(o=e("helpers/dom/element"),o&&o.__esModule&&o||{"default":o}),a=l.getScrollbarWidth,u=l.getScrollTop,c=l.getStyle,d=l.offset,h=l.outerHeight,f=l.outerWidth,g=(r=e("eventManager"),r&&r.__esModule&&r||{"default":r}).EventManager,p=(i=e("calculator/viewportColumns"),i&&i.__esModule&&i||{"default":i}).WalkontableViewportColumnsCalculator,m=(s=e("calculator/viewportRows"),s&&s.__esModule&&s||{"default":s}).WalkontableViewportRowsCalculator,w=function(e){var t=this;this.wot=e,this.instance=this.wot,this.oversizedRows=[],this.oversizedColumnHeaders=[],this.isMarkedOversizedColumn={},this.clientHeight=0,this.containerWidth=NaN,this.rowHeaderWidth=NaN,this.rowsVisibleCalculator=null,this.columnsVisibleCalculator=null,this.eventManager=new g(this.wot),this.eventManager.addEventListener(window,"resize",function(){t.clientHeight=t.getWorkspaceHeight()})};$traceurRuntime.createClass(w,{getWorkspaceHeight:function(){var e,t=this.instance.wtOverlays.topOverlay.trimmingContainer,n=0;return t===window?n=document.documentElement.clientHeight:(e=h(t),n=e>0&&t.clientHeight>0?t.clientHeight:1/0),n},getWorkspaceWidth:function(){var e,t,n=this.instance.getSetting("totalColumns"),o=this.instance.wtOverlays.leftOverlay.trimmingContainer,r=this.instance.getSetting("stretchH"),i=document.documentElement.offsetWidth;return e=Handsontable.freezeOverlays?Math.min(i-this.getWorkspaceOffset().left,i):Math.min(this.getContainerFillWidth(),i-this.getWorkspaceOffset().left,i),o===window&&n>0&&this.sumColumnWidths(0,n-1)>e?document.documentElement.clientWidth:o!==window&&(t=c(this.instance.wtOverlays.leftOverlay.trimmingContainer,"overflow"),"scroll"==t||"hidden"==t||"auto"==t)?Math.max(e,o.clientWidth):"none"!==r&&r?e:Math.max(e,f(this.instance.wtTable.TABLE))},hasVerticalScroll:function(){return this.getWorkspaceActualHeight()>this.getWorkspaceHeight()},hasHorizontalScroll:function(){return this.getWorkspaceActualWidth()>this.getWorkspaceWidth()},sumColumnWidths:function(e,t){for(var n=0;t>e;)n+=this.wot.wtTable.getColumnWidth(e),e++;return n},getContainerFillWidth:function(){if(this.containerWidth)return this.containerWidth;var e,t,n=this.instance.wtTable.holder;return t=document.createElement("div"),t.style.width="100%",t.style.height="1px",n.appendChild(t),e=t.offsetWidth,this.containerWidth=e,n.removeChild(t),e},getWorkspaceOffset:function(){return d(this.wot.wtTable.TABLE)},getWorkspaceActualHeight:function(){return h(this.wot.wtTable.TABLE)},getWorkspaceActualWidth:function(){return f(this.wot.wtTable.TABLE)||f(this.wot.wtTable.TBODY)||f(this.wot.wtTable.THEAD)},getColumnHeaderHeight:function(){return isNaN(this.columnHeaderHeight)&&(this.columnHeaderHeight=h(this.wot.wtTable.THEAD)),this.columnHeaderHeight},getViewportHeight:function(){var e,t=this.getWorkspaceHeight();return t===1/0?t:(e=this.getColumnHeaderHeight(),e>0&&(t-=e),t)},getRowHeaderWidth:function(){if(this.wot.cloneSource)return this.wot.cloneSource.wtViewport.getRowHeaderWidth();if(isNaN(this.rowHeaderWidth)){var e=this.instance.getSetting("rowHeaders");if(e.length){var t=this.instance.wtTable.TABLE.querySelector("TH");this.rowHeaderWidth=0;for(var n=0,o=e.length;o>n;n++)t?(this.rowHeaderWidth+=f(t),t=t.nextSibling):this.rowHeaderWidth+=50}else this.rowHeaderWidth=0}return this.rowHeaderWidth},getViewportWidth:function(){var e,t=this.getWorkspaceWidth();return t===1/0?t:(e=this.getRowHeaderWidth(),e>0?t-e:t)},createRowsCalculator:function(){var e,t,n,o,r,i,s,l=void 0!==arguments[0]?arguments[0]:!1,c=this;return this.rowHeaderWidth=NaN,e=this.wot.wtSettings.settings.renderAllRows?1/0:this.getViewportHeight(),t=u(this.wot.wtOverlays.mainTableScrollableElement)-this.wot.wtOverlays.topOverlay.getTableParentOffset(),0>t&&(t=0),n=this.wot.getSetting("fixedRowsTop"),r=this.wot.getSetting("fixedRowsBottom"),s=this.wot.getSetting("totalRows"),n&&(i=this.wot.wtOverlays.topOverlay.sumCellSizes(0,n),t+=i,e-=i),r&&this.wot.wtOverlays.bottomOverlay.clone&&(i=this.wot.wtOverlays.bottomOverlay.sumCellSizes(s-r,s),e-=i),o=this.wot.wtTable.holder.clientHeight===this.wot.wtTable.holder.offsetHeight?0:a(),new m(e,t,this.wot.getSetting("totalRows"),function(e){return c.wot.wtTable.getRowHeight(e)},l?null:this.wot.wtSettings.settings.viewportRowCalculatorOverride,l,o)},createColumnsCalculator:function(){var e,t,n=void 0!==arguments[0]?arguments[0]:!1,o=this,r=this.getViewportWidth();if(this.columnHeaderHeight=NaN,e=this.wot.wtOverlays.leftOverlay.getScrollPosition()-this.wot.wtOverlays.leftOverlay.getTableParentOffset(),0>e&&(e=0),t=this.wot.getSetting("fixedColumnsLeft")){var i=this.wot.wtOverlays.leftOverlay.sumCellSizes(0,t);e+=i,r-=i}return this.wot.wtTable.holder.clientWidth!==this.wot.wtTable.holder.offsetWidth&&(r-=a()),new p(r,e,this.wot.getSetting("totalColumns"),function(e){return o.wot.wtTable.getColumnWidth(e)},n?null:this.wot.wtSettings.settings.viewportColumnCalculatorOverride,n,this.wot.getSetting("stretchH"))},createRenderCalculators:function(){var e=void 0!==arguments[0]?arguments[0]:!1;if(e){var t=this.createRowsCalculator(!0),n=this.createColumnsCalculator(!0);this.areAllProposedVisibleRowsAlreadyRendered(t)&&this.areAllProposedVisibleColumnsAlreadyRendered(n)||(e=!1)}return e||(this.rowsRenderCalculator=this.createRowsCalculator(),this.columnsRenderCalculator=this.createColumnsCalculator()),this.rowsVisibleCalculator=null,this.columnsVisibleCalculator=null,e},createVisibleCalculators:function(){this.rowsVisibleCalculator=this.createRowsCalculator(!0),this.columnsVisibleCalculator=this.createColumnsCalculator(!0)},areAllProposedVisibleRowsAlreadyRendered:function(e){return this.rowsVisibleCalculator?e.startRow0?!1:e.endRow>this.rowsRenderCalculator.endRow||e.endRow===this.rowsRenderCalculator.endRow&&e.endRow0?!1:e.endColumn>this.columnsRenderCalculator.endColumn||e.endColumn===this.columnsRenderCalculator.endColumn&&e.endColumn=0;s--)if(null===e[s])e.splice(s,1);else{var l=e[s][0],a=d.propToCol(e[s][1]),u=m.runHooks("modifyCol",a),c=m.getCellMeta(l,u);if("numeric"===c.type&&"string"==typeof e[s][3]&&e[s][3].length>0&&(/^-?[\d\s]*(\.|\,)?\d*$/.test(e[s][3])||c.format)){var h=e[s][3].length;"undefined"==typeof c.language?R.language("en"):e[s][3].indexOf(".")===h-3&&-1===e[s][3].indexOf(",")?R.language("en"):R.language(c.language),R.validate(e[s][3])&&(e[s][3]=R().unformat(e[s][3]))}m.getCellValidator(c)&&(i.addValidatorToQueue(),m.validateCell(e[s][3],c,function(t,n){return function(o){if("boolean"!=typeof o)throw new Error("Validation error: result is not boolean");o===!1&&n.allowInvalid===!1&&(e.splice(t,1),n.valid=!0,--t),i.removeValidatorFormQueue()}}(s,c),t))}i.checkIfQueueIsEmpty()}function r(e,t){var n=e.length-1;if(!(0>n)){for(;n>=0;n--)if(null!==e[n]){if(null!=e[n][2]||null!=e[n][3]){if(c.settings.allowInsertRow)for(;e[n][0]>m.countRows()-1;)d.createRow();if("array"===m.dataType&&c.settings.allowInsertColumn)for(;d.propToCol(e[n][1])>m.countCols()-1;)d.createCol();d.set(e[n][0],e[n][1],e[n][3])}}else e.splice(n,1);m.forceFullRender=!0,f.adjustRowsAndCols(),Handsontable.hooks.run(m,"beforeChangeRender",e,t), -g.refreshBorders(null,!0),m.view.wt.wtOverlays.adjustElementsSize(),Handsontable.hooks.run(m,"afterChange",e,t||"edit")}}function i(e,t,n){return"object"==typeof e?e:[[e,t,n]]}function s(e){if(e.hasOwnProperty("type")){var t,n={};if("object"==typeof e.type)t=e.type;else if("string"==typeof e.type&&(t=Handsontable.cellTypes[e.type],void 0===t))throw new Error('You declared cell type "'+e.type+'" as a string that is not mapped to a known object. Cell type must be an object or a string mapped to an object in Handsontable.cellTypes');for(var o in t)t.hasOwnProperty(o)&&!e.hasOwnProperty(o)&&(n[o]=t[o]);return n}}function l(e){return Handsontable.hooks.run(m,"modifyRow",e)}function a(e){return Handsontable.hooks.run(m,"modifyCol",e)}function u(){throw new Error("This method cannot be called because this Handsontable instance has been destroyed")}var c,d,h,f,g,p,m=this,w=function(){},v=A(m);x(w.prototype,Q.prototype),x(w.prototype,t),x(w.prototype,s(t)),this.rootElement=e,this.isHotTableEnv=O(this.rootElement),Handsontable.eventManager.isHotTableEnv=this.isHotTableEnv,this.container=document.createElement("DIV"),this.renderCall=!1,e.insertBefore(this.container,e.firstChild),this.guid="ht_"+B(),this.rootElement.id&&"ht_"!==this.rootElement.id.substring(0,3)||(this.rootElement.id=this.guid),c={cellSettings:[],columnSettings:[],columnsSettingConflicts:["data","width"],settings:new w,selRange:null,isPopulated:null,scrollable:null,firstRun:!0},f={alter:function(e,t,n,o,r){var i;switch(n=n||1,e){case"insert_row":if(m.getSettings().maxRows===m.countSourceRows())return;i=d.createRow(t,n),i&&(g.isSelected()&&c.selRange.from.row>=t?(c.selRange.from.row=c.selRange.from.row+i,g.transformEnd(i,0)):g.refreshBorders());break;case"insert_col":if(i=d.createCol(t,n)){if(Array.isArray(m.getSettings().colHeaders)){var s=[t,0];s.length+=i,Array.prototype.splice.apply(m.getSettings().colHeaders,s)}g.isSelected()&&c.selRange.from.col>=t?(c.selRange.from.col=c.selRange.from.col+i,g.transformEnd(0,i)):g.refreshBorders()}break;case"remove_row":d.removeRow(t,n),c.cellSettings.splice(t,n);var l=m.countRows(),a=m.getSettings().fixedRowsTop;a>=t+1&&(m.getSettings().fixedRowsTop-=Math.min(n,a-t));var u=m.getSettings().fixedRowsBottom;u&&t+1>=l-u&&(m.getSettings().fixedRowsBottom-=Math.min(n,u-t)),f.adjustRowsAndCols(),g.refreshBorders();break;case"remove_col":d.removeCol(t,n);for(var h=0,p=d.getAll().length;p>h;h++)h in c.cellSettings&&c.cellSettings[h].splice(t,n);var w=m.getSettings().fixedColumnsLeft;w>=t+1&&(m.getSettings().fixedColumnsLeft-=Math.min(n,w-t)),Array.isArray(m.getSettings().colHeaders)&&("undefined"==typeof t&&(t=-1),m.getSettings().colHeaders.splice(t,n)),f.adjustRowsAndCols(),g.refreshBorders();break;default:throw new Error('There is no such action "'+e+'"')}r||f.adjustRowsAndCols()},adjustRowsAndCols:function(){if(c.settings.minRows){var e=m.countRows();if(et;t++)d.createRow(m.countRows(),1,!0)}if(c.settings.minSpareRows){var o=m.countEmptyRows(!0);if(oi-1?(a=i-1,l=!0,h>a&&(h=a)):h>i-1&&(h=i-1,l=!0,a>h&&(a=h)),u>s-1?(u=s-1,l=!0,f>u&&(f=u)):f>s-1&&(f=s-1,l=!0,u>f&&(u=f)),l&&m.selectCell(a,u,h,f)}m.view&&m.view.wt.wtOverlays.adjustElementsSize()},populateFromArray:function(e,t,n,o,r,i,s){var l,a,u,d,h=[],f={};if(a=t.length,0===a)return!1;var g,p,w,v;({row:null===n?null:n.row,col:null===n?null:n.col});switch(r){case"shift_down":for(g=n?n.col-e.col+1:0,p=n?n.row-e.row+1:0,t=G(t),u=0,d=t.length,w=Math.max(d,g);w>u;u++)if(d>u){for(l=0,a=t[u].length;p-a>l;l++)t[u].push(t[u][l%a]);t[u].unshift(e.col+u,e.row,0),m.spliceCol.apply(m,t[u])}else t[u%d][0]=e.col+u,m.spliceCol.apply(m,t[u%d]);break;case"shift_right":for(g=n?n.col-e.col+1:0,p=n?n.row-e.row+1:0,l=0,a=t.length,v=Math.max(a,p);v>l;l++)if(a>l){for(u=0,d=t[l].length;g-d>u;u++)t[l].push(t[l][u%d]);t[l].unshift(e.row+l,e.col,0),m.spliceRow.apply(m,t[l])}else t[l%a][0]=e.row+l,m.spliceRow.apply(m,t[l%a]);break;case"overwrite":default:f.row=e.row,f.col=e.col;var b,C={row:n&&e?n.row-e.row+1:1,col:n&&e?n.col-e.col+1:1},y=0,R=0,E=!0,S=function(e){var n=void 0!==arguments[1]?arguments[1]:null,o=t[e%t.length];return null!==n?o[n%o.length]:o},T=t.length,O=n?n.row-e.row+1:0;for(a=n?O:Math.max(T,O),l=0;a>l&&!(n&&f.row>n.row&&O>T||!c.settings.allowInsertRow&&f.row>m.countRows()-1||f.row>=c.settings.maxRows);l++){var _=l-y,M=S(_).length,H=n?n.col-e.col+1:0;if(d=n?H:Math.max(M,H),f.col=e.col,b=m.getCellMeta(f.row,f.col),"paste"!==o&&"autofill"!==o||!b.skipRowOnPaste){for(R=0,u=0;d>u&&!(n&&f.col>n.col&&H>M||!c.settings.allowInsertColumn&&f.col>m.countCols()-1||f.col>=c.settings.maxCols);u++)if(b=m.getCellMeta(f.row,f.col),"paste"!==o&&"autofill"!==o||!b.skipColumnOnPaste)if(b.readOnly)f.col++;else{var k=u-R,A=S(_,k),P=m.getDataAtCell(f.row,f.col),x={row:_,col:k};if("autofill"===o){var W=m.runHooks("beforeAutofillInsidePopulate",x,i,t,s,{},C);W&&(A="undefined"==typeof W.value?A:W.value)}if(null!==A&&"object"==typeof A)if(null===P||"object"!=typeof P)E=!1;else{var I=D(P[0]||P),j=D(A[0]||A);N(I,j)?A=L(A):E=!1}else null!==P&&"object"==typeof P&&(E=!1);E&&h.push([f.row,f.col,A]),E=!0,f.col++}else R++,f.col++,d++;f.row++}else y++,f.row++,a++}m.setDataAtCell(h,null,null,o||"populateFromArray")}}},this.selection=g={inProgress:!1,selectedHeader:{cols:!1,rows:!1},setSelectedHeaders:function(e,t){m.selection.selectedHeader.rows=e,m.selection.selectedHeader.cols=t},begin:function(){m.selection.inProgress=!0},finish:function(){var e=m.getSelected();Handsontable.hooks.run(m,"afterSelectionEnd",e[0],e[1],e[2],e[3]),Handsontable.hooks.run(m,"afterSelectionEndByProp",e[0],m.colToProp(e[1]),e[2],m.colToProp(e[3])),m.selection.inProgress=!1},isInProgress:function(){return m.selection.inProgress},setRangeStart:function(e,t){Handsontable.hooks.run(m,"beforeSetRangeStart",e),c.selRange=new X(e,e,e),g.setRangeEnd(e,null,t)},setRangeEnd:function(e,t,n){if(null!==c.selRange){var o,r=!1,i=!0,s=m.view.wt.wtTable.getFirstVisibleRow(),l=m.view.wt.wtTable.getFirstVisibleColumn(),a={row:null,col:null};Handsontable.hooks.run(m,"beforeSetRangeEnd",e),m.selection.begin(),a.row=e.row<0?s:e.row,a.col=e.col<0?l:e.col,c.selRange.to=new Y(a.row,a.col),c.settings.multiSelect||(c.selRange.from=e),m.view.wt.selections.current.clear(),o=m.getCellMeta(c.selRange.highlight.row,c.selRange.highlight.col).disableVisualSelection,"string"==typeof o&&(o=[o]),(o===!1||Array.isArray(o)&&-1===o.indexOf("current"))&&m.view.wt.selections.current.add(c.selRange.highlight),m.view.wt.selections.area.clear(),(o===!1||Array.isArray(o)&&-1===o.indexOf("area"))&&g.isMultiple()&&(m.view.wt.selections.area.add(c.selRange.from),m.view.wt.selections.area.add(c.selRange.to)),(c.settings.currentRowClassName||c.settings.currentColClassName)&&(m.view.wt.selections.highlight.clear(),m.view.wt.selections.highlight.add(c.selRange.from),m.view.wt.selections.highlight.add(c.selRange.to)),Handsontable.hooks.run(m,"afterSelection",c.selRange.from.row,c.selRange.from.col,c.selRange.to.row,c.selRange.to.col),Handsontable.hooks.run(m,"afterSelectionByProp",c.selRange.from.row,d.colToProp(c.selRange.from.col),c.selRange.to.row,d.colToProp(c.selRange.to.col)),(0===c.selRange.from.row&&c.selRange.to.row===m.countRows()-1&&m.countRows()>1||0===c.selRange.from.col&&c.selRange.to.col===m.countCols()-1&&m.countCols()>1)&&(r=!0),(e.row<0||e.col<0)&&(i=!1),t!==!1&&!r&&i&&(c.selRange.from&&!g.isMultiple()?m.view.scrollViewport(c.selRange.from):m.view.scrollViewport(e)),g.refreshBorders(null,n)}},refreshBorders:function(e,t){t||p.destroyEditor(e),m.view.render(),g.isSelected()&&!t&&p.prepareEditor()},isMultiple:function(){var e=!(c.selRange.to.col===c.selRange.from.col&&c.selRange.to.row===c.selRange.from.row),t=Handsontable.hooks.run(m,"afterIsMultipleSelection",e);return e?t:void 0},transformStart:function(e,t,n,o){var r,i,s,l,a=new Y(e,t),u=0,d=0;m.runHooks("modifyTransformStart",a),r=m.countRows(),i=m.countCols(),l=m.getSettings().fixedRowsBottom,c.selRange.highlight.row+e>r-1?n&&c.settings.minSpareRows>0&&!(l&&c.selRange.highlight.row>=r-l-1)?(m.alter("insert_row",r),r=m.countRows()):c.settings.autoWrapCol&&(a.row=1-r,a.col=c.selRange.highlight.col+a.col==i-1?1-i:1):c.settings.autoWrapCol&&c.selRange.highlight.row+a.row<0&&c.selRange.highlight.col+a.col>=0&&(a.row=r-1,a.col=c.selRange.highlight.col+a.col==0?i-1:-1),c.selRange.highlight.col+a.col>i-1?n&&c.settings.minSpareCols>0?(m.alter("insert_col",i),i=m.countCols()):c.settings.autoWrapRow&&(a.row=c.selRange.highlight.row+a.row==r-1?1-r:1,a.col=1-i):c.settings.autoWrapRow&&c.selRange.highlight.col+a.col<0&&c.selRange.highlight.row+a.row>=0&&(a.row=c.selRange.highlight.row+a.row==0?r-1:-1,a.col=i-1),s=new Y(c.selRange.highlight.row+a.row,c.selRange.highlight.col+a.col),s.row<0?(u=-1,s.row=0):s.row>0&&s.row>=r&&(u=1,s.row=r-1),s.col<0?(d=-1,s.col=0):s.col>0&&s.col>=i&&(d=1,s.col=i-1),m.runHooks("afterModifyTransformStart",s,u,d),g.setRangeStart(s,o)},transformEnd:function(e,t){var n,o,r,i=new Y(e,t),s=0,l=0;m.runHooks("modifyTransformEnd",i),n=m.countRows(),o=m.countCols(),r=new Y(c.selRange.to.row+i.row,c.selRange.to.col+i.col),r.row<0?(s=-1,r.row=0):r.row>0&&r.row>=n&&(s=1,r.row=n-1),r.col<0?(l=-1,r.col=0):r.col>0&&r.col>=o&&(l=1,r.col=o-1),m.runHooks("afterModifyTransformEnd",r,s,l),g.setRangeEnd(r,!0)},isSelected:function(){return null!==c.selRange},inInSelection:function(e){return g.isSelected()?c.selRange.includes(e):!1},deselect:function(){g.isSelected()&&(m.selection.inProgress=!1,c.selRange=null,m.view.wt.selections.current.clear(),m.view.wt.selections.area.clear(),(c.settings.currentRowClassName||c.settings.currentColClassName)&&m.view.wt.selections.highlight.clear(),p.destroyEditor(),g.refreshBorders(),Handsontable.hooks.run(m,"afterDeselect"))},selectAll:function(){c.settings.multiSelect&&(g.setRangeStart(new Y(0,0)),g.setRangeEnd(new Y(m.countRows()-1,m.countCols()-1),!1))},empty:function(){if(g.isSelected()){var e,t,n=c.selRange.getTopLeftCorner(),o=c.selRange.getBottomRightCorner(),r=[];for(e=n.row;e<=o.row;e++)for(t=n.col;t<=o.col;t++)m.getCellMeta(e,t).readOnly||r.push([e,t,""]);m.setDataAtCell(r)}}},this.init=function(){h=new z(m,c.settings.data),Handsontable.hooks.run(m,"beforeInit"),Handsontable.mobileBrowser&&S(m.rootElement,"mobile"),this.updateSettings(c.settings,!0),this.view=new F(this),p=new k(m,c,g,d),this.forceFullRender=!0,Handsontable.hooks.run(m,"init"),this.view.render(),"object"==typeof c.firstRun&&(Handsontable.hooks.run(m,"afterChange",c.firstRun[0],c.firstRun[1]),c.firstRun=!1),Handsontable.hooks.run(m,"afterInit")},this.validateCell=function(e,t,n,o){function r(e){var o=t.physicalCol,r=t.physicalRow,i=m.getCell(r,o,!0);i&&m.view.wt.wtSettings.settings.cellRenderer(r,o,i),n(e)}var i=m.getCellValidator(t);"[object RegExp]"===Object.prototype.toString.call(i)&&(i=function(e){return function(t,n){n(e.test(t))}}(i)),"function"==typeof i?(e=Handsontable.hooks.run(m,"beforeValidate",e,t.row,t.prop,o),m._registerTimeout(setTimeout(function(){i.call(t,e,function(n){n=Handsontable.hooks.run(m,"afterValidate",n,e,t.row,t.prop,o),t.valid=n,r(n),Handsontable.hooks.run(m,"postAfterValidate",n,e,t.row,t.prop,o)})},0))):(t.valid=!0,r(t.valid))},this.setDataAtCell=function(e,t,n,s){var l,a,u,c=i(e,t,n),h=[];for(l=0,a=c.length;a>l;l++){if("object"!=typeof c[l])throw new Error("Method `setDataAtCell` accepts row number or changes array of arrays as its first parameter");if("number"!=typeof c[l][1])throw new Error("Method `setDataAtCell` accepts row and column number as its parameters. If you want to use object property name, use method `setDataAtRowProp`");u=d.colToProp(c[l][1]),h.push([c[l][0],u,d.get(c[l][0],u),c[l][2]])}s||"object"!=typeof e||(s=t),o(h,s,function(){r(h,s)})},this.setDataAtRowProp=function(e,t,n,s){var l,a,u=i(e,t,n),c=[];for(l=0,a=u.length;a>l;l++)c.push([u[l][0],u[l][1],d.get(u[l][0],u[l][1]),u[l][2]]);s||"object"!=typeof e||(s=t),o(c,s,function(){r(c,s)})},this.listen=function(){Handsontable.activeGuid=m.guid},this.unlisten=function(){Handsontable.activeGuid=null},this.isListening=function(){return Handsontable.activeGuid===m.guid},this.destroyEditor=function(e){g.refreshBorders(e)},this.populateFromArray=function(e,t,n,o,r,i,s,l,a){var u;if("object"!=typeof n||"object"!=typeof n[0])throw new Error("populateFromArray parameter `input` must be an array of arrays");return u="number"==typeof o?new Y(o,r):null,f.populateFromArray(new Y(e,t),n,u,i,s,l,a)},this.spliceCol=function(e,t,n){return d.spliceCol.apply(d,arguments)},this.spliceRow=function(e,t,n){return d.spliceRow.apply(d,arguments)},this.getSelected=function(){return g.isSelected()?[c.selRange.from.row,c.selRange.from.col,c.selRange.to.row,c.selRange.to.col]:void 0},this.getSelectedRange=function(){return g.isSelected()?c.selRange:void 0},this.render=function(){m.view&&(m.renderCall=!0,m.forceFullRender=!0,g.refreshBorders(null,!0))},this.loadData=function(e){function t(){c.cellSettings.length=0}if("object"==typeof e&&null!==e)e.push&&e.splice||(e=[e]);else{if(null!==e)throw new Error("loadData only accepts array of objects or array of arrays ("+typeof e+" given)");e=[];for(var n,o=0,r=c.settings.startRows;r>o;o++){n=[];for(var i=0,s=c.settings.startCols;s>i;i++)n.push(null);e.push(n)}}c.isPopulated=!1,w.prototype.data=e,Array.isArray(c.settings.dataSchema)||Array.isArray(e[0])?m.dataType="array":"function"==typeof c.settings.dataSchema?m.dataType="function":m.dataType="object",d=new H(m,c,w),h.data=e,h.dataType=m.dataType,h.colToProp=d.colToProp.bind(d),h.propToCol=d.propToCol.bind(d),t(),f.adjustRowsAndCols(),Handsontable.hooks.run(m,"afterLoadData",c.firstRun),c.firstRun?c.firstRun=[null,"loadData"]:(Handsontable.hooks.run(m,"afterChange",null,"loadData"),m.render()),c.isPopulated=!0},this.getData=function(e,t,n,o){return"undefined"==typeof e?d.getAll():d.getRange(new Y(e,t),new Y(n,o),d.DESTINATION_RENDERER)},this.getCopyableText=function(e,t,n,o){return d.getCopyableText(new Y(e,t),new Y(n,o))},this.getCopyableData=function(e,t){return d.getCopyable(e,d.colToProp(t))},this.getSchema=function(){return d.getSchema()},this.updateSettings=function(e,t){var n,o;if("undefined"!=typeof e.rows)throw new Error('"rows" setting is no longer supported. do you mean startRows, minRows or maxRows?');if("undefined"!=typeof e.cols)throw new Error('"cols" setting is no longer supported. do you mean startCols, minCols or maxCols?');for(n in e)"data"!==n&&(Handsontable.hooks.getRegistered().indexOf(n)>-1?("function"==typeof e[n]||Array.isArray(e[n]))&&m.addHook(n,e[n]):!t&&e.hasOwnProperty(n)&&(w.prototype[n]=e[n]));if(void 0===e.data&&void 0===c.settings.data?m.loadData(null):void 0!==e.data?m.loadData(e.data):void 0!==e.columns&&d.createMap(),o=m.countCols(),c.cellSettings.length=0,o>0){var r,i;for(n=0;o>n;n++)c.columnSettings[n]=M(w,c.columnsSettingConflicts),r=c.columnSettings[n].prototype,w.prototype.columns&&(i=w.prototype.columns[n],x(r,i),x(r,s(i)))}if("undefined"!=typeof e.cell)for(n in e.cell)if(e.cell.hasOwnProperty(n)){var l=e.cell[n];m.setCellMetaObject(l.row,l.col,l)}if(Handsontable.hooks.run(m,"afterCellMetaReset"),"undefined"!=typeof e.className&&(w.prototype.className&&_(m.rootElement,w.prototype.className),e.className&&S(m.rootElement,e.className)),"undefined"!=typeof e.height){var a=e.height;"function"==typeof a&&(a=a()),m.rootElement.style.height=a+"px"}if("undefined"!=typeof e.width){var u=e.width;"function"==typeof u&&(u=u()),m.rootElement.style.width=u+"px"}a&&(m.rootElement.style.overflow="hidden"),t||Handsontable.hooks.run(m,"afterUpdateSettings"),f.adjustRowsAndCols(),m.view&&!c.firstRun&&(m.forceFullRender=!0,g.refreshBorders(null,!0))},this.getValue=function(){var e=m.getSelected();if(w.prototype.getValue){if("function"==typeof w.prototype.getValue)return w.prototype.getValue.call(m);if(e)return m.getData()[e[0]][w.prototype.getValue]}else if(e)return m.getDataAtCell(e[0],e[1])},this.getSettings=function(){return c.settings},this.clear=function(){g.selectAll(),g.empty()},this.alter=function(e,t,n,o,r){f.alter(e,t,n,o,r)},this.getCell=function(e,t,n){return m.view.getCellAtCoords(new Y(e,t),n)},this.getCoords=function(e){return this.view.wt.wtTable.getCoords.call(this.view.wt.wtTable,e)},this.colToProp=function(e){return d.colToProp(e)},this.propToCol=function(e){return d.propToCol(e)},this.getDataAtCell=function(e,t){return d.get(e,d.colToProp(t))},this.getDataAtRowProp=function(e,t){return d.get(e,t)},this.getDataAtCol=function(e){var t=[];return t.concat.apply(t,d.getRange(new Y(0,e),new Y(c.settings.data.length-1,e),d.DESTINATION_RENDERER))},this.getDataAtProp=function(e){var t,n=[];return t=d.getRange(new Y(0,d.propToCol(e)),new Y(c.settings.data.length-1,d.propToCol(e)),d.DESTINATION_RENDERER),n.concat.apply(n,t)},this.getSourceData=function(e,t,n,o){var r;return r=void 0===e?h.getData():h.getByRange(new Y(e,t),new Y(n,o))},this.getSourceDataAtCol=function(e){return h.getAtColumn(e)},this.getSourceDataAtRow=function(e){return h.getAtRow(e)},this.getSourceDataAtCell=function(e,t){return h.getAtCell(e,t)},this.getDataAtRow=function(e){var t=d.getRange(new Y(e,0),new Y(e,this.countCols()-1),d.DESTINATION_RENDERER);return t[0]},this.getDataType=function(e,t,n,o){var r=this,i=null,s=null;void 0===e&&(e=0,n=this.countRows(),t=0,o=this.countCols()),void 0===n&&(n=e),void 0===o&&(o=t);var l="mixed";return V(Math.min(e,n),Math.max(e,n),function(e){var n=!0;return V(Math.min(t,o),Math.max(t,o),function(t){var o=r.getCellMeta(e,t);return s=o.type,i?n=i===s:i=s,n}),l=n?s:"mixed",n}),l},this.removeCellMeta=function(e,t,n){var o=m.getCellMeta(e,t);void 0!=o[n]&&delete c.cellSettings[e][t][n]},this.setCellMetaObject=function(e,t,n){if("object"==typeof n)for(var o in n)if(n.hasOwnProperty(o)){var r=n[o];this.setCellMeta(e,t,o,r)}},this.setCellMeta=function(e,t,n,o){c.cellSettings[e]||(c.cellSettings[e]=[]),c.cellSettings[e][t]||(c.cellSettings[e][t]=new c.columnSettings[t]),c.cellSettings[e][t][n]=o,Handsontable.hooks.run(m,"afterSetCellMeta",e,t,n,o)},this.getCellsMeta=function(){return W(c.cellSettings)},this.getCellMeta=function(e,t){var n,o=d.colToProp(t),r=e,i=t;if(e=l(e),t=a(t),c.columnSettings[t]||(c.columnSettings[t]=M(w,c.columnsSettingConflicts)),c.cellSettings[e]||(c.cellSettings[e]=[]),c.cellSettings[e][t]||(c.cellSettings[e][t]=new c.columnSettings[t]),n=c.cellSettings[e][t],n.row=e,n.col=t,n.physicalRow=r,n.physicalCol=i,n.prop=o,n.instance=m,Handsontable.hooks.run(m,"beforeGetCellMeta",e,t,n),x(n,s(n)),n.cells){var u=n.cells.call(n,e,t,o);u&&(x(n,u),x(n,s(u)))}return Handsontable.hooks.run(m,"afterGetCellMeta",e,t,n),n},this.isColumnModificationAllowed=function(){return!("object"===m.dataType||m.getSettings().columns)};var b=$("renderer");this.getCellRenderer=function(e,t){var n=b.call(this,e,t);return j(n)},this.getCellEditor=$("editor"),this.getCellValidator=$("validator"),this.validateCells=function(e){var t=new n;t.onQueueEmpty=e;for(var o=m.countRows()-1;o>=0;){for(var r=m.countCols()-1;r>=0;)t.addValidatorToQueue(),m.validateCell(m.getDataAtCell(o,r),m.getCellMeta(o,r),function(e){if("boolean"!=typeof e)throw new Error("Validation error: result is not boolean");e===!1&&(t.valid=!1),t.removeValidatorFormQueue()},"validateCells"),r--;o--}t.checkIfQueueIsEmpty()},this.getRowHeader=function(e){var t=c.settings.rowHeaders;return void 0!==e&&(e=Handsontable.hooks.run(m,"modifyRowHeader",e)),void 0===e?(t=[],V(m.countRows()-1,function(e){t.push(m.getRowHeader(e))})):Array.isArray(t)&&void 0!==t[e]?t=t[e]:"function"==typeof t?t=t(e):t&&"string"!=typeof t&&"number"!=typeof t&&(t=e+1),t},this.hasRowHeaders=function(){return!!c.settings.rowHeaders},this.hasColHeaders=function(){if(void 0!==c.settings.colHeaders&&null!==c.settings.colHeaders)return!!c.settings.colHeaders;for(var e=0,t=m.countCols();t>e;e++)if(m.getColHeader(e))return!0;return!1},this.getColHeader=function(e){if(e=Handsontable.hooks.run(m,"modifyColHeader",e),void 0===e){for(var t=[],n=0,o=m.countCols();o>n;n++)t.push(m.getColHeader(n));return t}var r=e;return e=Handsontable.hooks.run(m,"modifyCol",e),c.settings.columns&&c.settings.columns[e]&&c.settings.columns[e].title?c.settings.columns[e].title:Array.isArray(c.settings.colHeaders)&&void 0!==c.settings.colHeaders[e]?c.settings.colHeaders[e]:"function"==typeof c.settings.colHeaders?c.settings.colHeaders(e):c.settings.colHeaders&&"string"!=typeof c.settings.colHeaders&&"number"!=typeof c.settings.colHeaders?K(r):c.settings.colHeaders},this._getColWidthFromSettings=function(e){var t=m.getCellMeta(0,e),n=t.width;if((void 0===n||n===c.settings.width)&&(n=t.colWidths),void 0!==n&&null!==n){switch(typeof n){case"object":n=n[e];break;case"function":n=n(e)}"string"==typeof n&&(n=parseInt(n,10))}return n},this.getColWidth=function(e){var t=m._getColWidthFromSettings(e);return t=Handsontable.hooks.run(m,"modifyColWidth",t,e),void 0===t&&(t=q.DEFAULT_WIDTH),t},this._getRowHeightFromSettings=function(e){var t=c.settings.rowHeights;if(void 0!==t&&null!==t){switch(typeof t){case"object":t=t[e];break;case"function":t=t(e)}"string"==typeof t&&(t=parseInt(t,10))}return t},this.getRowHeight=function(e){var t=m._getRowHeightFromSettings(e);return t=Handsontable.hooks.run(m,"modifyRowHeight",t,e)},this.countSourceRows=function(){return m.getSourceData()?m.getSourceData().length:0},this.countRows=function(){return d.getLength()},this.countCols=function(){return"object"===m.dataType||"function"===m.dataType?c.settings.columns&&c.settings.columns.length?c.settings.columns.length:d.colToPropCache.length:"array"===m.dataType?c.settings.columns&&c.settings.columns.length?c.settings.columns.length:c.settings.data&&c.settings.data[0]&&c.settings.data[0].length?c.settings.data[0].length:0:void 0},this.getColspanOffset=function(e,t){var n=0;if(m.colspanArray){for(var o=0;e>o;o++)n+=m.colspanArray[t][o]-1||0;return n}for(var n=0,r=m.view.wt.wtTable.THEAD.childNodes.length-t-1,i=m.view.wt.wtTable.THEAD.querySelector("tr:nth-child("+parseInt(r+1,10)+")"),s=m.view.wt.wtSettings.settings.rowHeaders().length,o=s;s+e>o;o++)i.childNodes[o].hasAttribute("colspan")&&(n+=parseInt(i.childNodes[o].getAttribute("colspan"),10)-1);return n},this.getHeaderColspan=function(e,t){var n=m.view.wt.wtTable.THEAD.childNodes.length-t-1,o=m.view.wt.wtSettings.settings.rowHeaders().length,r=m.view.wt.wtTable.THEAD.querySelector("tr:nth-child("+parseInt(n+1,10)+")"),i=o+e-m.view.wt.wtViewport.columnsRenderCalculator.startColumn;return r.childNodes[i].hasAttribute("colspan")?parseInt(r.childNodes[i].getAttribute("colspan"),10):0},this.rowOffset=function(){return m.view.wt.wtTable.getFirstRenderedRow()},this.colOffset=function(){return m.view.wt.wtTable.getFirstRenderedColumn()},this.countRenderedRows=function(){return m.view.wt.drawn?m.view.wt.wtTable.getRenderedRowsCount():-1},this.countVisibleRows=function(){return m.view.wt.drawn?m.view.wt.wtTable.getVisibleRowsCount():-1},this.countRenderedCols=function(){return m.view.wt.drawn?m.view.wt.wtTable.getRenderedColumnsCount():-1},this.countVisibleCols=function(){return m.view.wt.drawn?m.view.wt.wtTable.getVisibleColumnsCount():-1},this.countEmptyRows=function(e){for(var t,n=m.countRows()-1,o=0;n>=0;){if(t=Handsontable.hooks.run(this,"modifyRow",n),m.isEmptyRow(t))o++;else if(e)break;n--}return o},this.countEmptyCols=function(e){if(m.countRows()<1)return 0;for(var t=m.countCols()-1,n=0;t>=0;){if(m.isEmptyCol(t))n++;else if(e)break;t--}return n},this.isEmptyRow=function(e){return c.settings.isEmptyRow.call(m,e)},this.isEmptyCol=function(e){return c.settings.isEmptyCol.call(m,e)},this.selectCell=function(e,t,n,o,r,i){var s;if(i="undefined"==typeof i||i===!0,"number"!=typeof e||0>e||e>=m.countRows())return!1;if("number"!=typeof t||0>t||t>=m.countCols())return!1;if("undefined"!=typeof n){if("number"!=typeof n||0>n||n>=m.countRows())return!1;if("number"!=typeof o||0>o||o>=m.countCols())return!1}return s=new Y(e,t),c.selRange=new X(s,s,s),i&&m.listen(),"undefined"==typeof n?g.setRangeEnd(c.selRange.from,r):g.setRangeEnd(new Y(n,o),r),m.selection.finish(),!0},this.selectCellByProp=function(e,t,n,o,r){return arguments[1]=d.propToCol(arguments[1]),"undefined"!=typeof arguments[3]&&(arguments[3]=d.propToCol(arguments[3])),m.selectCell.apply(m,arguments)},this.deselectCell=function(){g.deselect()},this.destroy=function(){m._clearTimeouts(),m.view&&m.view.destroy(),h&&h.destroy(),h=null,T(m.rootElement),v.destroy(),Handsontable.hooks.run(m,"afterDestroy"),Handsontable.hooks.destroy(m);for(var e in m)m.hasOwnProperty(e)&&("function"==typeof m[e]?m[e]=u:"guid"!==e&&(m[e]=null));c=null,d=null,f=null,g=null,p=null,m=null,w=null},this.getActiveEditor=function(){return p.getActiveEditor()},this.getPlugin=function(e){return I(this,e)},this.getInstance=function(){return m},this.addHook=function(e,t){Handsontable.hooks.add(e,t,m)},this.addHookOnce=function(e,t){Handsontable.hooks.once(e,t,m)},this.removeHook=function(e,t){Handsontable.hooks.remove(e,t,m)},this.runHooks=function(e,t,n,o,r,i,s){return Handsontable.hooks.run(m,e,t,n,o,r,i,s)},this.timeouts=[],this._registerTimeout=function(e){this.timeouts.push(e)},this._clearTimeouts=function(){for(var e=0,t=this.timeouts.length;t>e;e++)clearTimeout(this.timeouts[e])},this.version=Handsontable.version,Handsontable.hooks.run(m,"construct")};var Q=function(){};Q.prototype={data:void 0,dataSchema:void 0,width:void 0,height:void 0,startRows:5,startCols:5,rowHeaders:null,colHeaders:null,colWidths:void 0,rowHeights:void 0,columns:void 0,cells:void 0,cell:[],comments:!1,customBorders:!1,minRows:0,minCols:0,maxRows:1/0,maxCols:1/0,minSpareRows:0,minSpareCols:0,allowInsertRow:!0,allowInsertColumn:!0,allowRemoveRow:!0,allowRemoveColumn:!0,multiSelect:!0,fillHandle:!0,fixedRowsTop:0,fixedRowsBottom:0,fixedColumnsLeft:0,outsideClickDeselects:!0,enterBeginsEditing:!0,enterMoves:{row:1,col:0},tabMoves:{row:0,col:1},autoWrapRow:!1,autoWrapCol:!1,copyRowsLimit:1e3,copyColsLimit:1e3,pasteMode:"overwrite",persistentState:!1,currentRowClassName:void 0,currentColClassName:void 0,className:void 0,tableClassName:void 0,stretchH:"none",isEmptyRow:function(e){var t,n,o,r;for(t=0,n=this.countCols();n>t;t++)if(o=this.getDataAtCell(e,t),""!==o&&null!==o&&"undefined"!=typeof o)return"object"==typeof o?(r=this.getCellMeta(e,t),N(this.getSchema()[r.prop],o)):!1;return!0},isEmptyCol:function(e){var t,n,o;for(t=0,n=this.countRows();n>t;t++)if(o=this.getDataAtCell(t,e),""!==o&&null!==o&&"undefined"!=typeof o)return!1;return!0},observeDOMVisibility:!0,allowInvalid:!0,invalidCellClassName:"htInvalid",placeholder:!1,placeholderCellClassName:"htPlaceholder",readOnlyCellClassName:"htDimmed",renderer:void 0,commentedCellClassName:"htCommentCell",fragmentSelection:!1,readOnly:!1,skipColumnOnPaste:!1,search:!1,type:"text",copyable:!0,editor:void 0,autoComplete:void 0,visibleRows:10,trimDropdown:!0,debug:!1,wordWrap:!0,noWordWrapClassName:"htNoWrap",contextMenu:void 0,contextMenuCopyPaste:void 0,copyPaste:void 0,undo:void 0,columnSorting:void 0,manualColumnMove:void 0,manualColumnResize:void 0,manualRowMove:void 0,manualRowResize:void 0,mergeCells:!1,viewportRowRenderingOffset:"auto",viewportColumnRenderingOffset:"auto",validator:void 0,disableVisualSelection:!1,sortIndicator:!1,manualColumnFreeze:void 0,trimWhitespace:!0,settings:void 0,source:void 0,title:void 0,checkedTemplate:void 0,uncheckedTemplate:void 0,label:void 0,format:void 0,language:void 0,selectOptions:void 0,autoColumnSize:void 0,autoRowSize:void 0,dateFormat:void 0,correctFormat:!1,defaultDate:void 0,strict:void 0,renderAllRows:void 0},Handsontable.DefaultSettings=Q},{"3rdparty/walkontable/src/calculator/viewportColumns":3,"3rdparty/walkontable/src/cell/coords":5,"3rdparty/walkontable/src/cell/range":6,"3rdparty/walkontable/src/selection":18,dataMap:26,dataSource:27,editorManager:28,eventManager:41,"helpers/array":42,"helpers/data":44,"helpers/dom/element":45,"helpers/number":49,"helpers/object":50,"helpers/setting":51,"helpers/string":52,numeral:"numeral",plugins:57,renderers:88,tableView:97}],26:[function(e,t,n){"use strict";function o(e,t,n){this.instance=e,this.priv=t,this.GridSettings=n,this.dataSource=this.instance.getSettings().data,this.dataSource[0]?this.duckSchema=this.recursiveDuckSchema(this.dataSource[0]):this.duckSchema={},this.createMap()}Object.defineProperties(n,{DataMap:{get:function(){return o}},__esModule:{value:!0}});var r,i,s,l,a,u,c,d=(r=e("SheetClip"),r&&r.__esModule&&r||{"default":r})["default"],h=(i=e("helpers/data"),i&&i.__esModule&&i||{"default":i}).cellMethodLookupFactory,f=(s=e("helpers/setting"),s&&s.__esModule&&s||{"default":s}).columnFactory,g=(l=e("helpers/object"),l&&l.__esModule&&l||{"default":l}),p=g.duckSchema,m=g.deepExtend,w=(a=e("helpers/array"),a&&a.__esModule&&a||{"default":a}),v=w.extendArray,b=w.to2dArray,C=(u=e("helpers/number"),u&&u.__esModule&&u||{"default":u}).rangeEach,y=(c=e("multiMap"),c&&c.__esModule&&c||{"default":c}).MultiMap;o.prototype.DESTINATION_RENDERER=1,o.prototype.DESTINATION_CLIPBOARD_GENERATOR=2,o.prototype.recursiveDuckSchema=function(e){return p(e)},o.prototype.recursiveDuckColumns=function(e,t,n){var o,r;if("undefined"==typeof t&&(t=0,n=""),"object"==typeof e&&!Array.isArray(e))for(r in e)e.hasOwnProperty(r)&&(null===e[r]?(o=n+r,this.colToPropCache.push(o),this.propToColCache.set(o,t),t++):t=this.recursiveDuckColumns(e[r],t,r+"."));return t},o.prototype.createMap=function(){var e,t,n=this.getSchema();if("undefined"==typeof n)throw new Error("trying to create `columns` definition but you didnt' provide `schema` nor `data`");this.colToPropCache=[],this.propToColCache=new y;var o=this.instance.getSettings().columns;if(o)for(e=0,t=o.length;t>e;e++)"undefined"!=typeof o[e].data&&(this.colToPropCache[e]=o[e].data,this.propToColCache.set(o[e].data,e));else this.recursiveDuckColumns(n)},o.prototype.colToProp=function(e){return e=Handsontable.hooks.run(this.instance,"modifyCol",e),this.colToPropCache&&"undefined"!=typeof this.colToPropCache[e]?this.colToPropCache[e]:e},o.prototype.propToCol=function(e){var t;return t="undefined"==typeof this.propToColCache.get(e)?e:this.propToColCache.get(e),t=Handsontable.hooks.run(this.instance,"modifyCol",t)},o.prototype.getSchema=function(){var e=this.instance.getSettings().dataSchema;return e?"function"==typeof e?e():e:this.duckSchema},o.prototype.createRow=function(e,t,n){var o,r,i=this.instance.countCols(),s=0;t||(t=1),("number"!=typeof e||e>=this.instance.countSourceRows())&&(e=this.instance.countSourceRows()),r=e;for(var l=this.instance.getSettings().maxRows;t>s&&this.instance.countSourceRows()a;a++)o.push(null)}else"function"===this.instance.dataType?o=this.instance.getSettings().dataSchema(e):(o={},m(o,this.getSchema()));e===this.instance.countSourceRows()?this.dataSource.push(o):this.dataSource.splice(e,0,o),s++,r++}return Handsontable.hooks.run(this.instance,"afterCreateRow",e,s,n),this.instance.forceFullRender=!0,s},o.prototype.createCol=function(e,t,n){if(!this.instance.isColumnModificationAllowed())throw new Error("Cannot create new column. When data source in an object, you can only have as much columns as defined in first data row, data schema or in the 'columns' setting.If you want to be able to add new columns, you have to use array datasource."); -var o,r,i=this.instance.countSourceRows(),s=this.dataSource,l=0;t||(t=1),r=e;for(var a=this.instance.getSettings().maxCols;t>l&&this.instance.countCols()=this.instance.countCols()){for(var u=0;i>u;u++)"undefined"==typeof s[u]&&(s[u]=[]),s[u].push(null);this.priv.columnSettings.push(o)}else{for(var u=0;i>u;u++)s[u].splice(r,0,null);this.priv.columnSettings.splice(r,0,o)}l++,r++}return Handsontable.hooks.run(this.instance,"afterCreateCol",e,l,n),this.instance.forceFullRender=!0,l},o.prototype.removeRow=function(e,t){t||(t=1),"number"!=typeof e&&(e=-t),e=(this.instance.countSourceRows()+e)%this.instance.countSourceRows();var n=this.physicalRowsToLogical(e,t),o=Handsontable.hooks.run(this.instance,"beforeRemoveRow",e,t,n);if(o!==!1){var r=this.dataSource,i=r.filter(function(e,t){return-1==n.indexOf(t)});r.length=0,Array.prototype.push.apply(r,i),Handsontable.hooks.run(this.instance,"afterRemoveRow",e,t,n),this.instance.forceFullRender=!0}},o.prototype.removeCol=function(e,t){if("object"===this.instance.dataType||this.instance.getSettings().columns)throw new Error("cannot remove column with object data source or columns option specified");t||(t=1),"number"!=typeof e&&(e=-t),e=(this.instance.countCols()+e)%this.instance.countCols();var n=Handsontable.hooks.run(this.instance,"beforeRemoveCol",e,t);if(n!==!1){for(var o=this.dataSource,r=0,i=this.instance.countSourceRows();i>r;r++)o[r].splice(e,t);this.priv.columnSettings.splice(e,t),Handsontable.hooks.run(this.instance,"afterRemoveCol",e,t),this.instance.forceFullRender=!0}},o.prototype.spliceCol=function(e,t,n){var o=4<=arguments.length?[].slice.call(arguments,3):[],r=this.instance.getDataAtCol(e),i=r.slice(t,t+n),s=r.slice(t+n);v(o,s);for(var l=0;n>l;)o.push(null),l++;return b(o),this.instance.populateFromArray(t,e,o,null,null,"spliceCol"),i},o.prototype.spliceRow=function(e,t,n){var o=4<=arguments.length?[].slice.call(arguments,3):[],r=this.instance.getSourceDataAtRow(e),i=r.slice(t,t+n),s=r.slice(t+n);v(o,s);for(var l=0;n>l;)o.push(null),l++;return this.instance.populateFromArray(e,t,[o],null,null,"spliceRow"),i},o.prototype.get=function(e,t){if(e=Handsontable.hooks.run(this.instance,"modifyRow",e),"string"==typeof t&&t.indexOf(".")>-1){var n=t.split("."),o=this.dataSource[e];if(!o)return null;for(var r=0,i=n.length;i>r;r++)if(o=o[n[r]],"undefined"==typeof o)return null;return o}return"function"==typeof t?t(this.dataSource.slice(e,e+1)[0]):this.dataSource[e]&&this.dataSource[e].hasOwnProperty&&this.dataSource[e].hasOwnProperty(t)?this.dataSource[e][t]:null};var R=h("copyable",!1);o.prototype.getCopyable=function(e,t){return R.call(this.instance,e,this.propToCol(t))?this.get(e,t):""},o.prototype.set=function(e,t,n,o){if(e=Handsontable.hooks.run(this.instance,"modifyRow",e,o||"datamapGet"),"string"==typeof t&&t.indexOf(".")>-1){for(var r=t.split("."),i=this.dataSource[e],s=0,l=r.length-1;l>s;s++)"undefined"==typeof i[r[s]]&&(i[r[s]]={}),i=i[r[s]];i[r[s]]=n}else"function"==typeof t?t(this.dataSource.slice(e,e+1)[0],n):this.dataSource[e][t]=n},o.prototype.physicalRowsToLogical=function(e,t){for(var n,o=this.instance.countSourceRows(),r=(o+e)%o,i=[],s=t;o>r&&s;)n=Handsontable.hooks.run(this.instance,"modifyRow",r),i.push(n),s--,r++;return i},o.prototype.clear=function(){for(var e=0;e=o;o++){l=[];var c=Handsontable.hooks.run(this.instance,"modifyRow",o);for(i=Math.min(e.col,t.col);s>=i;i++){if(null===c)break;l.push(u.call(this,o,this.colToProp(i)))}null!==c&&a.push(l)}return a},o.prototype.getText=function(e,t){return d.stringify(this.getRange(e,t,this.DESTINATION_RENDERER))},o.prototype.getCopyableText=function(e,t){return d.stringify(this.getRange(e,t,this.DESTINATION_CLIPBOARD_GENERATOR))},Handsontable.DataMap=o},{SheetClip:"SheetClip","helpers/array":42,"helpers/data":44,"helpers/number":49,"helpers/object":50,"helpers/setting":51,multiMap:55}],27:[function(e,t,n){"use strict";Object.defineProperties(n,{DataSource:{get:function(){return f}},__esModule:{value:!0}});var o,r,i,s,l,a=((o=e("helpers/data"),o&&o.__esModule&&o||{"default":o}).cellMethodLookupFactory,(r=e("helpers/setting"),r&&r.__esModule&&r||{"default":r}).columnFactory,i=e("helpers/object"),i&&i.__esModule&&i||{"default":i}),u=(a.duckSchema,a.deepExtend,a.getProperty),c=(s=e("helpers/array"),s&&s.__esModule&&s||{"default":s}),d=(c.extendArray,c.arrayEach),h=(l=e("helpers/number"),l&&l.__esModule&&l||{"default":l}).rangeEach,f=function(e,t){this.hot=e,this.data=t,this.dataType="array",this.colToProp=function(){},this.propToCol=function(){}};$traceurRuntime.createClass(f,{getData:function(){return this.data},getAtColumn:function(e){var t=this,n=[];return d(this.data,function(o){var r=t.colToProp(e);o="string"==typeof r?u(o,r):o[r],n.push(o)}),n},getAtRow:function(e){return this.data[e]},getAtCell:function(e,t){return this.data[e][this.colToProp(t)]},getByRange:function(e,t){var n=this,o=Math.min(e.row,t.row),r=Math.min(e.col,t.col),i=Math.max(e.row,t.row),s=Math.max(e.col,t.col),l=[];return h(o,i,function(e){var t,o=n.getAtRow(e);"array"===n.dataType?t=o.slice(r,s):"object"===n.dataType&&(t={},h(r,s,function(e){var r=n.colToProp(e);t[r]=o[r]})),l.push(t)}),l},destroy:function(){this.data=null,this.hot=null}},{})},{"helpers/array":42,"helpers/data":44,"helpers/number":49,"helpers/object":50,"helpers/setting":51}],28:[function(e,t,n){"use strict";function o(e,t,n){function o(e){var o="function"==typeof t.settings.enterMoves?t.settings.enterMoves(event):t.settings.enterMoves;e?n.transformStart(-o.row,-o.col):n.transformStart(o.row,o.col,!0)}function r(e){e?n.transformEnd(-1,0):n.transformStart(-1,0)}function i(e){e?n.transformEnd(1,0):n.transformStart(1,0)}function s(e){e?n.transformEnd(0,1):n.transformStart(0,1)}function l(e){e?n.transformEnd(0,-1):n.transformStart(0,-1)}function a(a){var c,g;if(e.isListening()&&(Handsontable.hooks.run(e,"beforeKeyDown",a),!y&&!w(a)&&(t.lastKeyCode=a.keyCode,n.isSelected()))){if(c=(a.ctrlKey||a.metaKey)&&!a.altKey,b&&!b.isWaiting()&&!(h(a.keyCode)||f(a.keyCode)||c||C.isEditorOpened()))return void C.openEditor("",a);switch(g=a.shiftKey?n.setRangeEnd:n.setRangeStart,a.keyCode){case d.A:!C.isEditorOpened()&&c&&(n.selectAll(),a.preventDefault(),p(a));break;case d.ARROW_UP:C.isEditorOpened()&&!b.isWaiting()&&C.closeEditorAndSaveChanges(c),r(a.shiftKey),a.preventDefault(),p(a);break;case d.ARROW_DOWN:C.isEditorOpened()&&!b.isWaiting()&&C.closeEditorAndSaveChanges(c),i(a.shiftKey),a.preventDefault(),p(a);break;case d.ARROW_RIGHT:C.isEditorOpened()&&!b.isWaiting()&&C.closeEditorAndSaveChanges(c),s(a.shiftKey),a.preventDefault(),p(a);break;case d.ARROW_LEFT:C.isEditorOpened()&&!b.isWaiting()&&C.closeEditorAndSaveChanges(c),l(a.shiftKey),a.preventDefault(),p(a);break;case d.TAB:var v="function"==typeof t.settings.tabMoves?t.settings.tabMoves(a):t.settings.tabMoves;a.shiftKey?n.transformStart(-v.row,-v.col):n.transformStart(v.row,v.col,!0),a.preventDefault(),p(a);break;case d.BACKSPACE:case d.DELETE:n.empty(a),C.prepareEditor(),a.preventDefault();break;case d.F2:C.openEditor(null,a),b&&b.enableFullEditMode(),a.preventDefault();break;case d.ENTER:C.isEditorOpened()?(b&&b.state!==Handsontable.EditorState.WAITING&&C.closeEditorAndSaveChanges(c),o(a.shiftKey)):e.getSettings().enterBeginsEditing?(C.openEditor(null,a),b&&b.enableFullEditMode()):o(a.shiftKey),a.preventDefault(),m(a);break;case d.ESCAPE:C.isEditorOpened()&&C.closeEditorAndRestoreOriginalValue(c),a.preventDefault();break;case d.HOME:g(a.ctrlKey||a.metaKey?new u(0,t.selRange.from.col):new u(t.selRange.from.row,0)),a.preventDefault(),p(a);break;case d.END:g(a.ctrlKey||a.metaKey?new u(e.countRows()-1,t.selRange.from.col):new u(t.selRange.from.row,e.countCols()-1)),a.preventDefault(),p(a);break;case d.PAGE_UP:n.transformStart(-e.countVisibleRows(),0),a.preventDefault(),p(a);break;case d.PAGE_DOWN:n.transformStart(e.countVisibleRows(),0),a.preventDefault(),p(a)}}}function c(){function t(e,t,n){"TD"==n.nodeName&&(C.openEditor(),b&&b.enableFullEditMode())}e.addHook("afterDocumentKeyDown",a),g.addEventListener(document.documentElement,"keydown",function(t){e.runHooks("afterDocumentKeyDown",t)}),e.view.wt.update("onCellDblClick",t),e.addHook("afterDestroy",function(){y=!0})}var g,b,C=this,y=!1;g=v(e),this.destroyEditor=function(e){this.closeEditor(e)},this.getActiveEditor=function(){return b},this.prepareEditor=function(){var n,o,r,i,s,l,a;return b&&b.isWaiting()?void this.closeEditor(!1,!1,function(e){e&&C.prepareEditor()}):(n=t.selRange.highlight.row,o=t.selRange.highlight.col,r=e.colToProp(o),i=e.getCell(n,o),s=e.getDataAtCell(n,o),l=e.getCellMeta(n,o),a=e.getCellEditor(l),void(a?(b=Handsontable.editors.getEditor(a,e),b.prepare(n,o,r,i,s,l)):b=void 0))},this.isEditorOpened=function(){return b&&b.isOpened()},this.openEditor=function(e,t){b&&!b.cellProperties.readOnly?b.beginEditing(e,t):b&&b.cellProperties.readOnly&&t&&t.keyCode===d.ENTER&&o()},this.closeEditor=function(e,t,n){b?b.finishEditing(e,t,n):n&&n(!1)},this.closeEditorAndSaveChanges=function(e){return this.closeEditor(!1,e)},this.closeEditorAndRestoreOriginalValue=function(e){return this.closeEditor(!0,e)},c()}Object.defineProperties(n,{EditorManager:{get:function(){return o}},__esModule:{value:!0}});var r,i,s,l,a,u=(r=e("3rdparty/walkontable/src/cell/coords"),r&&r.__esModule&&r||{"default":r}).WalkontableCellCoords,c=(i=e("helpers/unicode"),i&&i.__esModule&&i||{"default":i}),d=c.KEY_CODES,h=c.isMetaKey,f=c.isCtrlKey,g=(s=e("helpers/dom/event"),s&&s.__esModule&&s||{"default":s}),p=g.stopPropagation,m=g.stopImmediatePropagation,w=g.isImmediatePropagationStopped,v=((l=e("editors"),l&&l.__esModule&&l||{"default":l}).getEditor,(a=e("eventManager"),a&&a.__esModule&&a||{"default":a}).eventManager);Handsontable.EditorManager=o},{"3rdparty/walkontable/src/cell/coords":5,editors:29,eventManager:41,"helpers/dom/event":46,"helpers/unicode":53}],29:[function(e,t,n){"use strict";function o(e){var t,n;n={},t=e,this.getConstructor=function(){return e},this.getInstance=function(e){return e.guid in n||(n[e.guid]=new t(e)),n[e.guid]}}function r(e,t){var n=new o(t);"string"==typeof e&&(c[e]=n,Handsontable.editors[u(e)+"Editor"]=t),d.set(t,n)}function i(e,t){var n;if("function"==typeof e)d.get(e)||r(null,e),n=d.get(e);else{if("string"!=typeof e)throw Error('Only strings and functions can be passed as "editor" parameter ');n=c[e]}if(!n)throw Error('No editor registered under name "'+e+'"');return n.getInstance(t)}function s(e){var t;if("string"!=typeof e)throw Error('Only strings and functions can be passed as "editor" parameter ');if(t=c[e],!t)throw Error('No editor registered under name "'+e+'"');return t.getConstructor()}function l(e){return c[e]?!0:!1}Object.defineProperties(n,{registerEditor:{get:function(){return r}},getEditor:{get:function(){return i}},hasEditor:{get:function(){return l}},getEditorConstructor:{get:function(){return s}},__esModule:{value:!0}});var a,u=(a=e("helpers/string"),a&&a.__esModule&&a||{"default":a}).toUpperCaseFirst,c={},d=new WeakMap;Handsontable.editors=Handsontable.editors||{},Handsontable.editors.registerEditor=r,Handsontable.editors.getEditor=i},{"helpers/string":52}],30:[function(e,t,n){"use strict";function o(e){this.instance=e,this.state=Handsontable.EditorState.VIRGIN,this._opened=!1,this._fullEditMode=!1,this._closeCallback=null,this.init()}Object.defineProperties(n,{BaseEditor:{get:function(){return o}},__esModule:{value:!0}});var r,i,s=(r=e("helpers/mixed"),r&&r.__esModule&&r||{"default":r}).stringify,l=(i=e("3rdparty/walkontable/src/cell/coords"),i&&i.__esModule&&i||{"default":i}).WalkontableCellCoords;Handsontable.editors=Handsontable.editors||{},Handsontable.editors.BaseEditor=o,Handsontable.EditorState={VIRGIN:"STATE_VIRGIN",EDITING:"STATE_EDITING",WAITING:"STATE_WAITING",FINISHED:"STATE_FINISHED"},o.prototype._fireCallbacks=function(e){this._closeCallback&&(this._closeCallback(e),this._closeCallback=null)},o.prototype.init=function(){},o.prototype.getValue=function(){throw Error("Editor getValue() method unimplemented")},o.prototype.setValue=function(e){throw Error("Editor setValue() method unimplemented")},o.prototype.open=function(){throw Error("Editor open() method unimplemented")},o.prototype.close=function(){throw Error("Editor close() method unimplemented")},o.prototype.prepare=function(e,t,n,o,r,i){this.TD=o,this.row=e,this.col=t,this.prop=n,this.originalValue=r,this.cellProperties=i,this.instance.view.isMouseDown()&&document.activeElement&&document.activeElement!==document.body?document.activeElement.blur():document.activeElement||document.body.focus(),this.state=Handsontable.EditorState.VIRGIN},o.prototype.extend=function(){function e(){n.apply(this,arguments)}function t(e,t){function n(){}return n.prototype=t.prototype,e.prototype=new n,e.prototype.constructor=e,e}var n=this.constructor;return t(e,n)},o.prototype.saveValue=function(e,t){var n,o;t?(n=this.instance.getSelected(),n[0]>n[2]&&(o=n[0],n[0]=n[2],n[2]=o),n[1]>n[3]&&(o=n[1],n[1]=n[3],n[3]=o),this.instance.populateFromArray(n[0],n[1],e,n[2],n[3],"edit")):this.instance.populateFromArray(this.row,this.col,e,null,null,"edit")},o.prototype.beginEditing=function(e,t){this.state==Handsontable.EditorState.VIRGIN&&(this.instance.view.scrollViewport(new l(this.row,this.col)),this.instance.view.render(),this.state=Handsontable.EditorState.EDITING,e="string"==typeof e?e:this.originalValue,this.setValue(s(e)),this.open(t),this._opened=!0,this.focus(),this.instance.view.render())},o.prototype.finishEditing=function(e,t,n){var o,r=this;if(n){var i=this._closeCallback;this._closeCallback=function(e){i&&i(e),n(e)}}if(!this.isWaiting()){if(this.state==Handsontable.EditorState.VIRGIN)return void this.instance._registerTimeout(setTimeout(function(){r._fireCallbacks(!0)},0));if(this.state==Handsontable.EditorState.EDITING){if(e)return this.cancelChanges(),void this.instance.view.render();o=this.instance.getSettings().trimWhitespace?[["string"==typeof this.getValue()?String.prototype.trim.call(this.getValue()||""):this.getValue()]]:[[this.getValue()]],this.state=Handsontable.EditorState.WAITING,this.saveValue(o,t),this.instance.getCellValidator(this.cellProperties)?this.instance.addHookOnce("postAfterValidate",function(e){r.state=Handsontable.EditorState.FINISHED,r.discardEditor(e)}):(this.state=Handsontable.EditorState.FINISHED,this.discardEditor(!0))}}},o.prototype.cancelChanges=function(){this.state=Handsontable.EditorState.FINISHED,this.discardEditor()},o.prototype.discardEditor=function(e){this.state===Handsontable.EditorState.FINISHED&&(e===!1&&this.cellProperties.allowInvalid!==!0?(this.instance.selectCell(this.row,this.col),this.focus(),this.state=Handsontable.EditorState.EDITING,this._fireCallbacks(!1)):(this.close(),this._opened=!1,this._fullEditMode=!1,this.state=Handsontable.EditorState.VIRGIN,this._fireCallbacks(!0)))},o.prototype.enableFullEditMode=function(){this._fullEditMode=!0},o.prototype.isInFullEditMode=function(){return this._fullEditMode},o.prototype.isOpened=function(){return this._opened},o.prototype.isWaiting=function(){return this.state===Handsontable.EditorState.WAITING},o.prototype.checkEditorSection=function(){var e=this.instance.countRows(),t="";return this.row=e-this.instance.getSettings().fixedRowsBottom?t=this.col"+l+"")))},autoColumnSize:!0,modifyColWidth:function(e,t){var o=this.getPlugin("autoColumnSize").widths;return o[t]&&(e=o[t]),n?e:e+15}}),this.htEditor.view.wt.wtTable.holder.parentNode.style["padding-right"]=v()+2+"px",O&&(O=!1),t.instance._registerTimeout(setTimeout(function(){t.queryChoices(t.TEXTAREA.value)},0))},T.prototype.close=function(){S.prototype.close.apply(this,arguments)},T.prototype.queryChoices=function(e){if(this.query=e,"function"==typeof this.cellProperties.source){var t=this;this.cellProperties.source(e,function(e){t.updateChoicesList(e)})}else if(Array.isArray(this.cellProperties.source)){var n;if(e&&this.cellProperties.filter!==!1){var o=this.cellProperties.filteringCaseSensitive===!0,r=e.toLowerCase();n=this.cellProperties.source.filter(function(t){return o?-1!=t.indexOf(e):-1!=t.toLowerCase().indexOf(r)})}else n=this.cellProperties.source;this.updateChoicesList(n)}else this.updateChoicesList([])},T.prototype.updateChoicesList=function(e){var t,n=w(this.TEXTAREA),o=b(this.TEXTAREA),r=T.sortByRelevance(this.getValue(),e,this.cellProperties.filteringCaseSensitive);if(0==this.cellProperties.filter)t=r[0];else{for(var i=[],s=0,l=r.length;l>s;s++)i.push(e[r[s]]);t=0,e=i}this.choices=e,this.htEditor.loadData(g([e])),this.updateDropdownHeight(),this.cellProperties.strict===!0&&this.highlightBestMatchingChoice(t),this.instance.listen(),this.TEXTAREA.focus(),y(this.TEXTAREA,n,n==o?void 0:o)},T.prototype.updateDropdownHeight=function(){var e=this.htEditor.getColWidth(0)+v()+2,t=void 0===this.cellProperties.trimDropdown?!0:this.cellProperties.trimDropdown;this.htEditor.updateSettings({height:this.getDropdownHeight(),width:t?void 0:e}),this.htEditor.view.wt.wtTable.alignOverlaysWithTrimmingContainer()},T.prototype.finishEditing=function(e){e||this.instance.removeHook("beforeKeyDown",o),S.prototype.finishEditing.apply(this,arguments)},T.prototype.highlightBestMatchingChoice=function(e){"number"==typeof e?this.htEditor.selectCell(e,0):this.htEditor.deselectCell()},T.sortByRelevance=function(e,t,n){var o,r,i,s,l,a=[],u=e.length,c=[];if(0===u){for(s=0,l=t.length;l>s;s++)c.push(s);return c}for(s=0,l=t.length;l>s;s++)o=f(t[s]),r=n?o.indexOf(e):o.toLowerCase().indexOf(e.toLowerCase()),-1!=r&&(i=o.length-r-u,a.push({baseIndex:s,index:r,charsLeft:i,value:o}));for(a.sort(function(e,t){return-1===t.index?-1:-1===e.index?1:e.indext.charsLeft?1:0:void 0}),s=0,l=a.length;l>s;s++)c.push(a[s].baseIndex);return c},T.prototype.getDropdownHeight=function(){var e=this.htEditor.getInstance().getRowHeight(0)||23,t=this.cellProperties.visibleRows;return this.choices.length>=t?t*e:this.choices.length*e+8},T.prototype.allowKeyEventPropagation=function(e){var t={row:this.htEditor.getSelectedRange()?this.htEditor.getSelectedRange().from.row:-1},n=!1;return e===d.ARROW_DOWN&&t.row-1&&(n=!0),n},E("autocomplete",T)},{editors:29,handsontableEditor:35,"helpers/array":42,"helpers/dom/element":45,"helpers/mixed":48,"helpers/unicode":53}],32:[function(e,t,n){"use strict";Object.defineProperties(n,{CheckboxEditor:{get:function(){return u}},__esModule:{value:!0}});var o,r,i,s=(o=e("editors"),o&&o.__esModule&&o||{"default":o}).registerEditor,l=(r=e("_baseEditor"),r&&r.__esModule&&r||{"default":r}).BaseEditor,a=(i=e("helpers/dom/element"),i&&i.__esModule&&i||{"default":i}).hasClass,u=function(){$traceurRuntime.superConstructor(c).apply(this,arguments)},c=u;$traceurRuntime.createClass(u,{beginEditing:function(){var e=this.TD.querySelector('input[type="checkbox"]');a(e,"htBadValue")||e.click()},finishEditing:function(){},init:function(){},open:function(){},close:function(){},getValue:function(){},setValue:function(){},focus:function(){}},{},l),s("checkbox",u)},{_baseEditor:30,editors:29,"helpers/dom/element":45}],33:[function(e,t,n){"use strict";Object.defineProperties(n,{DateEditor:{get:function(){return S}},__esModule:{value:!0}});var o,r,i,s,l,a,u,c,d,h=(o=e("helpers/dom/element"),o&&o.__esModule&&o||{"default":o}),f=h.addClass,g=h.outerHeight,p=(r=e("helpers/object"),r&&r.__esModule&&r||{"default":r}).deepExtend,m=(i=e("eventManager"),i&&i.__esModule&&i||{"default":i}).EventManager,w=(s=e("editors"),s&&s.__esModule&&s||{"default":s}),v=(w.getEditor,w.registerEditor),b=(l=e("helpers/unicode"),l&&l.__esModule&&l||{"default":l}).isMetaKey,C=(a=e("helpers/dom/event"),a&&a.__esModule&&a||{"default":a}).stopPropagation,y=(u=e("textEditor"),u&&u.__esModule&&u||{"default":u}).TextEditor,R=(c=e("moment"),c&&c.__esModule&&c||{"default":c})["default"],E=(d=e("pikaday"),d&&d.__esModule&&d||{"default":d})["default"];Handsontable.editors=Handsontable.editors||{},Handsontable.editors.DateEditor=S;var S=function(e){this.$datePicker=null,this.datePicker=null,this.datePickerStyle=null,this.defaultDateFormat="DD/MM/YYYY",this.isCellEdited=!1,this.parentDestroyed=!1,$traceurRuntime.superConstructor(T).call(this,e)},T=S;$traceurRuntime.createClass(S,{init:function(){var e=this;if("function"!=typeof R)throw new Error("You need to include moment.js to your project.");if("function"!=typeof E)throw new Error("You need to include Pikaday to your project.");$traceurRuntime.superGet(this,T.prototype,"init").call(this),this.instance.addHook("afterDestroy",function(){e.parentDestroyed=!0,e.destroyElements()})},createElements:function(){$traceurRuntime.superGet(this,T.prototype,"createElements").call(this),this.datePicker=document.createElement("DIV"),this.datePickerStyle=this.datePicker.style,this.datePickerStyle.position="absolute",this.datePickerStyle.top=0,this.datePickerStyle.left=0,this.datePickerStyle.zIndex=9999,f(this.datePicker,"htDatepickerHolder"),document.body.appendChild(this.datePicker),this.$datePicker=new E(this.getDatePickerConfig());var e=new m(this);e.addEventListener(this.datePicker,"mousedown",function(e){return C(e)}),this.hideDatepicker()},destroyElements:function(){this.$datePicker.destroy()},prepare:function(e,t,n,o,r,i){this._opened=!1,$traceurRuntime.superGet(this,T.prototype,"prepare").call(this,e,t,n,o,r,i)},open:function(){var e=void 0!==arguments[0]?arguments[0]:null;$traceurRuntime.superGet(this,T.prototype,"open").call(this),this.showDatepicker(e)},close:function(){var e=this;this._opened=!1,this.instance._registerTimeout(setTimeout(function(){e.instance.selection.refreshBorders()},0)),$traceurRuntime.superGet(this,T.prototype,"close").call(this)},finishEditing:function(){var e=void 0!==arguments[0]?arguments[0]:!1,t=void 0!==arguments[1]?arguments[1]:!1;if(e){var n=this.originalValue;void 0!==n&&this.setValue(n)}this.hideDatepicker(),$traceurRuntime.superGet(this,T.prototype,"finishEditing").call(this,e,t)},showDatepicker:function(e){this.$datePicker.config(this.getDatePickerConfig());var t,n=this.TD.getBoundingClientRect(),o=this.cellProperties.dateFormat||this.defaultDateFormat,r=this.$datePicker.config(),i=this.instance.view.isMouseDown(),s=e?b(e.keyCode):!1;this.datePickerStyle.top=window.pageYOffset+n.top+g(this.TD)+"px",this.datePickerStyle.left=window.pageXOffset+n.left+"px",this.$datePicker._onInputFocus=function(){},r.format=o,this.originalValue?(t=this.originalValue,R(t,o,!0).isValid()&&this.$datePicker.setMoment(R(t,o),!0),s||i||this.setValue("")):this.cellProperties.defaultDate?(t=this.cellProperties.defaultDate,r.defaultDate=t,R(t,o,!0).isValid()&&this.$datePicker.setMoment(R(t,o),!0),s||i||this.setValue("")):this.$datePicker.gotoToday(),this.datePickerStyle.display="block",this.$datePicker.show()},hideDatepicker:function(){this.datePickerStyle.display="none",this.$datePicker.hide()},getDatePickerConfig:function(){var e=this,t=this.TEXTAREA,n={};this.cellProperties&&this.cellProperties.datePickerConfig&&p(n,this.cellProperties.datePickerConfig);var o=n.onSelect,r=n.onClose;return n.field=t,n.trigger=t,n.container=this.datePicker,n.bound=!1,n.format=n.format||this.defaultDateFormat,n.reposition=n.reposition||!1,n.onSelect=function(t){isNaN(t.getTime())||(t=R(t).format(e.cellProperties.dateFormat||e.defaultDateFormat)),e.setValue(t),e.hideDatepicker(),o&&o()},n.onClose=function(){e.parentDestroyed||e.finishEditing(!1),r&&r()},n}},{},y),v("date",S)},{editors:29,eventManager:41,"helpers/dom/element":45,"helpers/dom/event":46,"helpers/object":50,"helpers/unicode":53,moment:void 0,pikaday:void 0,textEditor:40}],34:[function(e,t,n){"use strict";Object.defineProperties(n,{DropdownEditor:{get:function(){return a}},__esModule:{value:!0}});var o,r,i=(o=e("editors"),o&&o.__esModule&&o||{"default":o}),s=(i.getEditor,i.registerEditor),l=(r=e("autocompleteEditor"),r&&r.__esModule&&r||{"default":r}).AutocompleteEditor,a=function(){$traceurRuntime.superConstructor(u).apply(this,arguments)},u=a;$traceurRuntime.createClass(a,{prepare:function(e,t,n,o,r,i){$traceurRuntime.superGet(this,u.prototype,"prepare").call(this,e,t,n,o,r,i),this.cellProperties.filter=!1,this.cellProperties.strict=!0}},{},l),Handsontable.hooks.add("beforeValidate",function(e,t,n,o){var r=this.getCellMeta(t,n);r.editor===Handsontable.editors.DropdownEditor&&void 0===r.strict&&(r.filter=!1,r.strict=!0)}),s("dropdown",a)},{autocompleteEditor:31,editors:29}],35:[function(e,t,n){"use strict";Object.defineProperties(n,{HandsontableEditor:{get:function(){return v}},__esModule:{value:!0}});var o,r,i,s,l,a,u=(o=e("helpers/unicode"),o&&o.__esModule&&o||{"default":o}).KEY_CODES,c=(r=e("helpers/object"),r&&r.__esModule&&r||{"default":r}).extend,d=(i=e("helpers/dom/element"),i&&i.__esModule&&i||{"default":i}).setCaretPosition,h=(s=e("helpers/dom/event"),s&&s.__esModule&&s||{"default":s}),f=h.stopImmediatePropagation,g=h.isImmediatePropagationStopped,p=(l=e("editors"),l&&l.__esModule&&l||{"default":l}),m=(p.getEditor,p.registerEditor),w=(a=e("textEditor"),a&&a.__esModule&&a||{"default":a}).TextEditor,v=w.prototype.extend();v.prototype.createElements=function(){w.prototype.createElements.apply(this,arguments);var e=document.createElement("DIV");e.className="handsontableEditor",this.TEXTAREA_PARENT.appendChild(e),this.htContainer=e,this.assignHooks()},v.prototype.prepare=function(e,t,n,o,r,i){w.prototype.prepare.apply(this,arguments);var s=this,l={startRows:0,startCols:0,minRows:0,minCols:0,className:"listbox",copyPaste:!1,autoColumnSize:!1,autoRowSize:!1,readOnly:!0,fillHandle:!1,afterOnCellMouseDown:function(){var e=this.getValue();void 0!==e&&s.setValue(e),s.instance.destroyEditor()}};this.cellProperties.handsontable&&c(l,i.handsontable),this.htOptions=l};var b=function(e){if(!g(e)){var t,n=this.getActiveEditor(),o=n.htEditor.getInstance();if(e.keyCode==u.ARROW_DOWN)if(o.getSelected()){var r=o.getSelected()[0],i=o.countRows()-1;t=Math.min(i,r+1)}else t=0;else if(e.keyCode==u.ARROW_UP&&o.getSelected()){var r=o.getSelected()[0];t=r-1}void 0!==t&&(0>t?o.deselectCell():o.selectCell(t,0),o.getData().length&&(e.preventDefault(),f(e),n.instance.listen(),n.TEXTAREA.focus()))}};v.prototype.open=function(){this.instance.addHook("beforeKeyDown",b),w.prototype.open.apply(this,arguments),this.htEditor&&this.htEditor.destroy(),this.htEditor=new Handsontable(this.htContainer,this.htOptions),this.cellProperties.strict?(this.htEditor.selectCell(0,0),this.TEXTAREA.style.visibility="hidden"):(this.htEditor.deselectCell(),this.TEXTAREA.style.visibility="visible"),d(this.TEXTAREA,0,this.TEXTAREA.value.length)},v.prototype.close=function(){this.instance.removeHook("beforeKeyDown",b),this.instance.listen(),w.prototype.close.apply(this,arguments)},v.prototype.focus=function(){this.instance.listen(),w.prototype.focus.apply(this,arguments)},v.prototype.beginEditing=function(e){var t=this.instance.getSettings().onBeginEditing;t&&t()===!1||w.prototype.beginEditing.apply(this,arguments)},v.prototype.finishEditing=function(e,t){if(this.htEditor&&this.htEditor.isListening()&&this.instance.listen(),this.htEditor&&this.htEditor.getSelected()){var n=this.htEditor.getInstance().getValue();void 0!==n&&this.setValue(n)}return w.prototype.finishEditing.apply(this,arguments)},v.prototype.assignHooks=function(){var e=this;this.instance.addHook("afterDestroy",function(){e.htEditor&&e.htEditor.destroy()})},m("handsontable",v)},{editors:29,"helpers/dom/element":45,"helpers/dom/event":46,"helpers/object":50,"helpers/unicode":53,textEditor:40}],36:[function(e,t,n){"use strict";Object.defineProperties(n,{MobileTextEditor:{get:function(){return M}},__esModule:{value:!0}});var o,r,i,s,l,a,u=(o=e("helpers/unicode"),o&&o.__esModule&&o||{"default":o}).KEY_CODES,c=(r=e("helpers/dom/event"),r&&r.__esModule&&r||{"default":r}),d=c.stopImmediatePropagation,h=c.isImmediatePropagationStopped,f=(i=e("helpers/dom/element"),i&&i.__esModule&&i||{"default":i}),g=f.addClass,p=f.getScrollLeft,m=f.getScrollTop,w=f.hasClass,v=f.isChildOf,b=f.offset,C=f.outerHeight,y=f.outerWidth,R=f.removeClass,E=f.setCaretPosition,S=(s=e("editors"),s&&s.__esModule&&s||{"default":s}),T=(S.getEditor,S.registerEditor),O=(l=e("_baseEditor"),l&&l.__esModule&&l||{"default":l}).BaseEditor,_=(a=e("eventManager"),a&&a.__esModule&&a||{"default":a}).eventManager,M=O.prototype.extend(),H={},k=function(){this.controls={},this.controls.leftButton=document.createElement("DIV"),this.controls.leftButton.className="leftButton", -this.controls.rightButton=document.createElement("DIV"),this.controls.rightButton.className="rightButton",this.controls.upButton=document.createElement("DIV"),this.controls.upButton.className="upButton",this.controls.downButton=document.createElement("DIV"),this.controls.downButton.className="downButton";for(var e in this.controls)this.controls.hasOwnProperty(e)&&this.positionControls.appendChild(this.controls[e])};M.prototype.valueChanged=function(){return this.initValue!=this.getValue()},M.prototype.init=function(){var e=this;this.eventManager=_(this.instance),this.createElements(),this.bindEvents(),this.instance.addHook("afterDestroy",function(){e.destroy()})},M.prototype.getValue=function(){return this.TEXTAREA.value},M.prototype.setValue=function(e){this.initValue=e,this.TEXTAREA.value=e},M.prototype.createElements=function(){this.editorContainer=document.createElement("DIV"),this.editorContainer.className="htMobileEditorContainer",this.cellPointer=document.createElement("DIV"),this.cellPointer.className="cellPointer",this.moveHandle=document.createElement("DIV"),this.moveHandle.className="moveHandle",this.inputPane=document.createElement("DIV"),this.inputPane.className="inputs",this.positionControls=document.createElement("DIV"),this.positionControls.className="positionControls",this.TEXTAREA=document.createElement("TEXTAREA"),g(this.TEXTAREA,"handsontableInput"),this.inputPane.appendChild(this.TEXTAREA),this.editorContainer.appendChild(this.cellPointer),this.editorContainer.appendChild(this.moveHandle),this.editorContainer.appendChild(this.inputPane),this.editorContainer.appendChild(this.positionControls),k.call(this),document.body.appendChild(this.editorContainer)},M.prototype.onBeforeKeyDown=function(e){var t=this,n=t.getActiveEditor();if(e.target===n.TEXTAREA&&!h(e))switch(e.keyCode){case u.ENTER:n.close(),e.preventDefault();break;case u.BACKSPACE:d(e)}},M.prototype.open=function(){this.instance.addHook("beforeKeyDown",this.onBeforeKeyDown),g(this.editorContainer,"active"),R(this.cellPointer,"hidden"),this.updateEditorPosition()},M.prototype.focus=function(){this.TEXTAREA.focus(),E(this.TEXTAREA,this.TEXTAREA.value.length)},M.prototype.close=function(){this.TEXTAREA.blur(),this.instance.removeHook("beforeKeyDown",this.onBeforeKeyDown),R(this.editorContainer,"active")},M.prototype.scrollToView=function(){var e=this.instance.getSelectedRange().highlight;this.instance.view.scrollViewport(e)},M.prototype.hideCellPointer=function(){w(this.cellPointer,"hidden")||g(this.cellPointer,"hidden")},M.prototype.updateEditorPosition=function(e,t){if(e&&t)e=parseInt(e,10),t=parseInt(t,10),this.editorContainer.style.top=t+"px",this.editorContainer.style.left=e+"px";else{var n=this.instance.getSelected(),o=this.instance.getCell(n[0],n[1]);if(H.cellPointer||(H.cellPointer={height:C(this.cellPointer),width:y(this.cellPointer)}),H.editorContainer||(H.editorContainer={width:y(this.editorContainer)}),void 0!==o){var r=this.instance.view.wt.wtOverlays.leftOverlay.trimmingContainer==window?0:p(this.instance.view.wt.wtOverlays.leftOverlay.holder),i=this.instance.view.wt.wtOverlays.topOverlay.trimmingContainer==window?0:m(this.instance.view.wt.wtOverlays.topOverlay.holder),s=b(o),l=y(o),a={x:r,y:i};this.editorContainer.style.top=parseInt(s.top+C(o)-a.y+H.cellPointer.height,10)+"px",this.editorContainer.style.left=parseInt(window.innerWidth/2-H.editorContainer.width/2,10)+"px",s.left+l/2>parseInt(this.editorContainer.style.left,10)+H.editorContainer.width?this.editorContainer.style.left=window.innerWidth-H.editorContainer.width+"px":s.left+l/2n;n++)t[e[n]]=e[n];else"object"==typeof e&&(t=e);return t},S.prototype.getValue=function(){return this.select.value},S.prototype.setValue=function(e){this.select.value=e};var T=function(e){var t=this,n=t.getActiveEditor();switch(e.keyCode){case C.ARROW_UP:var o=n.select.selectedIndex-1;o>=0&&(n.select[o].selected=!0),b(e),e.preventDefault();break;case C.ARROW_DOWN:var r=n.select.selectedIndex+1;r<=n.select.length-1&&(n.select[r].selected=!0),b(e),e.preventDefault()}};S.prototype.open=function(){this._opened=!0,this.refreshDimensions(),this.select.style.display="",this.instance.addHook("beforeKeyDown",T)},S.prototype.close=function(){this._opened=!1,this.select.style.display="none",this.instance.removeHook("beforeKeyDown",T)},S.prototype.focus=function(){this.select.focus()},S.prototype.refreshDimensions=function(){if(this.state===Handsontable.EditorState.EDITING){if(this.TD=this.getEditedCell(),!this.TD)return void this.close();var e,t=w(this.TD)+1,n=m(this.TD)+1,o=p(this.TD),r=p(this.instance.rootElement),i=g(this.TD),s=o.top-r.top-1-(i.scrollTop||0),l=o.left-r.left-1-(i.scrollLeft||0),a=this.checkEditorSection(),u=this.instance.getSettings();u.rowHeaders?1:0,u.colHeaders?1:0;switch(a){case"top":e=f(this.instance.view.wt.wtOverlays.topOverlay.clone.wtTable.holder.parentNode);break;case"left":e=f(this.instance.view.wt.wtOverlays.leftOverlay.clone.wtTable.holder.parentNode);break;case"top-left-corner":e=f(this.instance.view.wt.wtOverlays.topLeftCornerOverlay.clone.wtTable.holder.parentNode);break;case"bottom-left-corner":e=f(this.instance.view.wt.wtOverlays.bottomLeftCornerOverlay.clone.wtTable.holder.parentNode);break;case"bottom":e=f(this.instance.view.wt.wtOverlays.bottomOverlay.clone.wtTable.holder.parentNode)}0===this.instance.getSelected()[0]&&(s+=1),0===this.instance.getSelected()[1]&&(l+=1);var c=this.select.style;e&&-1!=e?c[e[0]]=e[1]:v(this.select);var d=h(this.TD);parseInt(d.borderTopWidth,10)>0&&(n-=1),parseInt(d.borderLeftWidth,10)>0&&(t-=1),c.height=n+"px",c.minWidth=t+"px",c.top=s+"px",c.left=l+"px",c.margin="0px"}},S.prototype.getEditedCell=function(){var e,t=this.checkEditorSection();switch(t){case"top":e=this.instance.view.wt.wtOverlays.topOverlay.clone.wtTable.getCell({row:this.row,col:this.col}),this.select.style.zIndex=101;break;case"corner":e=this.instance.view.wt.wtOverlays.topLeftCornerOverlay.clone.wtTable.getCell({row:this.row,col:this.col}),this.select.style.zIndex=103;break;case"left":e=this.instance.view.wt.wtOverlays.leftOverlay.clone.wtTable.getCell({row:this.row,col:this.col}),this.select.style.zIndex=102;break;default:e=this.instance.getCell(this.row,this.col),this.select.style.zIndex=""}return-1!=e&&-2!=e?e:void 0},R("select",S)},{_baseEditor:30,editors:29,"helpers/dom/element":45,"helpers/dom/event":46,"helpers/unicode":53}],40:[function(e,t,n){"use strict";Object.defineProperties(n,{TextEditor:{get:function(){return k}},__esModule:{value:!0}});var o,r,i,s,l,a,u,c=(o=e("helpers/dom/element"),o&&o.__esModule&&o||{"default":o}),d=c.addClass,h=c.getCaretPosition,f=c.getComputedStyle,g=c.getCssTransform,p=c.getScrollableElement,m=c.innerWidth,w=c.offset,v=c.resetCssTransform,b=c.setCaretPosition,C=(r=e("autoResize"),r&&r.__esModule&&r||{"default":r})["default"],y=(i=e("_baseEditor"),i&&i.__esModule&&i||{"default":i}).BaseEditor,R=(s=e("eventManager"),s&&s.__esModule&&s||{"default":s}).eventManager,E=(l=e("editors"),l&&l.__esModule&&l||{"default":l}),S=(E.getEditor,E.registerEditor),T=(a=e("helpers/unicode"),a&&a.__esModule&&a||{"default":a}).KEY_CODES,O=(u=e("helpers/dom/event"),u&&u.__esModule&&u||{"default":u}),_=O.stopPropagation,M=O.stopImmediatePropagation,H=O.isImmediatePropagationStopped,k=y.prototype.extend();k.prototype.init=function(){var e=this;this.createElements(),this.eventManager=R(this),this.bindEvents(),this.autoResize=C(),this.instance.addHook("afterDestroy",function(){e.destroy()})},k.prototype.getValue=function(){return this.TEXTAREA.value},k.prototype.setValue=function(e){this.TEXTAREA.value=e};var A=function(e){var t,n=this,o=n.getActiveEditor();if(t=(e.ctrlKey||e.metaKey)&&!e.altKey,e.target===o.TEXTAREA&&!H(e)){if(17===e.keyCode||224===e.keyCode||91===e.keyCode||93===e.keyCode)return void M(e);switch(e.keyCode){case T.ARROW_RIGHT:o.isInFullEditMode()&&(!o.isWaiting()&&!o.allowKeyEventPropagation||!o.isWaiting()&&o.allowKeyEventPropagation&&!o.allowKeyEventPropagation(e.keyCode))&&M(e);break;case T.ARROW_LEFT:o.isInFullEditMode()&&(!o.isWaiting()&&!o.allowKeyEventPropagation||!o.isWaiting()&&o.allowKeyEventPropagation&&!o.allowKeyEventPropagation(e.keyCode))&&M(e);break;case T.ARROW_UP:case T.ARROW_DOWN:o.isInFullEditMode()&&(!o.isWaiting()&&!o.allowKeyEventPropagation||!o.isWaiting()&&o.allowKeyEventPropagation&&!o.allowKeyEventPropagation(e.keyCode))&&M(e);break;case T.ENTER:var r=o.instance.getSelected(),i=!(r[0]===r[2]&&r[1]===r[3]);if(t&&!i||e.altKey){if(o.isOpened()){var s=h(o.TEXTAREA),l=o.getValue(),a=l.slice(0,s)+"\n"+l.slice(s);o.setValue(a),b(o.TEXTAREA,s+1)}else o.beginEditing(o.originalValue+"\n");M(e)}e.preventDefault();break;case T.A:case T.X:case T.C:case T.V:t&&M(e);break;case T.BACKSPACE:case T.DELETE:case T.HOME:case T.END:M(e)}-1===[T.ARROW_UP,T.ARROW_RIGHT,T.ARROW_DOWN,T.ARROW_LEFT].indexOf(e.keyCode)&&o.autoResize.resize(String.fromCharCode(e.keyCode))}};k.prototype.open=function(){this.refreshDimensions(),this.instance.addHook("beforeKeyDown",A)},k.prototype.close=function(e){this.textareaParentStyle.display="none",this.autoResize.unObserve(),document.activeElement===this.TEXTAREA&&this.instance.listen(),this.instance.removeHook("beforeKeyDown",A)},k.prototype.focus=function(){this.TEXTAREA.focus(),b(this.TEXTAREA,this.TEXTAREA.value.length)},k.prototype.createElements=function(){this.TEXTAREA=document.createElement("TEXTAREA"),d(this.TEXTAREA,"handsontableInput"),this.textareaStyle=this.TEXTAREA.style,this.textareaStyle.width=0,this.textareaStyle.height=0,this.TEXTAREA_PARENT=document.createElement("DIV"),d(this.TEXTAREA_PARENT,"handsontableInputHolder"),this.textareaParentStyle=this.TEXTAREA_PARENT.style,this.textareaParentStyle.top=0,this.textareaParentStyle.left=0,this.textareaParentStyle.display="none",this.TEXTAREA_PARENT.appendChild(this.TEXTAREA),this.instance.rootElement.appendChild(this.TEXTAREA_PARENT);var e=this;this.instance._registerTimeout(setTimeout(function(){e.refreshDimensions()},0))},k.prototype.getEditedCell=function(){var e,t=this.checkEditorSection();switch(t){case"top":e=this.instance.view.wt.wtOverlays.topOverlay.clone.wtTable.getCell({row:this.row,col:this.col}),this.textareaParentStyle.zIndex=101;break;case"top-left-corner":e=this.instance.view.wt.wtOverlays.topLeftCornerOverlay.clone.wtTable.getCell({row:this.row,col:this.col}),this.textareaParentStyle.zIndex=103;break;case"bottom-left-corner":e=this.instance.view.wt.wtOverlays.bottomLeftCornerOverlay.clone.wtTable.getCell({row:this.row,col:this.col}),this.textareaParentStyle.zIndex=103;break;case"left":e=this.instance.view.wt.wtOverlays.leftOverlay.clone.wtTable.getCell({row:this.row,col:this.col}),this.textareaParentStyle.zIndex=102;break;case"bottom":e=this.instance.view.wt.wtOverlays.bottomOverlay.clone.wtTable.getCell({row:this.row,col:this.col}),this.textareaParentStyle.zIndex=102;break;default:e=this.instance.getCell(this.row,this.col),this.textareaParentStyle.zIndex=""}return-1!=e&&-2!=e?e:void 0},k.prototype.refreshDimensions=function(){if(this.state===Handsontable.EditorState.EDITING){if(this.TD=this.getEditedCell(),!this.TD)return void this.close(!0);var e,t=w(this.TD),n=w(this.instance.rootElement),o=p(this.TD),r=this.instance.countRows(),i=t.top-n.top-1-(o.scrollTop||0),s=t.left-n.left-1-(o.scrollLeft||0),l=this.instance.getSettings(),a=(l.rowHeaders?1:0,l.colHeaders?1:0),u=this.checkEditorSection(),c=this.TD.style.backgroundColor;switch(u){case"top":e=g(this.instance.view.wt.wtOverlays.topOverlay.clone.wtTable.holder.parentNode);break;case"left":e=g(this.instance.view.wt.wtOverlays.leftOverlay.clone.wtTable.holder.parentNode);break;case"top-left-corner":e=g(this.instance.view.wt.wtOverlays.topLeftCornerOverlay.clone.wtTable.holder.parentNode);break;case"bottom-left-corner":e=g(this.instance.view.wt.wtOverlays.bottomLeftCornerOverlay.clone.wtTable.holder.parentNode);break;case"bottom":e=g(this.instance.view.wt.wtOverlays.bottomOverlay.clone.wtTable.holder.parentNode)}(a&&0===this.instance.getSelected()[0]||l.fixedRowsBottom&&this.instance.getSelected()[0]===r-l.fixedRowsBottom)&&(i+=1),0===this.instance.getSelected()[1]&&(s+=1),e&&-1!=e?this.textareaParentStyle[e[0]]=e[1]:v(this.textareaParentStyle),this.textareaParentStyle.top=i+"px",this.textareaParentStyle.left=s+"px";var d=this.TD.offsetTop-this.instance.view.wt.wtOverlays.topOverlay.getScrollPosition(),h=this.TD.offsetLeft-this.instance.view.wt.wtOverlays.leftOverlay.getScrollPosition(),b=m(this.TD)-8,C=this.instance.view.maximumVisibleElementWidth(h)-9,y=this.TD.scrollHeight+1,R=Math.max(this.instance.view.maximumVisibleElementHeight(d)-2,23),E=f(this.TD);this.TEXTAREA.style.fontSize=E.fontSize,this.TEXTAREA.style.fontFamily=E.fontFamily,this.TEXTAREA.style.backgroundColor="",this.TEXTAREA.style.backgroundColor=c?c:f(this.TEXTAREA).backgroundColor,this.autoResize.init(this.TEXTAREA,{minHeight:Math.min(y,R),maxHeight:R,minWidth:Math.min(b,C),maxWidth:C},!0),this.textareaParentStyle.display="block"}},k.prototype.bindEvents=function(){var e=this;this.eventManager.addEventListener(this.TEXTAREA,"cut",function(e){_(e)}),this.eventManager.addEventListener(this.TEXTAREA,"paste",function(e){_(e)}),this.instance.addHook("afterScrollVertically",function(){e.refreshDimensions()}),this.instance.addHook("afterColumnResize",function(){e.refreshDimensions(),e.focus()}),this.instance.addHook("afterRowResize",function(){e.refreshDimensions(),e.focus()}),this.instance.addHook("afterDestroy",function(){e.eventManager.destroy()})},k.prototype.destroy=function(){this.eventManager.destroy()},S("text",k)},{_baseEditor:30,autoResize:"autoResize",editors:29,eventManager:41,"helpers/dom/element":45,"helpers/dom/event":46,"helpers/unicode":53}],41:[function(e,t,n){"use strict";function o(e,t){var n,o,r,i,s,l="HOT-TABLE";if(t.isTargetWebComponent=!1,t.realTarget=t.target,!Handsontable.eventManager.isHotTableEnv)return t;for(t=a(t),s=t.path?t.path.length:0;s--;){if(t.path[s].nodeName===l)n=!0;else if(n&&t.path[s].shadowRoot){i=t.path[s];break}0!==s||i||(i=t.path[s])}return i||(i=t.target),t.isTargetWebComponent=!0,c()?t.realTarget=t.srcElement||t.toElement:(e instanceof Handsontable.Core||e instanceof Walkontable)&&(e instanceof Handsontable.Core?o=e.view?e.view.wt.wtTable.TABLE:null:e instanceof Walkontable&&(o=e.wtTable.TABLE.parentNode.parentNode),r=u(t.target,[l],o),r?t.realTarget=o.querySelector(l)||t.target:t.realTarget=t.target),Object.defineProperty(t,"target",{get:function(){return a(i)},enumerable:!0,configurable:!0}),t}function r(e){return new d(e)}Object.defineProperties(n,{EventManager:{get:function(){return d}},eventManager:{get:function(){return r}},__esModule:{value:!0}});var i,s,l=(i=e("helpers/dom/element"),i&&i.__esModule&&i||{"default":i}),a=l.polymerWrap,u=l.closest,c=(s=e("helpers/browser"),s&&s.__esModule&&s||{"default":s}).isWebComponentSupportedNatively,d=function(){var e=void 0!==arguments[0]?arguments[0]:null;this.context=e||this,this.context.eventListeners||(this.context.eventListeners=[])};$traceurRuntime.createClass(d,{addEventListener:function(e,t,n){function r(e){void 0==e.target&&void 0!=e.srcElement&&(e.definePoperty?e.definePoperty("target",{value:e.srcElement}):e.target=e.srcElement),void 0==e.preventDefault&&(e.definePoperty?e.definePoperty("preventDefault",{value:function(){this.returnValue=!1}}):e.preventDefault=function(){this.returnValue=!1}),e=o(s,e),n.call(this,e)}var i=this,s=this.context;return this.context.eventListeners.push({element:e,event:t,callback:n,callbackProxy:r}),window.addEventListener?e.addEventListener(t,r,!1):e.attachEvent("on"+t,r),Handsontable.countEventManagerListeners++,function(){i.removeEventListener(e,t,n)}},removeEventListener:function(e,t,n){for(var o,r=this.context.eventListeners.length;r--;)if(o=this.context.eventListeners[r],o.event==t&&o.element==e){if(n&&n!=o.callback)continue;this.context.eventListeners.splice(r,1),o.element.removeEventListener?o.element.removeEventListener(o.event,o.callbackProxy,!1):o.element.detachEvent("on"+o.event,o.callbackProxy),Handsontable.countEventManagerListeners--}},clearEvents:function(){if(this.context)for(var e=this.context.eventListeners.length;e--;){var t=this.context.eventListeners[e];t&&this.removeEventListener(t.element,t.event,t.callback)}},clear:function(){this.clearEvents()},destroy:function(){this.clearEvents(),this.context=null},fireEvent:function(e,t){var n,o={bubbles:!0,cancelable:"mousemove"!==t,view:window,detail:0,screenX:0,screenY:0,clientX:1,clientY:1,ctrlKey:!1,altKey:!1,shiftKey:!1,metaKey:!1,button:0,relatedTarget:void 0};document.createEvent?(n=document.createEvent("MouseEvents"),n.initMouseEvent(t,o.bubbles,o.cancelable,o.view,o.detail,o.screenX,o.screenY,o.clientX,o.clientY,o.ctrlKey,o.altKey,o.shiftKey,o.metaKey,o.button,o.relatedTarget||document.body.parentNode)):n=document.createEventObject(),e.dispatchEvent?e.dispatchEvent(n):e.fireEvent("on"+t,n)}},{}),window.Handsontable=window.Handsontable||{},Handsontable.countEventManagerListeners=0,Handsontable.eventManager=r},{"helpers/browser":43,"helpers/dom/element":45}],42:[function(e,t,n){"use strict";function o(e){for(var t=0,n=e.length;n>t;)e[t]=[e[t]],t++}function r(e,t){for(var n=0,o=t.length;o>n;)e.push(t[n]),n++}function i(e){var t=[];if(!e||0===e.length||!e[0]||0===e[0].length)return t;for(var n=e.length,o=e[0].length,r=0;n>r;r++)for(var i=0;o>i;i++)t[i]||(t[i]=[]),t[i][r]=e[r][i];return t}function s(e,t,n,o){var r=-1,i=e.length;for(o&&i&&(n=e[++r]);++rt?e:t},Array.isArray(e)?e[0]:void 0)}function h(e){return s(e,function(e,t){return t>e?e:t},Array.isArray(e)?e[0]:void 0)}function f(e){return e.length?c(e)/e.length:0}function g(e){return s(e,function(e,t){return e.concat(Array.isArray(t)?g(t):t)},[])}function p(e){var t=[];return u(e,function(e){-1===t.indexOf(e)&&t.push(e)}),t}Object.defineProperties(n,{to2dArray:{get:function(){return o}},extendArray:{get:function(){return r}},pivot:{get:function(){return i}},arrayReduce:{get:function(){return s}},arrayFilter:{get:function(){return l}},arrayMap:{get:function(){return a}},arrayEach:{get:function(){return u}},arraySum:{get:function(){return c}},arrayMax:{get:function(){return d}},arrayMin:{get:function(){return h}},arrayAvg:{get:function(){return f}},arrayFlatten:{get:function(){return g}},arrayUnique:{get:function(){return p}},__esModule:{value:!0}})},{}],43:[function(e,t,n){"use strict";function o(){return f}function r(){return g}function i(){return p}function s(){return m}function l(e){return e||(e=navigator.userAgent),/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(e)}function a(){return"ontouchstart"in window}function u(){var e=document.createElement("div");return e.createShadowRoot&&e.createShadowRoot.toString().match(/\[native code\]/)?!0:!1}function c(){var e=document.createElement("TABLE");e.style.borderSpacing=0,e.style.borderWidth=0,e.style.padding=0;var t=document.createElement("TBODY");e.appendChild(t),t.appendChild(document.createElement("TR")),t.firstChild.appendChild(document.createElement("TD")),t.firstChild.firstChild.innerHTML="t
t";var n=document.createElement("CAPTION");n.innerHTML="c
c
c
c",n.style.padding=0,n.style.margin=0,e.insertBefore(n,t),document.body.appendChild(e),h=e.offsetHeight<2*e.lastChild.offsetHeight,document.body.removeChild(e)}function d(){return void 0===h&&c(),h}Object.defineProperties(n,{isIE8:{get:function(){return o}},isIE9:{get:function(){return r}},isSafari:{get:function(){return i}},isChrome:{get:function(){return s}},isMobileBrowser:{get:function(){return l}},isTouchSupported:{get:function(){return a}},isWebComponentSupportedNatively:{get:function(){return u}},hasCaptionProblem:{get:function(){return d}},__esModule:{value:!0}});var h,f=!document.createTextNode("test").textContent,g=!!document.documentMode,p=/Safari/.test(navigator.userAgent)&&/Apple Computer/.test(navigator.vendor),m=/Chrome/.test(navigator.userAgent)&&/Google/.test(navigator.vendor)},{}],44:[function(e,t,n){"use strict";function o(e){for(var t,n=e+1,o="";n>0;)t=(n-1)%26,o=String.fromCharCode(65+t)+o,n=parseInt((n-t)/26,10);return o}function r(e,t){e="number"==typeof e?e:100,t="number"==typeof t?t:4;var n,r,i=[];for(n=0;e>n;n++){var s=[];for(r=0;t>r;r++)s.push(o(r)+(n+1));i.push(s)}return i}function i(e,t){e="number"==typeof e?e:100,t="number"==typeof t?t:4;var n,r,i=[];for(n=0;e>n;n++){var s={};for(r=0;t>r;r++)s["prop"+r]=o(r)+(n+1);i.push(s)}return i}function s(e,t){for(var n,o=[],r=0;e>r;r++){n=[];for(var i=0;t>i;i++)n.push("");o.push(n)}return o}function l(e){var t,n,o,r,i=[],s=0;for(t=0,n=e.length;n>t;t++)for(o=0,r=e[t].length;r>o;o++)o==s&&(i.push([]),s++),i[o].push(e[t][o]);return i}function a(e,t){function n(e){var t=Handsontable.cellTypes[e];if("undefined"==typeof t)throw new Error('You declared cell type "'+e+'" as a string that is not mapped to a known object. Cell type must be an object or a string mapped to an object in Handsontable.cellTypes');return t}return t="undefined"==typeof t?!0:t,function(o,r){return function i(o){if(o){if(o.hasOwnProperty(e)&&void 0!==o[e])return o[e];if(o.hasOwnProperty("type")&&o.type){var r;if("string"!=typeof o.type)throw new Error("Cell type must be a string ");if(r=n(o.type),r.hasOwnProperty(e))return r[e];if(t)return}return i(c(o))}}("number"==typeof o?this.getCellMeta(o,r):o)}}Object.defineProperties(n,{spreadsheetColumnLabel:{get:function(){return o}},createSpreadsheetData:{get:function(){return r}},createSpreadsheetObjectData:{get:function(){return i}},createEmptySpreadsheetData:{get:function(){return s}},translateRowsToColumns:{get:function(){return l}},cellMethodLookupFactory:{get:function(){return a}},__esModule:{value:!0}});var u,c=(u=e("object"),u&&u.__esModule&&u||{"default":u}).getPrototypeOf},{object:50}],45:[function(e,t,n){"use strict";function o(e,t,n){for(;null!=e&&e!==n;){if(e.nodeType===Node.ELEMENT_NODE&&(t.indexOf(e.nodeName)>-1||t.indexOf(e)>-1))return e;e=e.host&&e.nodeType===Node.DOCUMENT_FRAGMENT_NODE?e.host:e.parentNode}return null}function r(e,t){var n=e.parentNode,o=[];for("string"==typeof t?o=Array.prototype.slice.call(document.querySelectorAll(t),0):o.push(t);null!=n;){if(o.indexOf(n)>-1)return!0;n=n.parentNode}return!1}function i(e){function t(e){return e.nodeType===Node.ELEMENT_NODE&&e.nodeName===o.toUpperCase()}var n,o="hot-table",r=!1;for(n=s(e);null!=n;){if(t(n)){r=!0;break}if(n.host&&n.nodeType===Node.DOCUMENT_FRAGMENT_NODE){if(r=t(n.host))break;n=n.host}n=n.parentNode}return r}function s(e){return"undefined"!=typeof Polymer&&"function"==typeof wrap?wrap(e):e}function l(e){return"undefined"!=typeof Polymer&&"function"==typeof unwrap?unwrap(e):e}function a(e){var t=0;if(e.previousSibling)for(;e=e.previousSibling;)++t;return t}function u(e,t){var n=document.querySelector(".ht_clone_"+e);return n?n.contains(t):null}function c(e){var t=0,n=[];if(!e||!e.length)return n;for(;e[t];)n.push(e[t]),t++;return n}function d(e,t){return Y(e,t)}function h(e,t){return X(e,t)}function f(e,t){return q(e,t)}function g(e,t){if(3===e.nodeType)t.removeChild(e);else if(["TABLE","THEAD","TBODY","TFOOT","TR"].indexOf(e.nodeName)>-1)for(var n=e.childNodes,o=n.length-1;o>=0;o--)g(n[o],e)}function p(e){for(var t;t=e.lastChild;)e.removeChild(t)}function m(e,t){se.test(t)?e.innerHTML=t:w(e,t)}function w(e,t){var n=e.firstChild;n&&3===n.nodeType&&null===n.nextSibling?le?n.textContent=t:n.data=t:(p(e),e.appendChild(document.createTextNode(t)))}function v(e){for(var t=e;l(t)!==document.documentElement;){if(null===t)return!1;if(t.nodeType===Node.DOCUMENT_FRAGMENT_NODE){if(t.host){if(t.host.impl)return v(t.host.impl);if(t.host)return v(t.host);throw new Error("Lost in Web Components world")}return!1}if("none"===t.style.display)return!1;t=t.parentNode}return!0}function b(e){var t,n,o,r,i;if(r=document.documentElement,te()&&e.firstChild&&"CAPTION"===e.firstChild.nodeName)return i=e.getBoundingClientRect(),{top:i.top+(window.pageYOffset||r.scrollTop)-(r.clientTop||0),left:i.left+(window.pageXOffset||r.scrollLeft)-(r.clientLeft||0)};for(t=e.offsetLeft,n=e.offsetTop,o=e;(e=e.offsetParent)&&e!==document.body;)t+=e.offsetLeft,n+=e.offsetTop,o=e;return o&&"fixed"===o.style.position&&(t+=window.pageXOffset||r.scrollLeft,n+=window.pageYOffset||r.scrollTop),{left:t,top:n}}function C(){var e=window.scrollY;return void 0===e&&(e=document.documentElement.scrollTop),e}function y(){var e=window.scrollX;return void 0===e&&(e=document.documentElement.scrollLeft),e}function R(e){return e===window?C():e.scrollTop}function E(e){return e===window?y():e.scrollLeft}function S(e){for(var t,n,o,r=e.parentNode,i=["auto","scroll"],s="",l="",a="",u="";r&&r.style&&document.body!==r;){if(t=r.style.overflow,n=r.style.overflowX,o=r.style.overflowY,"scroll"==t||"scroll"==n||"scroll"==o)return r;if(window.getComputedStyle&&(s=window.getComputedStyle(r),l=s.getPropertyValue("overflow"),a=s.getPropertyValue("overflow-y"),u=s.getPropertyValue("overflow-x"),"scroll"===l||"scroll"===u||"scroll"===a))return r;if(r.clientHeight<=r.scrollHeight&&(-1!==i.indexOf(o)||-1!==i.indexOf(t)||-1!==i.indexOf(l)||-1!==i.indexOf(a)))return r;if(r.clientWidth<=r.scrollWidth&&(-1!==i.indexOf(n)||-1!==i.indexOf(t)||-1!==i.indexOf(l)||-1!==i.indexOf(u)))return r;r=r.parentNode}return window}function T(e){for(var t=e.parentNode;t&&t.style&&document.body!==t;){if("visible"!==t.style.overflow&&""!==t.style.overflow)return t;if(window.getComputedStyle){var n=window.getComputedStyle(t);if("visible"!==n.getPropertyValue("overflow")&&""!==n.getPropertyValue("overflow"))return t; -}t=t.parentNode}return window}function O(e,t){if(e){if(e!==window){var n,o=e.style[t];return""!==o&&void 0!==o?o:(n=_(e),""!==n[t]&&void 0!==n[t]?n[t]:void 0)}if("width"===t)return window.innerWidth+"px";if("height"===t)return window.innerHeight+"px"}}function _(e){return e.currentStyle||document.defaultView.getComputedStyle(e)}function M(e){return e.offsetWidth}function H(e){return te()&&e.firstChild&&"CAPTION"===e.firstChild.nodeName?e.offsetHeight+e.firstChild.offsetHeight:e.offsetHeight}function k(e){return e.clientHeight||e.innerHeight}function A(e){return e.clientWidth||e.innerWidth}function P(e,t,n){window.addEventListener?e.addEventListener(t,n,!1):e.attachEvent("on"+t,n)}function x(e,t,n){window.removeEventListener?e.removeEventListener(t,n,!1):e.detachEvent("on"+t,n)}function D(e){if(e.selectionStart)return e.selectionStart;if(document.selection){e.focus();var t=document.selection.createRange();if(null==t)return 0;var n=e.createTextRange(),o=n.duplicate();return n.moveToBookmark(t.getBookmark()),o.setEndPoint("EndToStart",n),o.text.length}return 0}function N(e){if(e.selectionEnd)return e.selectionEnd;if(document.selection){var t=document.selection.createRange();if(null==t)return 0;var n=e.createTextRange();return n.text.indexOf(t.text)+t.text.length}}function L(){var e="";return window.getSelection?e=window.getSelection().toString():document.selection&&"Control"!==document.selection.type&&(e=document.selection.createRange().text),e}function W(e,t,n){if(void 0===n&&(n=t),e.setSelectionRange){e.focus();try{e.setSelectionRange(t,n)}catch(o){var r=e.parentNode,i=r.style.display;r.style.display="block",e.setSelectionRange(t,n),r.style.display=i}}else if(e.createTextRange){var s=e.createTextRange();s.collapse(!0),s.moveEnd("character",n),s.moveStart("character",t),s.select()}}function I(){var e=document.createElement("p");e.style.width="100%",e.style.height="200px";var t=document.createElement("div");t.style.position="absolute",t.style.top="0px",t.style.left="0px",t.style.visibility="hidden",t.style.width="200px",t.style.height="150px",t.style.overflow="hidden",t.appendChild(e),(document.body||document.documentElement).appendChild(t);var n=e.offsetWidth;t.style.overflow="scroll";var o=e.offsetWidth;return n==o&&(o=t.clientWidth),(document.body||document.documentElement).removeChild(t),n-o}function j(){return void 0===ie&&(ie=I()),ie}function B(e,t,n){J()||Z()?(e.style.top=n,e.style.left=t):ee()?e.style["-webkit-transform"]="translate3d("+t+","+n+",0)":e.style.transform="translate3d("+t+","+n+",0)"}function V(e){var t;return e.style.transform&&""!==(t=e.style.transform)?["transform",t]:e.style["-webkit-transform"]&&""!==(t=e.style["-webkit-transform"])?["-webkit-transform",t]:-1}function F(e){e.transform&&""!==e.transform?e.transform="":e["-webkit-transform"]&&""!==e["-webkit-transform"]&&(e["-webkit-transform"]="")}function z(e){var t=["INPUT","SELECT","TEXTAREA"];return t.indexOf(e.nodeName)>-1||"true"===e.contentEditable}function U(e){return z(e)&&-1==e.className.indexOf("handsontableInput")&&-1==e.className.indexOf("copyPaste")}function G(e){return ce.call(window,e)}function $(e){de.call(window,e)}Object.defineProperties(n,{closest:{get:function(){return o}},isChildOf:{get:function(){return r}},isChildOfWebComponentTable:{get:function(){return i}},polymerWrap:{get:function(){return s}},polymerUnwrap:{get:function(){return l}},index:{get:function(){return a}},overlayContainsElement:{get:function(){return u}},hasClass:{get:function(){return d}},addClass:{get:function(){return h}},removeClass:{get:function(){return f}},removeTextNodes:{get:function(){return g}},empty:{get:function(){return p}},HTML_CHARACTERS:{get:function(){return se}},fastInnerHTML:{get:function(){return m}},fastInnerText:{get:function(){return w}},isVisible:{get:function(){return v}},offset:{get:function(){return b}},getWindowScrollTop:{get:function(){return C}},getWindowScrollLeft:{get:function(){return y}},getScrollTop:{get:function(){return R}},getScrollLeft:{get:function(){return E}},getScrollableElement:{get:function(){return S}},getTrimmingContainer:{get:function(){return T}},getStyle:{get:function(){return O}},getComputedStyle:{get:function(){return _}},outerWidth:{get:function(){return M}},outerHeight:{get:function(){return H}},innerHeight:{get:function(){return k}},innerWidth:{get:function(){return A}},addEvent:{get:function(){return P}},removeEvent:{get:function(){return x}},getCaretPosition:{get:function(){return D}},getSelectionEndPosition:{get:function(){return N}},getSelectionText:{get:function(){return L}},setCaretPosition:{get:function(){return W}},getScrollbarWidth:{get:function(){return j}},setOverlayPosition:{get:function(){return B}},getCssTransform:{get:function(){return V}},resetCssTransform:{get:function(){return F}},isInput:{get:function(){return z}},isOutsideInput:{get:function(){return U}},requestAnimationFrame:{get:function(){return G}},cancelAnimationFrame:{get:function(){return $}},__esModule:{value:!0}});var K,Y,X,q,Q=(K=e("../browser"),K&&K.__esModule&&K||{"default":K}),J=Q.isIE8,Z=Q.isIE9,ee=Q.isSafari,te=Q.hasCaptionProblem,ne=document.documentElement.classList?!0:!1;if(ne){var oe=function(){var e=document.createElement("div");return e.classList.add("test","test2"),e.classList.contains("test2")}();Y=function(e,t){return""===t?!1:e.classList.contains(t)},X=function(e,t){var n=0;if("string"==typeof t&&(t=t.split(" ")),t=c(t),oe)e.classList.add.apply(e.classList,t);else for(;t&&t[n];)e.classList.add(t[n]),n++},q=function(e,t){var n=0;if("string"==typeof t&&(t=t.split(" ")),t=c(t),oe)e.classList.remove.apply(e.classList,t);else for(;t&&t[n];)e.classList.remove(t[n]),n++}}else{var re=function(e){return new RegExp("(\\s|^)"+e+"(\\s|$)")};Y=function(e,t){return e.className.match(re(t))?!0:!1},X=function(e,t){var n=0,o=e.className;if("string"==typeof t&&(t=t.split(" ")),""===o)o=t.join(" ");else for(;t&&t[n];)re(t[n]).test(o)||(o+=" "+t[n]),n++;e.className=o},q=function(e,t){var n=0,o=e.className;for("string"==typeof t&&(t=t.split(" "));t&&t[n];)o=o.replace(re(t[n])," ").trim(),n++;e.className!==o&&(e.className=o)}}for(var ie,se=/(<(.*)>|&(.*);)/,le=document.createTextNode("test").textContent?!0:!1,ae=0,ue=["ms","moz","webkit","o"],ce=window.requestAnimationFrame,de=window.cancelAnimationFrame,he=0;he=t&&n(o)!==!1;);}function s(e,t){return t=parseInt(t.toString().replace("%",""),10),t=parseInt(e*t/100)}Object.defineProperties(n,{isNumeric:{get:function(){return o}},rangeEach:{get:function(){return r}},rangeEachReverse:{get:function(){return i}},valueAccordingPercent:{get:function(){return s}},__esModule:{value:!0}})},{}],50:[function(e,t,n){"use strict";function o(e){var t;return Array.isArray(e)?t=[]:(t={},g(e,function(e,n){e&&"object"==typeof e&&!Array.isArray(e)?t[n]=o(e):Array.isArray(e)?e.length&&"object"==typeof e[0]&&!Array.isArray(e[0])?t[n]=[o(e[0])]:t[n]=[]:t[n]=null})),t}function r(e,t){return t.prototype.constructor=t,e.prototype=new t,e.prototype.constructor=e,e}function i(e,t){return g(t,function(t,n){e[n]=t}),e}function s(e,t){g(t,function(n,o){t[o]&&"object"==typeof t[o]?(e[o]||(Array.isArray(t[o])?e[o]=[]:e[o]={}),s(e[o],t[o])):e[o]=t[o]})}function l(e){return"object"==typeof e?JSON.parse(JSON.stringify(e)):e}function a(e){var t={};return g(e,function(e,n){return t[n]=e}),t}function u(e){for(var t=[],n=1;no;o++)n.prototype[t[o]]=void 0;return n}Object.defineProperties(n,{columnFactory:{get:function(){return o}},__esModule:{value:!0}});var r,i=(r=e("object"),r&&r.__esModule&&r||{"default":r}).inherit},{object:50}],52:[function(e,t,n){"use strict";function o(e){return e[0].toUpperCase()+e.substr(1)}function r(e,t){var n=!0;return h(t.length-1,function(o){return e.charAt(o)!==t.charAt(o)?(n=!1,!1):void 0}),n}function i(e,t){var n=!0,o=t.length-1,r=e.length-1;return h(o,function(i){var s=r-i,l=o-i;return e.charAt(s)!==t.charAt(l)?(n=!1,!1):void 0}),n}function s(){for(var e=[],t=0;t=48&&57>=e||e>=96&&111>=e||e>=186&&192>=e||e>=219&&222>=e||e>=226||e>=65&&90>=e}function r(e){var t=[u.ARROW_DOWN,u.ARROW_UP,u.ARROW_LEFT,u.ARROW_RIGHT,u.HOME,u.END,u.DELETE,u.BACKSPACE,u.F1,u.F2,u.F3,u.F4,u.F5,u.F6,u.F7,u.F8,u.F9,u.F10,u.F11,u.F12,u.TAB,u.PAGE_DOWN,u.PAGE_UP,u.ENTER,u.ESCAPE,u.SHIFT,u.CAPS_LOCK,u.ALT];return-1!==t.indexOf(e)}function i(e){return-1!==[u.CONTROL_LEFT,224,u.COMMAND_LEFT,u.COMMAND_RIGHT].indexOf(e)}function s(e,t){var n=t.split("|"),o=!1;return a(n,function(t){return e===u[t]?(o=!0,!1):void 0}),o}Object.defineProperties(n,{KEY_CODES:{get:function(){return u}},isPrintableChar:{get:function(){return o}},isMetaKey:{get:function(){return r}},isCtrlKey:{get:function(){return i}},isKey:{get:function(){return s}},__esModule:{value:!0}});var l,a=(l=e("array"),l&&l.__esModule&&l||{"default":l}).arrayEach,u={MOUSE_LEFT:1,MOUSE_RIGHT:3,MOUSE_MIDDLE:2,BACKSPACE:8,COMMA:188,INSERT:45,DELETE:46,END:35,ENTER:13,ESCAPE:27,CONTROL_LEFT:91,COMMAND_LEFT:17,COMMAND_RIGHT:93,ALT:18,HOME:36,PAGE_DOWN:34,PAGE_UP:33,PERIOD:190,SPACE:32,SHIFT:16,CAPS_LOCK:20,TAB:9,ARROW_RIGHT:39,ARROW_LEFT:37,ARROW_UP:38,ARROW_DOWN:40,F1:112,F2:113,F3:114,F4:115,F5:116,F6:117,F7:118,F8:119,F9:120,F10:121,F11:122,F12:123,A:65,X:88,C:67,V:86}},{array:42}],54:[function(e,t,n){"use strict";Object.defineProperties(n,{localHooks:{get:function(){return a}},__esModule:{value:!0}});var o,r,i=(o=e("helpers/array"),o&&o.__esModule&&o||{"default":o}).arrayEach,s=(r=e("helpers/object"),r&&r.__esModule&&r||{"default":r}).defineGetter,l="localHooks",a={_localHooks:Object.create(null),addLocalHook:function(e,t){this._localHooks[e]||(this._localHooks[e]=[]),this._localHooks[e].push(t)},runLocalHooks:function(e){for(var t=[],n=1;n=0?(t.skip=!0,!0):!1},has:function(e){var t=void 0!==arguments[1]?arguments[1]:null,n=this.getBucket(t);return void 0!==n[e]&&n[e].length?!0:!1},run:function(e,t,n,o,r,i,s,l){var a=this.globalBucket[t],u=-1,c=a?a.length:0;if(c)for(;++u=0},getRegistered:function(){return i}},{}),Handsontable.utils=Handsontable.utils||{},Handsontable.utils.Hooks=a},{"helpers/array":42,"helpers/object":50}],57:[function(e,t,n){"use strict";function o(e,t){e=c(e),Handsontable.plugins[e]=t,Handsontable.hooks.add("construct",function(){var n;d.has(this)||d.set(this,{}),n=d.get(this),n[e]||(n[e]=new t(this))}),Handsontable.hooks.add("afterDestroy",function(){if(d.has(this)){var e=d.get(this);u(e,function(e){return e.destroy()}),d["delete"](this)}})}function r(e,t){if("string"!=typeof t)throw Error('Only strings can be passed as "plugin" parameter');var n=c(t);if(d.has(e)&&d.get(e)[n])return d.get(e)[n]}function i(e){return d.has(e)?Object.keys(d.get(e)):[]}function s(e,t){var n=null;return d.has(e)&&u(d.get(e),function(e,o){e===t&&(n=o)}),n}Object.defineProperties(n,{registerPlugin:{get:function(){return o}},getPlugin:{get:function(){return r}},getRegistredPluginNames:{get:function(){return i}},getPluginName:{get:function(){return s}},__esModule:{value:!0}});var l,a,u=(l=e("helpers/object"),l&&l.__esModule&&l||{"default":l}).objectEach,c=(a=e("helpers/string"),a&&a.__esModule&&a||{"default":a}).toUpperCaseFirst,d=new WeakMap;Handsontable.plugins=Handsontable.plugins||{},Handsontable.plugins.utils=Handsontable.plugins.utils||{},Handsontable.plugins.registerPlugin=o},{"helpers/object":50,"helpers/string":52}],58:[function(e,t,n){"use strict";Object.defineProperties(n,{"default":{get:function(){return m}},__esModule:{value:!0}});var o,r,i,s=(o=e("helpers/object"),o&&o.__esModule&&o||{"default":o}),l=s.defineGetter,a=s.objectEach,u=(r=e("helpers/array"),r&&r.__esModule&&r||{"default":r}).arrayEach,c=(i=e("plugins"),i&&i.__esModule&&i||{"default":i}),d=c.getRegistredPluginNames,h=c.getPluginName,f=new WeakMap,g=null,p=function(e){var t=this;l(this,"hot",e,{writable:!1}),f.set(this,{hooks:{}}),g=null,this.pluginName=null,this.pluginsInitializedCallbacks=[],this.isPluginsReady=!1,this.enabled=!1,this.initialized=!1,this.hot.addHook("afterPluginsInitialized",function(){return t.onAfterPluginsInitialized()}),this.hot.addHook("afterUpdateSettings",function(){return t.onUpdateSettings()}),this.hot.addHook("beforeInit",function(){return t.init()})};$traceurRuntime.createClass(p,{init:function(){this.pluginName=h(this.hot,this),this.isEnabled&&this.isEnabled()&&this.enablePlugin(),g||(g=d(this.hot)),g.indexOf(this.pluginName)>=0&&g.splice(g.indexOf(this.pluginName),1),g.length||this.hot.runHooks("afterPluginsInitialized"),this.initialized=!0},enablePlugin:function(){this.enabled=!0},disablePlugin:function(){this.eventManager&&this.eventManager.clear(),this.clearHooks(),this.enabled=!1},addHook:function(e,t){var n=f.get(this).hooks[e]=f.get(this).hooks[e]||[];this.hot.addHook(e,t),n.push(t),f.get(this).hooks[e]=n},removeHooks:function(e){var t=this;u(f.get(this).hooks[e]||[],function(n){t.hot.removeHook(e,n)})},clearHooks:function(){var e=this,t=f.get(this).hooks;a(t,function(t,n){return e.removeHooks(n)}),t.length=0},callOnPluginsReady:function(e){this.isPluginsReady?e():this.pluginsInitializedCallbacks.push(e)},onAfterPluginsInitialized:function(){u(this.pluginsInitializedCallbacks,function(e){return e()}),this.pluginsInitializedCallbacks.length=0,this.isPluginsReady=!0},onUpdateSettings:function(){this.isEnabled&&(this.enabled&&!this.isEnabled()&&this.disablePlugin(),!this.enabled&&this.isEnabled()&&this.enablePlugin(),this.enabled&&this.isEnabled()&&this.updatePlugin())},updatePlugin:function(){},destroy:function(){var e=this;this.eventManager&&this.eventManager.destroy(),this.clearHooks(),a(this,function(t,n){"hot"!==n&&(e[n]=null)}),delete this.hot}},{});var m=p;Handsontable.plugins.BasePlugin=p},{"helpers/array":42,"helpers/object":50,plugins:57}],59:[function(e,t,n){"use strict";Object.defineProperties(n,{AutoColumnSize:{get:function(){return A}},__esModule:{value:!0}});var o,r,i,s,l,a,u,c,d,h,f=(o=e("_base"),o&&o.__esModule&&o||{"default":o})["default"],g=(r=e("helpers/array"),r&&r.__esModule&&r||{"default":r}),p=g.arrayEach,m=g.arrayFilter,w=(i=e("helpers/dom/element"),i&&i.__esModule&&i||{"default":i}),v=w.cancelAnimationFrame,b=w.requestAnimationFrame,C=w.isVisible,y=(s=e("utils/ghostTable"),s&&s.__esModule&&s||{"default":s}).GhostTable,R=(l=e("helpers/object"),l&&l.__esModule&&l||{"default":l}),E=R.isObject,S=(R.objectEach,a=e("helpers/number"),a&&a.__esModule&&a||{"default":a}),T=S.valueAccordingPercent,O=S.rangeEach,_=(u=e("plugins"),u&&u.__esModule&&u||{"default":u}).registerPlugin,M=(c=e("utils/samplesGenerator"),c&&c.__esModule&&c||{"default":c}).SamplesGenerator,H=(d=e("helpers/string"),d&&d.__esModule&&d||{"default":d}).isPercentValue,k=(h=e("3rdparty/walkontable/src/calculator/viewportColumns"),h&&h.__esModule&&h||{"default":h}).WalkontableViewportColumnsCalculator,A=function(e){var t=this;$traceurRuntime.superConstructor(P).call(this,e),this.widths=[],this.ghostTable=new y(this.hot),this.samplesGenerator=new M(function(e,n){return t.hot.getDataAtCell(e,n)}),this.firstCalculation=!0,this.inProgress=!1,this.addHook("beforeColumnResize",function(e,n,o){return t.onBeforeColumnResize(e,n,o)})},P=A;$traceurRuntime.createClass(A,{isEnabled:function(){return this.hot.getSettings().autoColumnSize!==!1&&!this.hot.getSettings().colWidths},enablePlugin:function(){var e=this;this.enabled||(this.addHook("afterLoadData",function(){return e.onAfterLoadData()}),this.addHook("beforeChange",function(t){return e.onBeforeChange(t)}),this.addHook("beforeRender",function(t){return e.onBeforeRender(t)}),this.addHook("modifyColWidth",function(t,n){return e.getColumnWidth(n,t)}),$traceurRuntime.superGet(this,P.prototype,"enablePlugin").call(this))},disablePlugin:function(){$traceurRuntime.superGet(this,P.prototype,"disablePlugin").call(this)},calculateColumnsWidth:function(){var e=void 0!==arguments[0]?arguments[0]:{from:0,to:this.hot.countCols()-1},t=void 0!==arguments[1]?arguments[1]:{from:0,to:this.hot.countRows()-1},n=void 0!==arguments[2]?arguments[2]:!1,o=this;"number"==typeof e&&(e={from:e,to:e}),"number"==typeof t&&(t={from:t,to:t}),O(e.from,e.to,function(e){if(n||void 0===o.widths[e]&&!o.hot._getColWidthFromSettings(e)){var r=o.samplesGenerator.generateColumnSamples(e,t);r.forEach(function(e,t){return o.ghostTable.addColumn(t,e)})}}),this.ghostTable.columns.length&&(this.ghostTable.getWidths(function(e,t){return o.widths[e]=t}),this.ghostTable.clean())},calculateAllColumnsWidth:function(){var e=void 0!==arguments[0]?arguments[0]:{from:0,to:this.hot.countRows()-1},t=this,n=0,o=this.hot.countCols()-1,r=null;this.inProgress=!0;var i=function(){return t.hot?(t.calculateColumnsWidth({from:n,to:Math.min(n+P.CALCULATION_STEP,o)},e),n=n+P.CALCULATION_STEP+1,void(o>n?r=b(i):(v(r),t.inProgress=!1,t.hot.view.wt.wtOverlays.adjustElementsSize(!0),t.hot.view.wt.wtOverlays.leftOverlay.needFullRender&&t.hot.view.wt.wtOverlays.leftOverlay.clone.draw()))):(v(r),void(t.inProgress=!1))};this.firstCalculation&&this.getSyncCalculationLimit()&&(this.calculateColumnsWidth({from:0,to:this.getSyncCalculationLimit()},e),this.firstCalculation=!1,n=this.getSyncCalculationLimit()+1),o>n?i():this.inProgress=!1},recalculateAllColumnsWidth:function(){this.hot.view&&C(this.hot.view.wt.wtTable.TABLE)&&(this.clearCache(),this.calculateAllColumnsWidth())},getSyncCalculationLimit:function(){var e=P.SYNC_CALCULATION_LIMIT,t=this.hot.countCols()-1;return E(this.hot.getSettings().autoColumnSize)&&(e=this.hot.getSettings().autoColumnSize.syncLimit,H(e)?e=T(t,e):e>>=0),Math.min(e,t)},getColumnWidth:function(e){var t=arguments[1],n=void 0!==arguments[2]?arguments[2]:!0,o=t;return void 0===o&&(o=this.widths[e],n&&"number"==typeof o&&(o=Math.max(o,k.DEFAULT_WIDTH))),o},getFirstVisibleColumn:function(){var e=this.hot.view.wt;return e.wtViewport.columnsVisibleCalculator?e.wtTable.getFirstVisibleColumn():e.wtViewport.columnsRenderCalculator?e.wtTable.getFirstRenderedColumn():-1},getLastVisibleColumn:function(){var e=this.hot.view.wt;return e.wtViewport.columnsVisibleCalculator?e.wtTable.getLastVisibleColumn():e.wtViewport.columnsRenderCalculator?e.wtTable.getLastRenderedColumn():-1},clearCache:function(){this.widths.length=0},isNeedRecalculate:function(){return m(this.widths,function(e){return void 0===e}).length?!0:!1},onBeforeRender:function(){var e=this.hot.renderCall;this.calculateColumnsWidth({from:this.getFirstVisibleColumn(),to:this.getLastVisibleColumn()},void 0,e),this.isNeedRecalculate()&&!this.inProgress&&this.calculateAllColumnsWidth()},onAfterLoadData:function(){var e=this;this.hot.view?this.recalculateAllColumnsWidth():setTimeout(function(){e.hot&&e.recalculateAllColumnsWidth()},0)},onBeforeChange:function(e){var t=this;p(e,function(e){return t.widths[e[1]]=void 0})},onBeforeColumnResize:function(e,t,n){return n&&(this.calculateColumnsWidth(e,void 0,!0),t=this.getColumnWidth(e,void 0,!1)),t},destroy:function(){this.ghostTable.clean(),$traceurRuntime.superGet(this,P.prototype,"destroy").call(this)}},{get CALCULATION_STEP(){return 50},get SYNC_CALCULATION_LIMIT(){return 50}},f),_("autoColumnSize",A)},{"3rdparty/walkontable/src/calculator/viewportColumns":3,_base:58,"helpers/array":42,"helpers/dom/element":45,"helpers/number":49,"helpers/object":50,"helpers/string":52,plugins:57,"utils/ghostTable":98,"utils/samplesGenerator":99}],60:[function(e,t,n){"use strict";Object.defineProperties(n,{AutoRowSize:{get:function(){return M}},__esModule:{value:!0}});var o,r,i,s,l,a,u,c,d,h=(o=e("_base"),o&&o.__esModule&&o||{"default":o})["default"],f=(r=e("helpers/array"),r&&r.__esModule&&r||{"default":r}),g=(f.arrayEach,f.arrayFilter),p=(i=e("helpers/dom/element"),i&&i.__esModule&&i||{"default":i}),m=p.cancelAnimationFrame,w=p.requestAnimationFrame,v=p.isVisible,b=(s=e("utils/ghostTable"),s&&s.__esModule&&s||{"default":s}).GhostTable,C=(l=e("helpers/object"),l&&l.__esModule&&l||{"default":l}),y=C.isObject,R=(C.objectEach,a=e("helpers/number"),a&&a.__esModule&&a||{"default":a}),E=R.valueAccordingPercent,S=R.rangeEach,T=(u=e("plugins"),u&&u.__esModule&&u||{"default":u}).registerPlugin,O=(c=e("utils/samplesGenerator"),c&&c.__esModule&&c||{"default":c}).SamplesGenerator,_=(d=e("helpers/string"),d&&d.__esModule&&d||{"default":d}).isPercentValue,M=function(e){var t=this;$traceurRuntime.superConstructor(H).call(this,e),this.heights=[],this.ghostTable=new b(this.hot),this.samplesGenerator=new O(function(e,n){return t.hot.getDataAtCell(e,n)}),this.firstCalculation=!0,this.inProgress=!1,this.addHook("beforeRowResize",function(e,n,o){return t.onBeforeRowResize(e,n,o)})},H=M;$traceurRuntime.createClass(M,{isEnabled:function(){return this.hot.getSettings().autoRowSize===!0||y(this.hot.getSettings().autoRowSize)},enablePlugin:function(){var e=this;this.enabled||(this.addHook("afterLoadData",function(){return e.onAfterLoadData()}),this.addHook("beforeChange",function(t){return e.onBeforeChange(t)}),this.addHook("beforeColumnMove",function(){return e.recalculateAllRowsHeight()}),this.addHook("beforeColumnResize",function(){return e.recalculateAllRowsHeight()}),this.addHook("beforeColumnSort",function(){return e.clearCache()}),this.addHook("beforeRender",function(t){return e.onBeforeRender(t)}),this.addHook("beforeRowMove",function(t,n){return e.onBeforeRowMove(t,n)}),this.addHook("modifyRowHeight",function(t,n){return e.getRowHeight(n,t)}),$traceurRuntime.superGet(this,H.prototype,"enablePlugin").call(this))},disablePlugin:function(){$traceurRuntime.superGet(this,H.prototype,"disablePlugin").call(this)},calculateRowsHeight:function(){var e=void 0!==arguments[0]?arguments[0]:{from:0,to:this.hot.countRows()-1},t=void 0!==arguments[1]?arguments[1]:{from:0,to:this.hot.countCols()-1},n=void 0!==arguments[2]?arguments[2]:!1,o=this;"number"==typeof e&&(e={from:e,to:e}),"number"==typeof t&&(t={from:t,to:t}),S(e.from,e.to,function(e){if(n||void 0===o.heights[e]){var r=o.samplesGenerator.generateRowSamples(e,t);r.forEach(function(e,t){return o.ghostTable.addRow(t,e)})}}),this.ghostTable.rows.length&&(this.ghostTable.getHeights(function(e,t){return o.heights[e]=t}),this.ghostTable.clean())},calculateAllRowsHeight:function(){var e=void 0!==arguments[0]?arguments[0]:{from:0,to:this.hot.countCols()-1},t=this,n=0,o=this.hot.countRows()-1,r=null;this.inProgress=!0;var i=function(){return t.hot?(t.calculateRowsHeight({from:n, -to:Math.min(n+H.CALCULATION_STEP,o)},e),n=n+H.CALCULATION_STEP+1,void(o>n?r=w(i):(m(r),t.inProgress=!1,t.hot.view.wt.wtOverlays.adjustElementsSize(!0),t.hot.view.wt.wtOverlays.leftOverlay.needFullRender&&t.hot.view.wt.wtOverlays.leftOverlay.clone.draw()))):(m(r),void(t.inProgress=!1))};this.firstCalculation&&this.getSyncCalculationLimit()&&(this.calculateRowsHeight({from:0,to:this.getSyncCalculationLimit()},e),this.firstCalculation=!1,n=this.getSyncCalculationLimit()+1),o>n?i():this.inProgress=!1},recalculateAllRowsHeight:function(){v(this.hot.view.wt.wtTable.TABLE)&&(this.clearCache(),this.calculateAllRowsHeight())},getSyncCalculationLimit:function(){var e=H.SYNC_CALCULATION_LIMIT,t=this.hot.countRows()-1;return y(this.hot.getSettings().autoRowSize)&&(e=this.hot.getSettings().autoRowSize.syncLimit,_(e)?e=E(t,e):e>>=0),Math.min(e,t)},getRowHeight:function(e){var t=arguments[1],n=t;return void 0!==this.heights[e]&&this.heights[e]>(t||0)&&(n=this.heights[e]),n},getFirstVisibleRow:function(){var e=this.hot.view.wt;return e.wtViewport.rowsVisibleCalculator?e.wtTable.getFirstVisibleRow():e.wtViewport.rowsRenderCalculator?e.wtTable.getFirstRenderedRow():-1},getLastVisibleRow:function(){var e=this.hot.view.wt;return e.wtViewport.rowsVisibleCalculator?e.wtTable.getLastVisibleRow():e.wtViewport.rowsRenderCalculator?e.wtTable.getLastRenderedRow():-1},clearCache:function(){this.heights.length=0},clearCacheByRange:function(e){var t=this;"number"==typeof e&&(e={from:e,to:e}),S(Math.min(e.from,e.to),Math.max(e.from,e.to),function(e){return t.heights[e]=void 0})},isNeedRecalculate:function(){return g(this.heights,function(e){return void 0===e}).length?!0:!1},onBeforeRender:function(){var e=this.hot.renderCall;this.calculateRowsHeight({from:this.getFirstVisibleRow(),to:this.getLastVisibleRow()},void 0,e),this.isNeedRecalculate()&&!this.inProgress&&this.calculateAllRowsHeight()},onBeforeRowMove:function(e,t){this.clearCacheByRange({from:e,to:t}),this.calculateAllRowsHeight()},onBeforeRowResize:function(e,t,n){return n&&(this.calculateRowsHeight(e,void 0,!0),t=this.getRowHeight(e)),t},onAfterLoadData:function(){var e=this;this.hot.view?this.recalculateAllRowsHeight():setTimeout(function(){e.hot&&e.recalculateAllRowsHeight()},0)},onBeforeChange:function(e){var t=null;1===e.length?t=e[0][0]:e.length>1&&(t={from:e[0][0],to:e[e.length-1][0]}),null!==t&&this.clearCacheByRange(t)},destroy:function(){this.ghostTable.clean(),$traceurRuntime.superGet(this,H.prototype,"destroy").call(this)}},{get CALCULATION_STEP(){return 50},get SYNC_CALCULATION_LIMIT(){return 500}},h),T("autoRowSize",M)},{_base:58,"helpers/array":42,"helpers/dom/element":45,"helpers/number":49,"helpers/object":50,"helpers/string":52,plugins:57,"utils/ghostTable":98,"utils/samplesGenerator":99}],61:[function(e,t,n){"use strict";function o(e,t,n,o){var r,i,s,l,a,u=n.length,c=n?n[0].length:0,d=[],h=[];if(r=t.row-e.row,i=t.col-e.col,-1!==["down","up"].indexOf(o)){for(var f=0;i>=f;f++)s=parseInt(n[0][f],10),l=parseInt(n[u-1][f],10),a=("down"===o?l-s:s-l)/(u-1)||0,h.push(a);d.push(h)}if(-1!==["right","left"].indexOf(o))for(var g=0;r>=g;g++)s=parseInt(n[g][0],10),l=parseInt(n[g][c-1],10),a=("right"===o?l-s:s-l)/(c-1)||0,h=[],h.push(a),d.push(h);return d}function r(e){function t(t){return e.autofill?void(e.autofill.handle&&e.autofill.handle.isDragged&&(e.autofill.handle.isDragged>1&&e.autofill.apply(),e.autofill.handle.isDragged=0,l=!1)):!0}function n(e){var t,n;return s.instance.autofill?(t=c(s.instance.table).top-(window.pageYOffset||document.documentElement.scrollTop)+d(s.instance.table),n=c(s.instance.table).left-(window.pageXOffset||document.documentElement.scrollLeft)+h(s.instance.table),s.addingStarted===!1&&s.instance.autofill.handle.isDragged>0&&e.clientY>t&&e.clientX<=n?(s.instance.mouseDragOutside=!0,s.addingStarted=!0):s.instance.mouseDragOutside=!1,void(s.instance.mouseDragOutside&&setTimeout(function(){s.addingStarted=!1,s.instance.alter("insert_row")},200))):!1}var o,r,i,s=this,l=!1;this.instance=e,this.addingStarted=!1,i=f(e),i.addEventListener(document,"mouseup",t),i.addEventListener(document,"mousemove",n),o=this.instance.view.wt.wtSettings.settings.onCellCornerMouseDown,this.instance.view.wt.wtSettings.settings.onCellCornerMouseDown=function(t){e.autofill.handle.isDragged=1,l=!0,o(t)},r=this.instance.view.wt.wtSettings.settings.onCellMouseOver,this.instance.view.wt.wtSettings.settings.onCellMouseOver=function(t,n,o,i){e.autofill&&l&&!e.view.isMouseDown()&&e.autofill.handle&&e.autofill.handle.isDragged&&(e.autofill.handle.isDragged++,e.autofill.showBorder(n),e.autofill.checkIfNewRowNeeded()),r(t,n,o,i)},this.instance.view.wt.wtSettings.settings.onCellCornerDblClick=function(){e.autofill.selectAdjacent()}}Object.defineProperties(n,{Autofill:{get:function(){return r}},__esModule:{value:!0}});var i,s,l,a,u=(i=e("helpers/dom/element"),i&&i.__esModule&&i||{"default":i}),c=u.offset,d=u.outerHeight,h=u.outerWidth,f=(s=e("eventManager"),s&&s.__esModule&&s||{"default":s}).eventManager,g=((l=e("plugins"),l&&l.__esModule&&l||{"default":l}).registerPlugin,(a=e("3rdparty/walkontable/src/cell/coords"),a&&a.__esModule&&a||{"default":a}).WalkontableCellCoords);r.prototype.init=function(){this.handle={}},r.prototype.disable=function(){this.handle.disabled=!0},r.prototype.selectAdjacent=function(){var e,t,n,o,r;e=this.instance.selection.isMultiple()?this.instance.view.wt.selections.area.getCorners():this.instance.view.wt.selections.current.getCorners(),t=this.instance.getData();e:for(n=e[2]+1;nt[3]?(s="right",n=new g(e[0],t[3]+1),r=new g(e[2],e[3])):e[0]t[2]&&e[1]===t[1]&&(s="down",n=new g(t[2]+1,e[1]),r=new g(e[2],e[3])),n&&n.row>-1&&n.col>-1?(a={from:this.instance.getSelectedRange().from,to:this.instance.getSelectedRange().to},i=this.instance.getData(a.from.row,a.from.col,a.to.row,a.to.col),l=o(n,r,i,s),Handsontable.hooks.run(this.instance,"beforeAutofill",n,r,i),this.instance.populateFromArray(n.row,n.col,i,r.row,r.col,"autofill",null,s,l),this.instance.selection.setRangeStart(new g(e[0],e[1])),this.instance.selection.setRangeEnd(new g(e[2],e[3]))):this.instance.selection.refreshBorders())},r.prototype.showBorder=function(e){var t=this.instance.getSelectedRange().getTopLeftCorner(),n=this.instance.getSelectedRange().getBottomRightCorner();if("horizontal"!==this.instance.getSettings().fillHandle&&(n.rowe.row))e=new g(e.row,n.col);else{if("vertical"===this.instance.getSettings().fillHandle)return;e=new g(n.row,e.col)}this.instance.view.wt.selections.fill.clear(),this.instance.view.wt.selections.fill.add(this.instance.getSelectedRange().from),this.instance.view.wt.selections.fill.add(this.instance.getSelectedRange().to),this.instance.view.wt.selections.fill.add(e),this.instance.view.render()},r.prototype.checkIfNewRowNeeded=function(){var e,t,n=this.instance.countRows(),o=this;this.instance.view.wt.selections.fill.cellRange&&this.addingStarted===!1&&(t=this.instance.getSelected(),e=this.instance.view.wt.selections.fill.getCorners(),t[2]n[1]?e?1:-1:0}},dateSort:function(e){return function(t,n){if(t[1]===n[1])return 0;if(null===t[1]||""===t[1])return 1;if(null===n[1]||""===n[1])return-1;var o=new Date(t[1]),r=new Date(n[1]);return r>o?e?-1:1:o>r?e?1:-1:0}},sort:function(){if("undefined"==typeof this.hot.sortOrder)return void(this.hot.sortIndex.length=0);var e,t;this.hot.sortingEnabled=!1,this.hot.sortIndex.length=0;for(var n=this.hot.colOffset(),o=0,r=this.hot.countRows()-this.hot.getSettings().minSpareRows;r>o;o++)this.hot.sortIndex.push([o,this.hot.getDataAtCell(o,this.hot.sortColumn+n)]);switch(e=this.hot.getCellMeta(0,this.hot.sortColumn),this.sortIndicators[this.hot.sortColumn]=e.sortIndicator,e.type){case"date":t=this.dateSort;break;default:t=this.defaultSort}this.hot.sortIndex.sort(t(this.hot.sortOrder));for(var o=this.hot.sortIndex.length;o=0&&-1===r&&u(n,"columnSorting"),f(n,"descending"),f(n,"ascending"),this.sortIndicators[e]&&e===this.hot.sortColumn&&("ascending"===this.sortOrderClass?u(n,"ascending"):"descending"===this.sortOrderClass&&u(n,"descending")))},isSorted:function(){return"undefined"!=typeof this.hot.sortColumn},afterCreateRow:function(e,t){if(this.isSorted()){for(var n=0;n=e&&(this.hot.sortIndex[n][0]+=t);for(var n=0;t>n;n++)this.hot.sortIndex.splice(e+n,0,[e+n,this.hot.getSourceData()[e+n][this.hot.sortColumn+this.hot.colOffset()]]);this.saveSortingState()}},afterRemoveRow:function(e,t){function n(e){return m(o,function(t,n){return e>n&&t++,t},0)}if(this.isSorted()){var o=this.hot.sortIndex.splice(e,t);o=p(o,function(e){return e[0]}),this.hot.sortIndex=p(this.hot.sortIndex,function(e,t){var o=n(e[0]);return o&&(e[0]-=o),e}),this.saveSortingState()}}},{},v),b("columnSorting",C)},{_base:58,eventManager:41,"helpers/array":42,"helpers/dom/element":45,plugins:57}],63:[function(e,t,n){"use strict";Object.defineProperties(n,{CommentEditor:{get:function(){return i}},__esModule:{value:!0}});var o,r=(o=e("helpers/dom/element"),o&&o.__esModule&&o||{"default":o}).addClass,i=function(){this.editor=this.createEditor(),this.editorStyle=this.editor.style,this.editorStyle.position="absolute",this.editorStyle.zIndex=100,this.hide()},s=i;$traceurRuntime.createClass(i,{setPosition:function(e,t){this.editorStyle.left=e+"px",this.editorStyle.top=t+"px"},show:function(){this.editorStyle.display="block"},hide:function(){this.editorStyle.display="none"},isVisible:function(){return"block"===this.editorStyle.display},setValue:function(){var e=void 0!==arguments[0]?arguments[0]:"";e=e||"",this.getInputElement().value=e},getValue:function(){return this.getInputElement().value},isFocused:function(){return document.activeElement===this.getInputElement()},focus:function(){this.getInputElement().focus()},createEditor:function(){var e,t,n=document.querySelector("."+s.CLASS_EDITOR_CONTAINER);return n||(n=document.createElement("div"),r(n,s.CLASS_EDITOR_CONTAINER),document.body.appendChild(n)),e=document.createElement("div"),r(e,s.CLASS_EDITOR),t=document.createElement("textarea"),r(t,s.CLASS_INPUT),e.appendChild(t),n.appendChild(e),e},getInputElement:function(){return this.editor.querySelector("."+s.CLASS_INPUT)},destroy:function(){this.editor.parentNode.removeChild(this.editor),this.editor=null,this.editorStyle=null}},{get CLASS_EDITOR_CONTAINER(){return"htCommentsContainer"},get CLASS_EDITOR(){return"htComments"},get CLASS_INPUT(){return"htCommentTextArea"},get CLASS_CELL(){return"htCommentCell"}})},{"helpers/dom/element":45}],64:[function(e,t,n){"use strict";Object.defineProperties(n,{Comments:{get:function(){return R}},__esModule:{value:!0}});var o,r,i,s,l,a,u=(o=e("helpers/dom/element"),o&&o.__esModule&&o||{"default":o}),c=u.addClass,d=u.closest,h=u.getWindowScrollLeft,f=u.getWindowScrollTop,g=u.hasClass,p=u.offset,m=(r=e("eventManager"),r&&r.__esModule&&r||{"default":r}).EventManager,w=(i=e("3rdparty/walkontable/src/cell/coords"),i&&i.__esModule&&i||{"default":i}).WalkontableCellCoords,v=(s=e("plugins"),s&&s.__esModule&&s||{"default":s}),b=v.registerPlugin,C=(v.getPlugin,(l=e("_base"),l&&l.__esModule&&l||{"default":l})["default"]),y=(a=e("commentEditor"),a&&a.__esModule&&a||{"default":a}).CommentEditor,R=function(e){$traceurRuntime.superConstructor(E).call(this,e),this.editor=null,this.eventManager=null,this.range={},this.mouseDown=!1,this.contextMenuEvent=!1,this.timer=null},E=R;$traceurRuntime.createClass(R,{isEnabled:function(){return this.hot.getSettings().comments},enablePlugin:function(){var e=this;this.enabled||(this.editor||(this.editor=new y),this.eventManager||(this.eventManager=new m(this)),this.addHook("afterContextMenuDefaultOptions",function(t){return e.addToContextMenu(t)}),this.addHook("afterRenderer",function(t,n,o,r,i,s){return e.onAfterRenderer(t,s)}),this.addHook("afterScrollVertically",function(){return e.refreshEditorPosition()}),this.addHook("afterColumnResize",function(){return e.refreshEditorPosition()}),this.addHook("afterRowResize",function(){return e.refreshEditorPosition()}),this.registerListeners(),$traceurRuntime.superGet(this,E.prototype,"enablePlugin").call(this))},disablePlugin:function(){$traceurRuntime.superGet(this,E.prototype,"disablePlugin").call(this)},registerListeners:function(){var e=this;this.eventManager.addEventListener(document,"mouseover",function(t){return e.onMouseOver(t)}),this.eventManager.addEventListener(document,"mousedown",function(t){return e.onMouseDown(t)}),this.eventManager.addEventListener(document,"mousemove",function(t){return e.onMouseMove(t)}),this.eventManager.addEventListener(document,"mouseup",function(t){return e.onMouseUp(t)}),this.eventManager.addEventListener(this.editor.getInputElement(),"blur",function(t){return e.onEditorBlur(t)})},setRange:function(e){this.range=e},clearRange:function(){this.range={}},targetIsCellWithComment:function(e){return g(e.target,"htCommentCell")&&d(e.target,[this.hot.rootElement])?!0:!1},targetIsCommentTextArea:function(e){return this.editor.getInputElement()===e.target},saveComment:function(){if(!this.range.from)throw new Error('Before using this method, first set cell range (hot.getPlugin("comment").setRange())');var e=this.editor.getValue(),t=this.range.from.row,n=this.range.from.col;this.hot.setCellMeta(t,n,"comment",e),this.hot.render()},saveCommentAtCell:function(e,t){this.setRange({from:new w(e,t)}),this.saveComment()},removeComment:function(){if(!this.range.from)throw new Error('Before using this method, first set cell range (hot.getPlugin("comment").setRange())');this.hot.removeCellMeta(this.range.from.row,this.range.from.col,"comment"),this.hot.render(),this.hide()},removeCommentAtCell:function(e,t){this.setRange({from:new w(e,t)}),this.removeComment()},show:function(){if(!this.range.from)throw new Error('Before using this method, first set cell range (hot.getPlugin("comment").setRange())');var e=this.hot.getCellMeta(this.range.from.row,this.range.from.col);return this.refreshEditorPosition(!0),this.editor.setValue(e.comment||""),this.editor.show(),!0},showAtCell:function(e,t){return this.setRange({from:new w(e,t)}),this.show()},hide:function(){this.editor.hide()},refreshEditorPosition:function(){var e=void 0!==arguments[0]?arguments[0]:!1;if(e||this.range.from&&this.editor.isVisible()){var t=this.hot.view.wt.wtTable.getCell(this.range.from),n=p(t),o=this.hot.getColWidth(this.range.from.col),r=n.top,i=n.left,s=0,l=0;this.hot.view.wt.wtViewport.hasVerticalScroll()&&(r-=this.hot.view.wt.wtOverlays.topOverlay.getScrollPosition(),s=20),this.hot.view.wt.wtViewport.hasHorizontalScroll()&&(i-=this.hot.view.wt.wtOverlays.leftOverlay.getScrollPosition(),l=20);var a=i+o,u=r,c=this.hot.view.wt.wtTable.holder.getBoundingClientRect(),d={left:c.left+h()+l,right:c.right+h()-15,top:c.top+f()+s,bottom:c.bottom+f()};a<=d.left||a>d.right||u<=d.top||u>d.bottom?this.hide():this.editor.setPosition(a,u)}},onMouseDown:function(e){this.mouseDown=!0,this.hot.view&&this.hot.view.wt&&(this.contextMenuEvent||this.targetIsCommentTextArea(e)||this.targetIsCellWithComment(e)||this.hide(),this.contextMenuEvent=!1)},onMouseOver:function(e){if(!this.mouseDown&&!this.editor.isFocused())if(this.targetIsCellWithComment(e)){var t=this.hot.view.wt.wtTable.getCoords(e.target),n={from:new w(t.row,t.col)};this.setRange(n),this.show()}else this.targetIsCommentTextArea(e)||this.editor.isFocused()||this.hide()},onMouseMove:function(e){var t=this;this.targetIsCommentTextArea(e)&&(this.mouseDown=!0,clearTimeout(this.timer),this.timer=setTimeout(function(){t.mouseDown=!1},200))},onMouseUp:function(e){this.mouseDown=!1},onAfterRenderer:function(e,t){t.comment&&c(e,t.commentedCellClassName)},onEditorBlur:function(e){this.saveComment()},checkSelectionCommentsConsistency:function(){var e=this.hot.getSelectedRange();if(!e)return!1;var t=!1,n=e.from;return this.hot.getCellMeta(n.row,n.col).comment&&(t=!0),t},onContextMenuAddComment:function(){var e=this,t=this.hot.getSelectedRange();this.contextMenuEvent=!0,this.setRange({from:t.from}),this.show(),setTimeout(function(){e.hot&&(e.hot.deselectCell(),e.editor.focus())},10)},onContextMenuRemoveComment:function(e,t){this.contextMenuEvent=!0,this.removeCommentAtCell(t.start.row,t.start.col)},addToContextMenu:function(e){var t=this;e.items.push(Handsontable.plugins.ContextMenu.SEPARATOR,{key:"commentsAddEdit",name:function(){return t.checkSelectionCommentsConsistency()?"Edit Comment":"Add Comment"},callback:function(){return t.onContextMenuAddComment()},disabled:function(){return this.getSelected()?!1:!0}},{key:"commentsRemove",name:function(){return"Delete Comment"},callback:function(e,n){return t.onContextMenuRemoveComment(e,n)},disabled:function(){return!t.checkSelectionCommentsConsistency()}})},destroy:function(){this.editor&&this.editor.destroy(),$traceurRuntime.superGet(this,E.prototype,"destroy").call(this)}},{},C),b("comments",R)},{"3rdparty/walkontable/src/cell/coords":5,_base:58,commentEditor:63,eventManager:41,"helpers/dom/element":45,plugins:57}],65:[function(e,t,n){"use strict";function o(e,t){var n;return i(t,function(t){var o=t.key?t.key.split(":"):null;return Array.isArray(o)&&o[1]===e?(n=t,!1):void 0}),n}Object.defineProperties(n,{CommandExecutor:{get:function(){return s}},__esModule:{value:!0}});var r,i=(r=e("helpers/array"),r&&r.__esModule&&r||{"default":r}).arrayEach,s=function(e){this.hot=e,this.commands={},this.commonCallback=null};$traceurRuntime.createClass(s,{registerCommand:function(e,t){this.commands[e]=t},setCommonCallback:function(e){this.commonCallback=e},execute:function(e){for(var t=[],n=1;n0;if(s)return}}else if(!(t(i)||v(i,"current")&&v(i,"wtBorder")))return;this.open(e)},onMenuAfterOpen:function(){this.hot.runHooks("afterContextMenuShow",this)},onMenuAfterClose:function(){this.hot.listen(),this.hot.runHooks("afterContextMenuHide",this)},destroy:function(){this.close(),this.menu&&this.menu.destroy(),$traceurRuntime.superGet(this,W.prototype,"destroy").call(this)}},{get DEFAULT_ITEMS(){return[T,O,N,_,M,N,H,k,N,A,P,N,x,N,D]}},g),L.SEPARATOR={name:N},Handsontable.hooks.register("afterContextMenuDefaultOptions"),Handsontable.hooks.register("afterContextMenuShow"),Handsontable.hooks.register("afterContextMenuHide"),Handsontable.hooks.register("afterContextMenuExecute"),R("contextMenu",L)},{_base:58,commandExecutor:65,eventManager:41,"helpers/array":42,"helpers/dom/element":45,"helpers/dom/event":46,"helpers/object":50,itemsFactory:68,menu:69,plugins:57,predefinedItems:70}],67:[function(e,t,n){"use strict";Object.defineProperties(n,{Cursor:{get:function(){return d}},__esModule:{value:!0}});var o,r,i=(o=e("helpers/dom/element"),o&&o.__esModule&&o||{"default":o}),s=i.getWindowScrollLeft,l=i.getWindowScrollTop,a=(r=e("helpers/dom/event"),r&&r.__esModule&&r||{"default":r}),u=a.pageX,c=a.pageY,d=function(e){var t,n,o,r,i,a,d,h,f=l(),g=s();this.type=this.getSourceType(e),"literal"===this.type?(t=parseInt(e.top,10),o=parseInt(e.left,10),d=e.height,h=e.width):"event"===this.type&&(t=parseInt(c(e),10),o=parseInt(u(e),10),d=e.target.clientHeight,h=e.target.clientWidth),n=t-f,r=o-g,i=f,a=g,this.top=t,this.topRelative=n,this.left=o,this.leftRelative=r,this.scrollTop=i,this.scrollLeft=a,this.cellHeight=d,this.cellWidth=h};$traceurRuntime.createClass(d,{getSourceType:function(e){var t="literal";return e instanceof Event&&(t="event"),t},fitsAbove:function(e){return this.topRelative>=e.offsetHeight},fitsBelow:function(e){var t=void 0!==arguments[1]?arguments[1]:window.innerHeight;return this.topRelative+e.offsetHeight<=t},fitsOnRight:function(e){var t=void 0!==arguments[1]?arguments[1]:window.innerWidth;return this.leftRelative+this.cellWidth+e.offsetWidth<=t},fitsOnLeft:function(e){return this.leftRelative>=e.offsetWidth}},{}),Handsontable.plugins.utils=Handsontable.plugins.utils||{},Handsontable.plugins.utils.Cursor=d},{"helpers/dom/element":45,"helpers/dom/event":46}],68:[function(e,t,n){"use strict";function o(){var e=void 0!==arguments[0]?arguments[0]:null,t=void 0!==arguments[1]?arguments[1]:[],n=void 0!==arguments[2]?arguments[2]:{},o=[];return e&&e.items?e=e.items:Array.isArray(e)||(e=t),u(e)?a(e,function(e,t){var r=n["string"==typeof e?e:t];r||(r=e),u(e)?c(r,e):"string"==typeof r&&(r={name:r}),void 0===r.key&&(r.key=t),o.push(r)}):d(e,function(e,t){var r=n[e];!r&&g.indexOf(e)>=0||(r||(r={name:e,key:t+""}),u(e)&&c(r,e),void 0===r.key&&(r.key=t),o.push(r))}),o[0].name===f&&o.shift(),o}Object.defineProperties(n,{ItemsFactory:{get:function(){return m}},__esModule:{value:!0}});var r,i,s,l=(r=e("helpers/object"),r&&r.__esModule&&r||{"default":r}),a=l.objectEach,u=l.isObject,c=l.extend,d=(i=e("helpers/array"),i&&i.__esModule&&i||{"default":i}).arrayEach,h=(s=e("predefinedItems"),s&&s.__esModule&&s||{"default":s}),f=h.SEPARATOR,g=h.ITEMS,p=h.predefinedItems,m=function(e){var t=void 0!==arguments[1]?arguments[1]:null;this.hot=e,this.predefinedItems=p(),this.defaultOrderPattern=t};$traceurRuntime.createClass(m,{setPredefinedItems:function(e){var t=this,n={};this.defaultOrderPattern.length=0,a(e,function(e,o){var r="";e.name===f?(n[f]=e,r=f):isNaN(parseInt(o,10))?(e.key=void 0===e.key?o:e.key,n[o]=e,r=e.key):(n[e.key]=e,r=e.key),t.defaultOrderPattern.push(r)}),this.predefinedItems=n},getVisibleItems:function(){var e=void 0!==arguments[0]?arguments[0]:null,t=this,n={};return a(this.predefinedItems,function(e,o){(!e.hidden||e.hidden&&!e.hidden.apply(t.hot))&&(n[o]=e)}),o(e,this.defaultOrderPattern,n)},getItems:function(){ -var e=void 0!==arguments[0]?arguments[0]:null;return o(e,this.defaultOrderPattern,this.predefinedItems)}},{})},{"helpers/array":42,"helpers/object":50,predefinedItems:70}],69:[function(e,t,n){"use strict";Object.defineProperties(n,{Menu:{get:function(){return W}},__esModule:{value:!0}});var o,r,i,s,l,a,u,c,d,h,f=(o=e("helpers/dom/element"),o&&o.__esModule&&o||{"default":o}),g=f.addClass,p=f.empty,m=f.fastInnerHTML,w=(f.getComputedStyle,f.getScrollbarWidth),v=(f.getWindowScrollLeft,f.getWindowScrollTop,f.hasClass,f.isChildOf),b=f.removeClass,C=(r=e("helpers/array"),r&&r.__esModule&&r||{"default":r}).arrayEach,y=(i=e("cursor"),i&&i.__esModule&&i||{"default":i}).Cursor,R=(s=e("eventManager"),s&&s.__esModule&&s||{"default":s}).EventManager,E=(l=e("helpers/object"),l&&l.__esModule&&l||{"default":l}),S=(E.extend,E.isObject,E.objectEach,E.mixin),T=(a=e("utils"),a&&a.__esModule&&a||{"default":a}),O=T.isSeparator,_=T.isDisabled,M=T.isSelectionDisabled,H=T.hasSubMenu,k=T.normalizeSelection,A=(u=e("helpers/unicode"),u&&u.__esModule&&u||{"default":u}).KEY_CODES,P=(c=e("mixins/localHooks"),c&&c.__esModule&&c||{"default":c}).localHooks,x=(d=e("predefinedItems"),d&&d.__esModule&&d||{"default":d}),D=x.SEPARATOR,N=(x.predefinedItems,h=e("helpers/dom/event"),h&&h.__esModule&&h||{"default":h}),L=(N.stopPropagation,N.stopImmediatePropagation),W=(N.pageX,N.pageY,function(e){var t=void 0!==arguments[1]?arguments[1]:{parent:null,name:null,className:"",keepInViewport:!0};this.hot=e,this.options=t,this.eventManager=new R(this),this.container=this.createContainer(this.options.name),this.hotMenu=null,this.hotSubMenus={},this.parentMenu=this.options.parent||null,this.menuItems=null,this.origOutsideClickDeselects=null,this._afterScrollCallback=null,this.registerEvents()}),I=W;$traceurRuntime.createClass(W,{registerEvents:function(){var e=this;this.eventManager.addEventListener(document.documentElement,"mousedown",function(t){return e.onDocumentMouseDown(t)})},setMenuItems:function(e){this.menuItems=e},isSubMenu:function(){return null!==this.parentMenu},open:function(){var e=this;this.container.removeAttribute("style"),this.container.style.display="block";var t={data:this.menuItems,colHeaders:!1,colWidths:[200],autoRowSize:!1,readOnly:!0,copyPaste:!1,columns:[{data:"name",renderer:function(t,n,o,r,i,s){return e.menuItemRenderer(t,n,o,r,i,s)}}],renderAllRows:!0,fragmentSelection:"cell",beforeKeyDown:function(t){return e.onBeforeKeyDown(t)},afterOnCellMouseOver:function(t,n,o){return e.openSubMenu(n.row)}};this.origOutsideClickDeselects=this.hot.getSettings().outsideClickDeselects,this.hot.getSettings().outsideClickDeselects=!1,this.hotMenu=new Handsontable.Core(this.container,t),this.hotMenu.addHook("afterInit",function(){return e.onAfterInit()}),this.hotMenu.init(),this.hotMenu.listen(),this.blockMainTableCallbacks(),this.runLocalHooks("afterOpen")},close:function(){var e=void 0!==arguments[0]?arguments[0]:!1;this.isOpened()&&(e&&this.parentMenu?this.parentMenu.close():(this.closeAllSubMenus(),this.container.style.display="none",this.releaseMainTableCallbacks(),this.hotMenu.destroy(),this.hotMenu=null,this.hot.getSettings().outsideClickDeselects=this.origOutsideClickDeselects,this.runLocalHooks("afterClose")))},openSubMenu:function(e){var t=this.hotMenu.getCell(e,0);if(this.closeAllSubMenus(),!t||!H(t))return!1;var n=this.hotMenu.getSourceDataAtRow(e),o=new I(this.hot,{parent:this,name:n.name,className:this.options.className});return o.setMenuItems(n.submenu.items),o.open(),o.setPosition(t.getBoundingClientRect()),this.hotSubMenus[n.key]=o,o},closeSubMenu:function(e){var t=this.hotMenu.getSourceDataAtRow(e),n=this.hotSubMenus[t.key];n&&(n.destroy(),delete this.hotSubMenus[t.key])},closeAllSubMenus:function(){var e=this;C(this.hotMenu.getData(),function(t,n){return e.closeSubMenu(n)})},isAllSubMenusClosed:function(){return 0===Object.keys(this.hotSubMenus).length},destroy:function(){this.clearLocalHooks(),this.close(),this.parentMenu=null,this.eventManager.destroy()},isOpened:function(){return null!==this.hotMenu},executeCommand:function(e){if(this.isOpened()&&this.hotMenu.getSelected()){var t=this.hotMenu.getSourceDataAtRow(this.hotMenu.getSelected()[0]);if(this.runLocalHooks("select",t,e),t.isCommand!==!1){var n=this.hot.getSelectedRange(),o=n?k(n):{};this.runLocalHooks("executeCommand",t.key,o,e),this.isSubMenu()&&this.parentMenu.runLocalHooks("executeCommand",t.key,o,e),this.close(!0)}}},setPosition:function(e){var t=new y(e);this.options.keepInViewport?(t.fitsBelow(this.container)?this.setPositionBelowCursor(t):t.fitsAbove(this.container)?this.setPositionAboveCursor(t):this.setPositionBelowCursor(t),t.fitsOnRight(this.container)?this.setPositionOnRightOfCursor(t):this.setPositionOnLeftOfCursor(t)):(this.setPositionBelowCursor(t),this.setPositionOnRightOfCursor(t))},setPositionAboveCursor:function(e){var t=e.top-this.container.offsetHeight;this.isSubMenu()&&(t=window.scrollY+e.top+e.cellHeight-this.container.offsetHeight+3),this.container.style.top=t+"px"},setPositionBelowCursor:function(e){var t=e.top-1;this.isSubMenu()&&(t=e.top+window.scrollY-1),this.container.style.top=t+"px"},setPositionOnRightOfCursor:function(e){var t;t=this.isSubMenu()?window.scrollX+1+e.left+e.cellWidth:1+e.left,this.container.style.left=t+"px"},setPositionOnLeftOfCursor:function(e){this.container.style.left=e.left-this.container.offsetWidth+w()+4+"px"},selectFirstCell:function(){var e=this.hotMenu.getCell(0,0);O(e)||_(e)||M(e)?this.selectNextCell(0,0):this.hotMenu.selectCell(0,0)},selectLastCell:function(){var e=this.hotMenu.countRows()-1,t=this.hotMenu.getCell(e,0);O(t)||_(t)||M(t)?this.selectPrevCell(e,0):this.hotMenu.selectCell(e,0)},selectNextCell:function(e,t){var n=e+1,o=n=0?this.hotMenu.getCell(n,t):null;o&&(O(o)||_(o)||M(o)?this.selectPrevCell(n,t):this.hotMenu.selectCell(n,t))},menuItemRenderer:function(e,t,n,o,r,i){var s=this,l=e.getSourceDataAtRow(n),a=document.createElement("div"),u=function(e){return e.hasOwnProperty("submenu")},c=function(e){return new RegExp(D,"i").test(e.name)},d=function(e){return e.disabled===!0||"function"==typeof e.disabled&&e.disabled.call(s.hot)===!0},h=function(e){return"function"==typeof e.hidden&&e.hidden.call(s.hot)===!0},f=function(e){return e.disableSelection},w=h(l);"function"==typeof i&&(i=i.call(this.hot)),p(t),g(a,"htItemWrapper"),t.appendChild(a),c(l)?g(t,"htSeparator"):w||"function"!=typeof l.renderer?m(a,i):(g(t,"htCustomMenuRenderer"),t.appendChild(l.renderer(e,a,n,o,r,i))),w?t.parentNode&&g(t.parentNode,"htHidden"):d(l)?(g(t,"htDisabled"),this.eventManager.addEventListener(a,"mouseenter",function(){return e.deselectCell()})):f(l)?(g(t,"htSelectionDisabled"),this.eventManager.addEventListener(a,"mouseenter",function(){return e.deselectCell()})):u(l)?(g(t,"htSubmenu"),f(l)?this.eventManager.addEventListener(a,"mouseenter",function(){return e.deselectCell()}):this.eventManager.addEventListener(a,"mouseenter",function(){return e.selectCell(n,o,void 0,void 0,void 0,!1)})):(b(t,"htSubmenu"),b(t,"htDisabled"),f(l)?this.eventManager.addEventListener(a,"mouseenter",function(){return e.deselectCell()}):this.eventManager.addEventListener(a,"mouseenter",function(){return e.selectCell(n,o,void 0,void 0,void 0,!1)}))},createContainer:function(){var e=void 0!==arguments[0]?arguments[0]:null;e&&(e=e.replace(/ /g,"_"),e=this.options.className+"Sub_"+e);var t;return t=e?document.querySelector("."+this.options.className+"."+e):document.querySelector("."+this.options.className),t||(t=document.createElement("div"),g(t,"htMenu "+this.options.className),e&&g(t,e),document.getElementsByTagName("body")[0].appendChild(t)),t},blockMainTableCallbacks:function(){this._afterScrollCallback=function(){},this.hot.addHook("afterScrollVertically",this._afterScrollCallback),this.hot.addHook("afterScrollHorizontally",this._afterScrollCallback)},releaseMainTableCallbacks:function(){this._afterScrollCallback&&(this.hot.removeHook("afterScrollVertically",this._afterScrollCallback),this.hot.removeHook("afterScrollHorizontally",this._afterScrollCallback),this._afterScrollCallback=null)},onBeforeKeyDown:function(e){var t=this.hotMenu.getSelected(),n=!1;switch(e.keyCode){case A.ESCAPE:this.close(),n=!0;break;case A.ENTER:t&&(this.hotMenu.getSourceDataAtRow(t[0]).submenu?n=!0:(this.executeCommand(e),this.close(!0)));break;case A.ARROW_DOWN:t?this.selectNextCell(t[0],t[1]):this.selectFirstCell(),n=!0;break;case A.ARROW_UP:t?this.selectPrevCell(t[0],t[1]):this.selectLastCell(),n=!0;break;case A.ARROW_RIGHT:if(t){var o=this.openSubMenu(t[0]);o&&o.selectFirstCell()}n=!0;break;case A.ARROW_LEFT:t&&this.isSubMenu()&&(this.close(),this.parentMenu&&this.parentMenu.hotMenu.listen(),n=!0)}n&&(e.preventDefault(),L(e))},onAfterInit:function(){var e=this.hotMenu.getSettings().data,t=this.hotMenu.view.wt.wtTable.hider.style,n=this.hotMenu.view.wt.wtTable.holder.style,o=parseInt(t.width,10),r=0;C(e,function(e){return r+=e.name===D?1:26}),n.width=o+22+"px",n.height=r+4+"px"},onDocumentMouseDown:function(e){this.isOpened()&&(this.container&&v(e.target,this.container)&&this.executeCommand(e),(this.isAllSubMenusClosed()||this.isSubMenu())&&!v(e.target,".htMenu")&&v(e.target,document)&&this.close(!0))}},{}),S(W,P)},{cursor:67,eventManager:41,"helpers/array":42,"helpers/dom/element":45,"helpers/dom/event":46,"helpers/object":50,"helpers/unicode":53,"mixins/localHooks":54,predefinedItems:70,utils:71}],70:[function(e,t,n){"use strict";function o(){var e={};return c(A,function(t,n){return e[n]=d(t)}),e}function r(e,t){-1===k.indexOf(e)&&(A[e]=t)}var i;Object.defineProperties(n,{ROW_ABOVE:{get:function(){return v}},ROW_BELOW:{get:function(){return b}},COLUMN_LEFT:{get:function(){return C}},COLUMN_RIGHT:{get:function(){return y}},CLEAR_COLUMN:{get:function(){return R}},REMOVE_ROW:{get:function(){return E}},REMOVE_COLUMN:{get:function(){return S}},UNDO:{get:function(){return T}},REDO:{get:function(){return O}},READ_ONLY:{get:function(){return _}},ALIGNMENT:{get:function(){return M}},SEPARATOR:{get:function(){return H}},ITEMS:{get:function(){return k}},predefinedItems:{get:function(){return o}},addItem:{get:function(){return r}},__esModule:{value:!0}});var s,l,a,u=(s=e("helpers/object"),s&&s.__esModule&&s||{"default":s}),c=u.objectEach,d=u.clone,h=((l=e("helpers/number"),l&&l.__esModule&&l||{"default":l}).rangeEach,a=e("utils"),a&&a.__esModule&&a||{"default":a}),f=h.align,g=h.getAlignmentClasses,p=h.getValidSelection,m=h.checkSelectionConsistency,w=h.markLabelAsSelected,v="row_above",b="row_below",C="col_left",y="col_right",R="clear_column",E="remove_row",S="remove_col",T="undo",O="redo",_="make_read_only",M="alignment",H="---------",k=[v,b,C,y,R,E,S,T,O,_,M,H],A=(i={},Object.defineProperty(i,H,{value:{name:H},configurable:!0,enumerable:!0,writable:!0}),Object.defineProperty(i,v,{value:{key:v,name:"Insert row above",callback:function(e,t){this.alter("insert_row",t.start.row)},disabled:function(){var e=p(this);if(!e)return!0;var t=this.countRows(),n=[0,e[1],t-1,e[1]];return n.join(",")===e.join(",")&&t>1},hidden:function(){return!this.getSettings().allowInsertRow}},configurable:!0,enumerable:!0,writable:!0}),Object.defineProperty(i,b,{value:{key:b,name:"Insert row below",callback:function(e,t){this.alter("insert_row",t.end.row+1)},disabled:function(){var e=p(this);if(!e)return!0;var t=this.countRows(),n=[0,e[1],t-1,e[1]];return n.join(",")===e.join(",")&&t>1},hidden:function(){return!this.getSettings().allowInsertRow}},configurable:!0,enumerable:!0,writable:!0}),Object.defineProperty(i,C,{value:{key:C,name:"Insert column on the left",callback:function(e,t){this.alter("insert_col",t.start.col)},disabled:function(){var e=p(this);if(!e)return!0;if(!this.isColumnModificationAllowed())return!0;var t=[e[0],0,e[0],this.countCols()-1],n=t.join(",")==e.join(",");return e[1]<0||this.countCols()>=this.getSettings().maxCols||n},hidden:function(){return!this.getSettings().allowInsertColumn}},configurable:!0,enumerable:!0,writable:!0}),Object.defineProperty(i,y,{value:{key:y,name:"Insert column on the right",callback:function(e,t){this.alter("insert_col",t.end.col+1)},disabled:function(){var e=p(this);if(!e)return!0;if(!this.isColumnModificationAllowed())return!0;var t=[e[0],0,e[0],this.countCols()-1],n=t.join(",")==e.join(",");return e[1]<0||this.countCols()>=this.getSettings().maxCols||n},hidden:function(){return!this.getSettings().allowInsertColumn}},configurable:!0,enumerable:!0,writable:!0}),Object.defineProperty(i,R,{value:{key:R,name:"Clear column",callback:function(e,t){var n=t.start.col;this.countRows()&&this.populateFromArray(0,n,[[null]],Math.max(t.start.row,t.end.row),n)},disabled:function(){var e=p(this);if(!e)return!0;var t=[e[0],0,e[0],this.countCols()-1],n=t.join(",")==e.join(",");return e[1]<0||this.countCols()>=this.getSettings().maxCols||n}},configurable:!0,enumerable:!0,writable:!0}),Object.defineProperty(i,E,{value:{key:E,name:"Remove row",callback:function(e,t){var n=t.end.row-t.start.row+1;this.alter("remove_row",t.start.row,n)},disabled:function(){var e=p(this);if(!e)return!0;var t=[0,e[1],this.countRows()-1,e[1]];return t.join(",")===e.join(",")},hidden:function(){return!this.getSettings().allowRemoveRow}},configurable:!0,enumerable:!0,writable:!0}),Object.defineProperty(i,S,{value:{key:S,name:"Remove column",callback:function(e,t){var n=t.end.col-t.start.col+1;this.alter("remove_col",t.start.col,n)},disabled:function(){var e=p(this);if(!e)return!0;if(!this.isColumnModificationAllowed())return!0;var t=[e[0],0,e[0],this.countCols()-1],n=t.join(",")==e.join(",");return e[1]<0||n},hidden:function(){return!this.getSettings().allowRemoveColumn}},configurable:!0,enumerable:!0,writable:!0}),Object.defineProperty(i,T,{value:{key:T,name:"Undo",callback:function(){this.undo()},disabled:function(){return this.undoRedo&&!this.undoRedo.isUndoAvailable()}},configurable:!0,enumerable:!0,writable:!0}),Object.defineProperty(i,O,{value:{key:O,name:"Redo",callback:function(){this.redo()},disabled:function(){return this.undoRedo&&!this.undoRedo.isRedoAvailable()}},configurable:!0,enumerable:!0,writable:!0}),Object.defineProperty(i,_,{value:{key:_,name:function(){var e=this,t="Read only",n=m(this.getSelectedRange(),function(t,n){return e.getCellMeta(t,n).readOnly});return n&&(t=w(t)),t},callback:function(){var e=this,t=this.getSelectedRange(),n=m(t,function(t,n){return e.getCellMeta(t,n).readOnly});t.forAll(function(t,o){e.getCellMeta(t,o).readOnly=n?!1:!0}),this.render()},disabled:function(){return this.getSelectedRange()?!1:!0}},configurable:!0,enumerable:!0,writable:!0}),Object.defineProperty(i,M,{value:{key:M,name:"Alignment",disabled:function(){return this.getSelectedRange()?!1:!0},submenu:{items:[{key:M+":left",name:function(){var e=this,t="Left",n=m(this.getSelectedRange(),function(t,n){var o=e.getCellMeta(t,n).className;return o&&-1!==o.indexOf("htLeft")?!0:void 0});return n&&(t=w(t)),t},callback:function(){var e=this,t=this.getSelectedRange(),n=g(t,function(t,n){return e.getCellMeta(t,n).className}),o="horizontal",r="htLeft";this.runHooks("beforeCellAlignment",n,t,o,r),f(t,o,r,function(t,n){return e.getCellMeta(t,n)}),this.render()},disabled:!1},{key:M+":center",name:function(){var e=this,t="Center",n=m(this.getSelectedRange(),function(t,n){var o=e.getCellMeta(t,n).className;return o&&-1!==o.indexOf("htCenter")?!0:void 0});return n&&(t=w(t)),t},callback:function(){var e=this,t=this.getSelectedRange(),n=g(t,function(t,n){return e.getCellMeta(t,n).className}),o="horizontal",r="htCenter";this.runHooks("beforeCellAlignment",n,t,o,r),f(t,o,r,function(t,n){return e.getCellMeta(t,n)}),this.render()},disabled:!1},{key:M+":right",name:function(){var e=this,t="Right",n=m(this.getSelectedRange(),function(t,n){var o=e.getCellMeta(t,n).className;return o&&-1!==o.indexOf("htRight")?!0:void 0});return n&&(t=w(t)),t},callback:function(){var e=this,t=this.getSelectedRange(),n=g(t,function(t,n){return e.getCellMeta(t,n).className}),o="horizontal",r="htRight";this.runHooks("beforeCellAlignment",n,t,o,r),f(t,o,r,function(t,n){return e.getCellMeta(t,n)}),this.render()},disabled:!1},{key:M+":justify",name:function(){var e=this,t="Justify",n=m(this.getSelectedRange(),function(t,n){var o=e.getCellMeta(t,n).className;return o&&-1!==o.indexOf("htJustify")?!0:void 0});return n&&(t=w(t)),t},callback:function(){var e=this,t=this.getSelectedRange(),n=g(t,function(t,n){return e.getCellMeta(t,n).className}),o="horizontal",r="htJustify";this.runHooks("beforeCellAlignment",n,t,o,r),f(t,o,r,function(t,n){return e.getCellMeta(t,n)}),this.render()},disabled:!1},{name:H},{key:M+":top",name:function(){var e=this,t="Top",n=m(this.getSelectedRange(),function(t,n){var o=e.getCellMeta(t,n).className;return o&&-1!==o.indexOf("htTop")?!0:void 0});return n&&(t=w(t)),t},callback:function(){var e=this,t=this.getSelectedRange(),n=g(t,function(t,n){return e.getCellMeta(t,n).className}),o="vertical",r="htTop";this.runHooks("beforeCellAlignment",n,t,o,r),f(t,o,r,function(t,n){return e.getCellMeta(t,n)}),this.render()},disabled:!1},{key:M+":middle",name:function(){var e=this,t="Middle",n=m(this.getSelectedRange(),function(t,n){var o=e.getCellMeta(t,n).className;return o&&-1!==o.indexOf("htMiddle")?!0:void 0});return n&&(t=w(t)),t},callback:function(){var e=this,t=this.getSelectedRange(),n=g(t,function(t,n){return e.getCellMeta(t,n).className}),o="vertical",r="htMiddle";this.runHooks("beforeCellAlignment",n,t,o,r),f(t,o,r,function(t,n){return e.getCellMeta(t,n)}),this.render()},disabled:!1},{key:M+":bottom",name:function(){var e=this,t="Bottom",n=m(this.getSelectedRange(),function(t,n){var o=e.getCellMeta(t,n).className;return o&&-1!==o.indexOf("htBottom")?!0:void 0});return n&&(t=w(t)),t},callback:function(){var e=this,t=this.getSelectedRange(),n=g(t,function(t,n){return e.getCellMeta(t,n).className}),o="vertical",r="htBottom";this.runHooks("beforeCellAlignment",n,t,o,r),f(t,o,r,function(t,n){return e.getCellMeta(t,n)}),this.render()},disabled:!1}]}},configurable:!0,enumerable:!0,writable:!0}),i)},{"helpers/number":49,"helpers/object":50,utils:71}],71:[function(e,t,n){"use strict";function o(e){return{start:e.getTopLeftCorner(),end:e.getBottomRightCorner()}}function r(e){return w(e,"htSeparator")}function i(e){return w(e,"htSubmenu")}function s(e){return w(e,"htDisabled")}function l(e){return w(e,"htSelectionDisabled")}function a(e){var t=e.getSelected();return t?t[0]<0?null:e.countRows()>=e.getSettings().maxRows?null:t:null}function u(e,t){return-1!=e.indexOf(t)?e:(e=e.replace("htTop","").replace("htMiddle","").replace("htBottom","").replace(" ",""),e+=" "+t)}function c(e,t){return-1!=e.indexOf(t)?e:(e=e.replace("htLeft","").replace("htCenter","").replace("htRight","").replace("htJustify","").replace(" ",""),e+=" "+t)}function d(e,t){for(var n={},o=e.from.row;o<=e.to.row;o++)for(var r=e.from.col;r<=e.to.col;r++)n[o]||(n[o]=[]),n[o][r]=t(o,r);return n}function h(e,t,n,o){if(e.from.row==e.to.row&&e.from.col==e.to.col)f(e.from.row,e.from.col,t,n,o);else for(var r=e.from.row;r<=e.to.row;r++)for(var i=e.from.col;i<=e.to.col;i++)f(r,i,t,n,o)}function f(e,t,n,o,r){var i=r(e,t),s=o;i.className&&(s="vertical"===n?u(i.className,o):c(i.className,o)),i.className=s}function g(e,t){var n=!1;return e&&e.forAll(function(e,o){return t(e,o)?(n=!0,!1):void 0}),n}function p(e){return''+String.fromCharCode(10003)+""+e}Object.defineProperties(n,{normalizeSelection:{get:function(){return o}},isSeparator:{get:function(){return r}},hasSubMenu:{get:function(){return i}},isDisabled:{get:function(){return s}},isSelectionDisabled:{get:function(){return l}},getValidSelection:{get:function(){return a}},prepareVerticalAlignClass:{get:function(){return u}},prepareHorizontalAlignClass:{get:function(){return c}},getAlignmentClasses:{get:function(){return d}},align:{get:function(){return h}},checkSelectionConsistency:{get:function(){return g}},markLabelAsSelected:{get:function(){return p}},__esModule:{value:!0}});var m,w=(m=e("helpers/dom/element"),m&&m.__esModule&&m||{"default":m}).hasClass},{"helpers/dom/element":45}],72:[function(e,t,n){"use strict";Object.defineProperties(n,{ContextMenuCopyPaste:{get:function(){return p}},__esModule:{value:!0}});var o,r,i,s,l,a,u=(o=e("helpers/dom/element"),o&&o.__esModule&&o||{"default":o}).removeClass,c=(r=e("helpers/array"),r&&r.__esModule&&r||{"default":r}).arrayEach,d=(i=e("eventManager"),i&&i.__esModule&&i||{"default":i}).EventManager,h=(s=e("plugins"),s&&s.__esModule&&s||{"default":s}).registerPlugin,f=(l=e("_base"),l&&l.__esModule&&l||{"default":l})["default"],g=(a=e("zeroclipboard"),a&&a.__esModule&&a||{"default":a})["default"],p=function(e){$traceurRuntime.superConstructor(m).call(this,e),this.eventManager=new d(this),this.swfPath=null,this.outsideClickDeselectsCache=null},m=p;$traceurRuntime.createClass(p,{isEnabled:function(){return this.hot.getSettings().contextMenuCopyPaste},enablePlugin:function(){var e=this;if(!this.enabled){"object"==typeof this.hot.getSettings().contextMenuCopyPaste&&(this.swfPath=this.hot.getSettings().contextMenuCopyPaste.swfPath),"undefined"==typeof g&&console.error("To be able to use the Copy/Paste feature from the context menu, you need to manually include ZeroClipboard.js file to your website.");try{new ActiveXObject("ShockwaveFlash.ShockwaveFlash")}catch(t){"undefined"==typeof navigator.mimeTypes["application/x-shockwave-flash"]&&console.error("To be able to use the Copy/Paste feature from the context menu, your browser needs to have Flash Plugin installed.")}this.swfPath&&g.config({swfPath:this.swfPath}),this.hot.addHook("afterContextMenuShow",function(){return e.onAfterContextMenuShow()}),this.hot.addHook("afterContextMenuDefaultOptions",function(t){return e.onAfterContextMenuDefaultOptions(t)}),this.registerEvents(),$traceurRuntime.superGet(this,m.prototype,"enablePlugin").call(this)}},disablePlugin:function(){$traceurRuntime.superGet(this,m.prototype,"disablePlugin").call(this)},registerEvents:function(){var e=this;this.eventManager.addEventListener(document,"mouseenter",function(){return e.removeCurrentClass()}),this.eventManager.addEventListener(document,"mouseleave",function(){return e.removeZeroClipboardClass()})},getCopyValue:function(){return this.hot.copyPaste.setCopyableText(),this.hot.copyPaste.copyPasteInstance.elTextarea.value},onAfterContextMenuDefaultOptions:function(e){e.items.unshift({key:"copy",name:"Copy"},{key:"paste",name:"Paste",callback:function(){this.copyPaste.triggerPaste()}},Handsontable.plugins.ContextMenu.SEPARATOR)},onAfterContextMenuShow:function(){var e=this,t=this.hot.getPlugin("contextMenu"),n=t.menu.hotMenu.getSourceData();c(n,function(n,o){if("copy"===n.key){var r=new g(t.menu.hotMenu.getCell(o,0));return r.off(),r.on("copy",function(t){var n=t.clipboardData;n.setData("text/plain",e.getCopyValue()),e.hot.getSettings().outsideClickDeselects=e.outsideClickDeselectsCache}),!1}})},removeCurrentClass:function(){var e=this.hot.getPlugin("contextMenu");if(e.menu.isOpened()){var t=e.menu.hotMenu.rootElement.querySelector("td.current");t&&u(t,"current")}this.outsideClickDeselectsCache=this.hot.getSettings().outsideClickDeselects,this.hot.getSettings().outsideClickDeselects=!1},removeZeroClipboardClass:function(){var e=this.hot.getPlugin("contextMenu");if(e.menu.isOpened()){var t=e.menu.hotMenu.rootElement.querySelector("td.zeroclipboard-is-hover");t&&u(t,"zeroclipboard-is-hover")}this.hot.getSettings().outsideClickDeselects=this.outsideClickDeselectsCache}},{},f),h("contextMenuCopyPaste",p)},{_base:58,eventManager:41,"helpers/array":42,"helpers/dom/element":45,plugins:57,zeroclipboard:void 0}],73:[function(e,t,n){"use strict";function o(e){function t(){e.isListening()&&e.selection.empty()}function n(t){var n,o,r,i,s,l,a,u,c,d;if(e.isListening()&&e.selection.isSelected()){n=t,o=w.parse(n),r=e.getSelected(),i=new M(r[0],r[1]),s=new M(r[2],r[3]),l=new H(i,i,s),a=l.getTopLeftCorner(),u=l.getBottomRightCorner(),c=a,d=new M(Math.max(u.row,o.length-1+a.row),Math.max(u.col,o[0].length-1+a.col));var h=s.row-i.row>=o.length-1,f=s.col-i.col>=o[0].length-1;e.addHookOnce("afterChange",function(t,n){var o=t?t.length:0;if(o){var r={row:0,col:0},i=-1;y(t,function(e,n){var s=o>n+1?t[n+1]:null;s&&(h||(r.row=r.row+Math.max(s[0]-e[0]-1,0)),!f&&e[1]>i&&(i=e[1],r.col=r.col+Math.max(s[1]-e[1]-1,0)))}),e.selectCell(c.row,c.col,d.row+r.row,d.col+r.col)}}),e.populateFromArray(c.row,c.col,o,d.row,d.col,"paste",e.getSettings().pasteMode)}}function o(t){if(e.getSelected()&&!(e.getActiveEditor()&&e.getActiveEditor().isOpened()||T(t))){if(C(t.keyCode)){if(e.getSettings().fragmentSelection&&O())return;return r.setCopyableText(),void S(t)}var n=(t.ctrlKey||t.metaKey)&&!t.altKey;t.keyCode==b.A&&n&&e._registerTimeout(setTimeout(_(r.setCopyableText,r),0))}}var r=this;this.copyPasteInstance=m(),this.copyPasteInstance.onCut(t),this.copyPasteInstance.onPaste(n),this.onPaste=n,e.addHook("beforeKeyDown",o),this.destroy=function(){this.copyPasteInstance&&(this.copyPasteInstance.removeCallback(t),this.copyPasteInstance.removeCallback(n),this.copyPasteInstance.destroy(),this.copyPasteInstance=null),e.removeHook("beforeKeyDown",o)},e.addHook("afterDestroy",_(this.destroy,this)),this.triggerPaste=_(this.copyPasteInstance.triggerPaste,this.copyPasteInstance),this.triggerCut=_(this.copyPasteInstance.triggerCut,this.copyPasteInstance),this.setCopyableText=function(){var t=e.getSettings(),n=t.copyRowsLimit,o=t.copyColsLimit,r=e.getSelectedRange(),i=r.getTopLeftCorner(),s=r.getBottomRightCorner(),l=i.row,a=i.col,u=s.row,c=s.col,d=Math.min(u,l+n-1),h=Math.min(c,a+o-1),f=[];f.push({startRow:l,startCol:a,endRow:d,endCol:h}),f=Handsontable.hooks.run(e,"modifyCopyableRange",f);var g=this.getRangedCopyableData(f);e.copyPaste.copyPasteInstance.copyable(g),(u!==d||c!==h)&&Handsontable.hooks.run(e,"afterCopyLimit",u-l+1,c-a+1,n,o)},this.getRangedCopyableData=function(t){var n=[],o=[],r=[];return y(t,function(e){R(e.startRow,e.endRow,function(e){-1===o.indexOf(e)&&o.push(e)}),R(e.startCol,e.endCol,function(e){-1===r.indexOf(e)&&r.push(e)})}),y(o,function(t){var o=[];y(r,function(n){o.push(e.getCopyableData(t,n))}),n.push(o)}),w.stringify(n)}}function r(){var e=this,t=e.getSettings().copyPaste!==!1;t&&!e.copyPaste?e.copyPaste=new o(e):!t&&e.copyPaste&&(e.copyPaste.destroy(),e.copyPaste=null)}Object.defineProperties(n,{CopyPastePlugin:{get:function(){return o}},__esModule:{value:!0}});var i,s,l,a,u,c,d,h,f,g,p,m=(i=e("copyPaste"),i&&i.__esModule&&i||{"default":i})["default"],w=(s=e("SheetClip"),s&&s.__esModule&&s||{"default":s})["default"],v=(l=e("helpers/unicode"),l&&l.__esModule&&l||{"default":l}),b=v.KEY_CODES,C=v.isCtrlKey,y=(a=e("helpers/array"),a&&a.__esModule&&a||{"default":a}).arrayEach,R=(u=e("helpers/number"),u&&u.__esModule&&u||{"default":u}).rangeEach,E=(c=e("helpers/dom/event"),c&&c.__esModule&&c||{"default":c}),S=E.stopImmediatePropagation,T=E.isImmediatePropagationStopped,O=(d=e("helpers/dom/element"),d&&d.__esModule&&d||{"default":d}).getSelectionText,_=(h=e("helpers/function"),h&&h.__esModule&&h||{"default":h}).proxy,M=((f=e("plugins"),f&&f.__esModule&&f||{"default":f}).registerPlugin,(g=e("3rdparty/walkontable/src/cell/coords"),g&&g.__esModule&&g||{"default":g}).WalkontableCellCoords),H=(p=e("3rdparty/walkontable/src/cell/range"),p&&p.__esModule&&p||{"default":p}).WalkontableCellRange;Handsontable.hooks.add("afterInit",r),Handsontable.hooks.add("afterUpdateSettings",r),Handsontable.hooks.register("afterCopyLimit"),Handsontable.hooks.register("modifyCopyableRange")},{"3rdparty/walkontable/src/cell/coords":5,"3rdparty/walkontable/src/cell/range":6,SheetClip:"SheetClip",copyPaste:"copyPaste","helpers/array":42,"helpers/dom/element":45,"helpers/dom/event":46,"helpers/function":47,"helpers/number":49,"helpers/unicode":53,plugins:57}],74:[function(e,t,n){"use strict";function o(){}var r,i,s,l,a=((r=e("plugins"),r&&r.__esModule&&r||{"default":r}).registerPlugin,(i=e("3rdparty/walkontable/src/cell/range"),i&&i.__esModule&&i||{"default":i}).WalkontableCellRange),u=(s=e("3rdparty/walkontable/src/selection"),s&&s.__esModule&&s||{"default":s}).WalkontableSelection,c=function(e){return"boolean"==typeof e&&e===!0?!0:"object"==typeof e&&e.length>0?!0:!1},d=function(){c(this.getSettings().customBorders)&&(this.customBorders||(l=this,this.customBorders=new o))},h=function(e){for(var t=0;t=0?l.view.wt.selections[o]=n:l.view.wt.selections.push(n)},g=function(e,t,n){var o=C(e,t);o=y(o,n),this.setCellMeta(e,t,"borders",o),f(o)},p=function(e){for(var t=e.range,n=t.from.row;n<=t.to.row;n++)for(var o=t.from.col;o<=t.to.col;o++){var r=C(n,o),i=0;n==t.from.row&&(i++,e.hasOwnProperty("top")&&(r.top=e.top)),n==t.to.row&&(i++,e.hasOwnProperty("bottom")&&(r.bottom=e.bottom)),o==t.from.col&&(i++,e.hasOwnProperty("left")&&(r.left=e.left)),o==t.to.col&&(i++,e.hasOwnProperty("right")&&(r.right=e.right)),i>0&&(this.setCellMeta(n,o,"borders",r),f(r))}},m=function(e,t){return"border_row"+e+"col"+t},w=function(){return{width:1,color:"#000"}},v=function(){return{hide:!0}},b=function(){return{width:1,color:"#000",cornerVisible:!1}},C=function(e,t){return{className:m(e,t),border:b(),row:e,col:t,top:v(),right:v(),bottom:v(),left:v()}},y=function(e,t){return t.hasOwnProperty("border")&&(e.border=t.border),t.hasOwnProperty("top")&&(e.top=t.top),t.hasOwnProperty("right")&&(e.right=t.right),t.hasOwnProperty("bottom")&&(e.bottom=t.bottom),t.hasOwnProperty("left")&&(e.left=t.left),e},R=function(e){for(var t=document.querySelectorAll("."+e),n=0;n'+String.fromCharCode(10003)+""+e},M=function(e){this.getSettings().customBorders&&(e.items.push(Handsontable.plugins.ContextMenu.SEPARATOR),e.items.push({key:"borders",name:"Borders",submenu:{items:[{key:"borders:top",name:function(){var e="Top",t=O(this,"top");return t&&(e=_(e)),e},callback:function(){var e=O(this,"top");T.call(this,this.getSelectedRange(),"top",e)},disabled:!1},{key:"borders:right",name:function(){var e="Right",t=O(this,"right");return t&&(e=_(e)),e},callback:function(){var e=O(this,"right");T.call(this,this.getSelectedRange(),"right",e)},disabled:!1},{key:"borders:bottom",name:function(){var e="Bottom",t=O(this,"bottom");return t&&(e=_(e)),e},callback:function(){var e=O(this,"bottom");T.call(this,this.getSelectedRange(),"bottom",e)},disabled:!1},{key:"borders:left",name:function(){var e="Left",t=O(this,"left");return t&&(e=_(e)),e},callback:function(){var e=O(this,"left");T.call(this,this.getSelectedRange(),"left",e); -},disabled:!1},{key:"borders:no_borders",name:"Remove border(s)",callback:function(){T.call(this,this.getSelectedRange(),"noBorders")},disabled:function(){return!O(this)}}]}}))};Handsontable.hooks.add("beforeInit",d),Handsontable.hooks.add("afterContextMenuDefaultOptions",M),Handsontable.hooks.add("afterInit",function(){var e=this.getSettings().customBorders;if(e){for(var t=0;tthis.boundaries.bottom&&(o=t-this.boundaries.bottom),ethis.boundaries.right&&(n=e-this.boundaries.right),this.callback(n,o)};var l,a=function(e){e.dragToScrollListening=!1;var t=e.view.wt.wtTable.holder;l=new o,t!==window&&(l.setBoundaries(t.getBoundingClientRect()),l.setCallback(function(e,n){0>e?t.scrollLeft-=50:e>0&&(t.scrollLeft+=50),0>n?t.scrollTop-=20:n>0&&(t.scrollTop+=20)}),e.dragToScrollListening=!0)};Handsontable.hooks.add("afterInit",function(){var e=this,t=s(this);t.addEventListener(document,"mouseup",function(){e.dragToScrollListening=!1}),t.addEventListener(document,"mousemove",function(t){e.dragToScrollListening&&l.check(t.clientX,t.clientY)})}),Handsontable.hooks.add("afterDestroy",function(){s(this).clear()}),Handsontable.hooks.add("afterOnCellMouseDown",function(){a(this)}),Handsontable.hooks.add("afterOnCellCornerMouseDown",function(){a(this)}),Handsontable.plugins.DragToScroll=o},{eventManager:41,plugins:57}],76:[function(e,t,n){"use strict";Object.defineProperties(n,{ManualColumnFreeze:{get:function(){return l}},__esModule:{value:!0}});var o,r,i=(o=e("_base"),o&&o.__esModule&&o||{"default":o})["default"],s=(r=e("plugins"),r&&r.__esModule&&r||{"default":r}).registerPlugin,l=function(e){$traceurRuntime.superConstructor(a).call(this,e)},a=l;$traceurRuntime.createClass(l,{isEnabled:function(){return!!this.hot.getSettings().manualColumnFreeze},enablePlugin:function(){var e=this;this.enabled||(this.addHook("modifyCol",function(t){return e.onModifyCol(t)}),this.addHook("afterContextMenuDefaultOptions",function(t){return e.addContextMenuEntry(t)}),$traceurRuntime.superGet(this,a.prototype,"enablePlugin").call(this))},disablePlugin:function(){$traceurRuntime.superGet(this,a.prototype,"disablePlugin").call(this)},init:function(){$traceurRuntime.superGet(this,a.prototype,"init").call(this),"undefined"==typeof this.hot.manualColumnPositionsPluginUsages?this.hot.manualColumnPositionsPluginUsages=["manualColumnFreeze"]:this.hot.manualColumnPositionsPluginUsages.push("manualColumnFreeze"),this.fixedColumnsCount=this.hot.getSettings().fixedColumnsLeft},onModifyCol:function(e){return this.hot.manualColumnPositionsPluginUsages.length>1?e:this.getModifiedColumnIndex(e)},getModifiedColumnIndex:function(e){return this.hot.manualColumnPositions[e]},addContextMenuEntry:function(e){var t=this;e.items.push(Handsontable.plugins.ContextMenu.SEPARATOR,{key:"freeze_column",name:function(){var e=t.hot.getSelected()[1];return e>t.fixedColumnsCount-1?"Freeze this column":"Unfreeze this column"},disabled:function(){var e=t.hot.getSelected();return e[1]!==e[3]},callback:function(){var e=t.hot.getSelected()[1];e>t.fixedColumnsCount-1?t.freezeColumn(e):t.unfreezeColumn(e)}})},freezeColumn:function(e){if(!(e<=this.fixedColumnsCount-1)){var t=this.getModifiedColumnIndex(e)||e;this.checkPositionData(t),this.modifyColumnOrder(t,e,null,"freeze"),this.addFixedColumn(),this.hot.view.wt.wtOverlays.leftOverlay.refresh(),this.hot.view.wt.wtOverlays.adjustElementsSize()}},unfreezeColumn:function(e){if(!(e>this.fixedColumnsCount-1)){var t=this.getBestColumnReturnPosition(e),n=this.getModifiedColumnIndex(e)||e;this.checkPositionData(n),this.modifyColumnOrder(n,e,t,"unfreeze"),this.removeFixedColumn(),this.hot.view.wt.wtOverlays.leftOverlay.refresh(),this.hot.view.wt.wtOverlays.adjustElementsSize()}},addFixedColumn:function(){this.hot.updateSettings({fixedColumnsLeft:this.fixedColumnsCount+1}),this.fixedColumnsCount++},removeFixedColumn:function(){this.hot.updateSettings({fixedColumnsLeft:this.fixedColumnsCount-1}),this.fixedColumnsCount--},checkPositionData:function(e){this.hot.manualColumnPositions&&0!==this.hot.manualColumnPositions.length||this.hot.manualColumnPositions||(this.hot.manualColumnPositions=[]),e?this.hot.manualColumnPositions[e]||this.createPositionData(e+1):this.createPositionData(this.hot.countCols())},createPositionData:function(e){if(this.hot.manualColumnPositions.lengtht;t++)this.hot.manualColumnPositions[t]=t},modifyColumnOrder:function(e,t,n,o){null==n&&(n=e),"freeze"===o?this.hot.manualColumnPositions.splice(this.fixedColumnsCount,0,this.hot.manualColumnPositions.splice(t,1)[0]):"unfreeze"===o&&this.hot.manualColumnPositions.splice(n,0,this.hot.manualColumnPositions.splice(t,1)[0])},getBestColumnReturnPosition:function(e){for(var t=this.fixedColumnsCount,n=this.getModifiedColumnIndex(t),o=this.getModifiedColumnIndex(e);o>n;)t++,n=this.getModifiedColumnIndex(t);return t-1}},{},i),s("manualColumnFreeze",l)},{_base:58,plugins:57}],77:[function(e,t,n){"use strict";function o(){function e(e){p=this,m=e;var t=this.view.wt.wtTable.getCoords(e).col;if(t>=0){f=t;var n=m.getBoundingClientRect();a=n.left,w.style.top=n.top+"px",w.style.left=a+"px",p.rootElement.appendChild(w)}}function t(e,t){var n=e.getBoundingClientRect(),o=6;t>0?w.style.left=n.left+n.width-o+"px":w.style.left=n.left+"px"}function n(){var e=this;u(w,"active"),u(v,"active");var t=m.getBoundingClientRect();v.style.width=t.width+"px",v.style.height=e.view.maximumVisibleElementHeight(0)+"px",v.style.top=w.style.top,v.style.left=a+"px",e.rootElement.appendChild(v)}function o(e){v.style.left=a+e+"px"}function r(){d(w,"active"),d(v,"active")}var i,s,l,a,f,p,m,w=document.createElement("DIV"),v=document.createElement("DIV"),b=h(this);w.className="manualColumnMover",v.className="manualColumnMoverGuide";var C=function(){var e=this;Handsontable.hooks.run(e,"persistentStateSave","manualColumnPositions",e.manualColumnPositions)},y=function(){var e=this,t={};return Handsontable.hooks.run(e,"persistentStateLoad","manualColumnPositions",t),t.value},R=function(e){return"BODY"!=e.tagName?"THEAD"==e.parentNode.tagName?!0:(e=e.parentNode,R(e)):!1},E=function(e){return"TABLE"!=e.tagName?"TH"==e.tagName?e:E(e.parentNode):null},S=function(){var a,u=this;b.addEventListener(u.rootElement,"mouseover",function(n){if(R(n.target)){var o=E(n.target);if(o)if(a){var r=u.view.wt.wtTable.getCoords(o).col;r>=0&&(s=r,t(n.target,s-i))}else e.call(u,o)}}),b.addEventListener(u.rootElement,"mousedown",function(e){c(e.target,"manualColumnMover")&&(l=g(e),n.call(u),a=u,i=f,s=f)}),b.addEventListener(window,"mousemove",function(e){a&&o(g(e)-l)}),b.addEventListener(window,"mouseup",function(t){a&&(r(),a=!1,O(u.manualColumnPositions,u.countCols()),u.manualColumnPositions.splice(s,0,u.manualColumnPositions.splice(i,1)[0]),Handsontable.hooks.run(u,"beforeColumnMove",i,s),u.forceFullRender=!0,u.view.render(),C.call(u),Handsontable.hooks.run(u,"afterColumnMove",i,s),e.call(u,m))}),u.addHook("afterDestroy",T)},T=function(){b.clear()},O=function(e,t){if(e.lengthn;n++)e[n]=n};this.beforeInit=function(){this.manualColumnPositions=[]},this.init=function(e){var t=this,n=!!this.getSettings().manualColumnMove;if(n){var o=this.getSettings().manualColumnMove,r=y.call(t);"undefined"!=typeof r?this.manualColumnPositions=r:Array.isArray(o)?this.manualColumnPositions=o:this.manualColumnPositions=[],("afterInit"===e||"afterUpdateSettings"===e&&0===b.context.eventListeners.length)&&("undefined"==typeof t.manualColumnPositionsPluginUsages?t.manualColumnPositionsPluginUsages=["manualColumnMove"]:t.manualColumnPositionsPluginUsages.push("manualColumnMove"),S.call(this),this.manualColumnPositions.length>0&&(this.forceFullRender=!0,this.render()))}else{var i=t.manualColumnPositionsPluginUsages?t.manualColumnPositionsPluginUsages.indexOf("manualColumnMove"):-1;i>-1&&(T.call(this),this.manualColumnPositions=[],t.manualColumnPositionsPluginUsages[i]=void 0)}},this.modifyCol=function(e){return this.getSettings().manualColumnMove?("undefined"==typeof this.manualColumnPositions[e]&&O(this.manualColumnPositions,e+1),this.manualColumnPositions[e]):e},this.afterRemoveCol=function(e,t){if(this.getSettings().manualColumnMove){var n,o=this.manualColumnPositions;n=o.splice(e,t),o=o.map(function(e){var t,o=e;for(t=0;tn[t]&&o--;return o}),this.manualColumnPositions=o}},this.afterCreateCol=function(e,t){if(this.getSettings().manualColumnMove){var n=this.manualColumnPositions;if(n.length){for(var o=[],r=0;t>r;r++)o.push(e+r);e>=n.length?n.concat(o):(n=n.map(function(n){return n>=e?n+t:n}),n.splice.apply(n,[e,0].concat(o))),this.manualColumnPositions=n}}}}Object.defineProperties(n,{ManualColumnMove:{get:function(){return o}},__esModule:{value:!0}});var r,i,s,l,a=(r=e("helpers/dom/element"),r&&r.__esModule&&r||{"default":r}),u=a.addClass,c=a.hasClass,d=a.removeClass,h=(i=e("eventManager"),i&&i.__esModule&&i||{"default":i}).eventManager,f=(s=e("helpers/dom/event"),s&&s.__esModule&&s||{"default":s}),g=f.pageX,p=(f.pageY,(l=e("plugins"),l&&l.__esModule&&l||{"default":l}).registerPlugin,new o);Handsontable.hooks.add("beforeInit",p.beforeInit),Handsontable.hooks.add("afterInit",function(){p.init.call(this,"afterInit")}),Handsontable.hooks.add("afterUpdateSettings",function(){p.init.call(this,"afterUpdateSettings")}),Handsontable.hooks.add("modifyCol",p.modifyCol),Handsontable.hooks.add("afterRemoveCol",p.afterRemoveCol),Handsontable.hooks.add("afterCreateCol",p.afterCreateCol),Handsontable.hooks.register("beforeColumnMove"),Handsontable.hooks.register("afterColumnMove")},{eventManager:41,"helpers/dom/element":45,"helpers/dom/event":46,plugins:57}],78:[function(e,t,n){"use strict";Object.defineProperties(n,{ManualColumnResize:{get:function(){return w}},__esModule:{value:!0}});var o,r,i,s,l,a=(o=e("_base.js"),o&&o.__esModule&&o||{"default":o})["default"],u=(r=e("helpers/dom/element"),r&&r.__esModule&&r||{"default":r}),c=u.addClass,d=u.hasClass,h=u.removeClass,f=(i=e("eventManager"),i&&i.__esModule&&i||{"default":i}).eventManager,g=(s=e("helpers/dom/event"),s&&s.__esModule&&s||{"default":s}),p=g.pageX,m=(g.pageY,(l=e("plugins"),l&&l.__esModule&&l||{"default":l}).registerPlugin),w=function(e){$traceurRuntime.superConstructor(v).call(this,e),this.currentTH=null,this.currentCol=null,this.currentWidth=null,this.newSize=null,this.startY=null,this.startWidth=null,this.startOffset=null,this.handle=document.createElement("DIV"),this.guide=document.createElement("DIV"),this.eventManager=f(this),this.pressed=null,this.dblclick=0,this.autoresizeTimeout=null,this.manualColumnWidths=[],c(this.handle,"manualColumnResizer"),c(this.guide,"manualColumnResizerGuide")},v=w;$traceurRuntime.createClass(w,{isEnabled:function(){return this.hot.getSettings().manualColumnResize},enablePlugin:function(){var e=this;if(!this.enabled){this.manualColumnWidths=[];var t=this.hot.getSettings().manualColumnResize,n=this.loadManualColumnWidths();this.addHook("modifyColWidth",function(t,n){return e.onModifyColWidth(t,n)}),"undefined"!=typeof n?this.manualColumnWidths=n:Array.isArray(t)?this.manualColumnWidths=t:this.manualColumnWidths=[],Handsontable.hooks.register("beforeColumnResize"),Handsontable.hooks.register("afterColumnResize"),this.bindEvents(),$traceurRuntime.superGet(this,v.prototype,"enablePlugin").call(this)}},updatePlugin:function(){var e=this.hot.getSettings().manualColumnResize;Array.isArray(e)?this.manualColumnWidths=e:this.manualColumnWidths=[]},disablePlugin:function(){$traceurRuntime.superGet(this,v.prototype,"disablePlugin").call(this)},saveManualColumnWidths:function(){this.hot.runHooks("persistentStateSave","manualColumnWidths",this.manualColumnWidths)},loadManualColumnWidths:function(){var e={};return this.hot.runHooks("persistentStateLoad","manualColumnWidths",e),e.value},setupHandlePosition:function(e){this.currentTH=e;var t=this.hot.view.wt.wtTable.getCoords(e).col;if(t>=0){var n=this.currentTH.getBoundingClientRect();this.currentCol=t,this.startOffset=n.left-6,this.startWidth=parseInt(n.width,10),this.handle.style.top=n.top+"px",this.handle.style.left=this.startOffset+this.startWidth+"px",this.hot.rootElement.appendChild(this.handle)}},refreshHandlePosition:function(){this.handle.style.left=this.startOffset+this.currentWidth+"px"},setupGuidePosition:function(){c(this.handle,"active"),c(this.guide,"active"),this.guide.style.top=this.handle.style.top,this.guide.style.left=this.handle.style.left,this.guide.style.height=this.hot.view.maximumVisibleElementHeight(0)+"px",this.hot.rootElement.appendChild(this.guide)},refreshGuidePosition:function(){this.guide.style.left=this.handle.style.left},hideHandleAndGuide:function(){h(this.handle,"active"),h(this.guide,"active")},checkIfColumnHeader:function(e){return"BODY"!=e.tagName?"THEAD"==e.parentNode.tagName?!0:(e=e.parentNode,this.checkIfColumnHeader(e)):!1},getTHFromTargetElement:function(e){return"TABLE"!=e.tagName?"TH"==e.tagName?e:this.getTHFromTargetElement(e.parentNode):null},onMouseOver:function(e){if(this.checkIfColumnHeader(e.target)){var t=this.getTHFromTargetElement(e.target);if(!t)return;var n=t.getAttribute("colspan");!t||null!==n&&1!==n||this.pressed||this.setupHandlePosition(t)}},afterMouseDownTimeout:function(){if(this.dblclick>=2){var e=this.hot.runHooks("beforeColumnResize",this.currentCol,this.newSize,!0);void 0!==e&&(this.newSize=e),this.setManualSize(this.currentCol,this.newSize),this.hot.forceFullRender=!0,this.hot.view.render(),this.hot.view.wt.wtOverlays.adjustElementsSize(!0),this.hot.runHooks("afterColumnResize",this.currentCol,this.newSize,!0)}this.dblclick=0,this.autoresizeTimeout=null},onMouseDown:function(e){var t=this;d(e.target,"manualColumnResizer")&&(this.setupGuidePosition(),this.pressed=this.hot,null===this.autoresizeTimeout&&(this.autoresizeTimeout=setTimeout(function(){return t.afterMouseDownTimeout()},500),this.hot._registerTimeout(this.autoresizeTimeout)),this.dblclick++,this.startX=p(e),this.newSize=this.startWidth)},onMouseMove:function(e){this.pressed&&(this.currentWidth=this.startWidth+(p(e)-this.startX),this.newSize=this.setManualSize(this.currentCol,this.currentWidth),this.refreshHandlePosition(),this.refreshGuidePosition())},onMouseUp:function(e){this.pressed&&(this.hideHandleAndGuide(),this.pressed=!1,this.newSize!=this.startWidth&&(this.hot.runHooks("beforeColumnResize",this.currentCol,this.newSize),this.hot.forceFullRender=!0,this.hot.view.render(),this.hot.view.wt.wtOverlays.adjustElementsSize(!0),this.saveManualColumnWidths(),this.hot.runHooks("afterColumnResize",this.currentCol,this.newSize)),this.setupHandlePosition(this.currentTH))},bindEvents:function(){var e=this;this.eventManager.addEventListener(this.hot.rootElement,"mouseover",function(t){return e.onMouseOver(t)}),this.eventManager.addEventListener(this.hot.rootElement,"mousedown",function(t){return e.onMouseDown(t)}),this.eventManager.addEventListener(window,"mousemove",function(t){return e.onMouseMove(t)}),this.eventManager.addEventListener(window,"mouseup",function(t){return e.onMouseUp(t)})},setManualSize:function(e,t){return t=Math.max(t,20),e=this.hot.runHooks("modifyCol",e),this.manualColumnWidths[e]=t,t},onModifyColWidth:function(e,t){return this.enabled&&(t=this.hot.runHooks("modifyCol",t),this.hot.getSettings().manualColumnResize&&this.manualColumnWidths[t])?this.manualColumnWidths[t]:e}},{},a),m("manualColumnResize",w)},{"_base.js":58,eventManager:41,"helpers/dom/element":45,"helpers/dom/event":46,plugins:57}],79:[function(e,t,n){"use strict";function o(){function e(e){var t=this;p=e;var n=this.view.wt.wtTable.getCoords(e).row;if(n>=0){f=n;var o=p.getBoundingClientRect();a=o.top,m.style.top=a+"px",m.style.left=o.left+"px",t.rootElement.appendChild(m)}}function t(e,t){var n=e.getBoundingClientRect(),o=6;t>0?m.style.top=n.top+n.height-o+"px":m.style.top=n.top+"px"}function n(){var e=this;u(m,"active"),u(w,"active");var t=p.getBoundingClientRect();w.style.width=e.view.maximumVisibleElementWidth(0)+"px",w.style.height=t.height+"px",w.style.top=a+"px",w.style.left=m.style.left,e.rootElement.appendChild(w)}function o(e){w.style.top=a+e+"px"}function r(){d(m,"active"),d(w,"active")}var i,s,l,a,f,p,m=document.createElement("DIV"),w=document.createElement("DIV"),v=h(this);m.className="manualRowMover",w.className="manualRowMoverGuide";var b=function(){var e=this;Handsontable.hooks.run(e,"persistentStateSave","manualRowPositions",e.manualRowPositions)},C=function(){var e=this,t={};return Handsontable.hooks.run(e,"persistentStateLoad","manualRowPositions",t),t.value},y=function(e){return"BODY"!=e.tagName?"TBODY"==e.parentNode.tagName?!0:(e=e.parentNode,y(e)):!1},R=function(e){return"TABLE"!=e.tagName?"TH"==e.tagName?e:R(e.parentNode):null},E=function(){var a,u=this;v.addEventListener(u.rootElement,"mouseover",function(n){if(y(n.target)){var o=R(n.target);o&&(a?(s=u.view.wt.wtTable.getCoords(o).row,t(o,s-i)):e.call(u,o))}}),v.addEventListener(u.rootElement,"mousedown",function(e){c(e.target,"manualRowMover")&&(l=g(e),n.call(u),a=u,i=f,s=f)}),v.addEventListener(window,"mousemove",function(e){a&&o(g(e)-l)}),v.addEventListener(window,"mouseup",function(t){a&&(r(),a=!1,T(u.manualRowPositions,u.countRows()),u.manualRowPositions.splice(s,0,u.manualRowPositions.splice(i,1)[0]),Handsontable.hooks.run(u,"beforeRowMove",i,s),u.forceFullRender=!0,u.view.render(),b.call(u),Handsontable.hooks.run(u,"afterRowMove",i,s),e.call(u,p))}),u.addHook("afterDestroy",S)},S=function(){v.clear()},T=function(e,t){if(e.lengthn;n++)e[n]=n};this.beforeInit=function(){this.manualRowPositions=[]},this.init=function(e){var t=this,n=!!t.getSettings().manualRowMove;if(n){var o=t.getSettings().manualRowMove,r=C.call(t);"undefined"==typeof t.manualRowPositionsPluginUsages?t.manualRowPositionsPluginUsages=["manualColumnMove"]:t.manualRowPositionsPluginUsages.push("manualColumnMove"),"undefined"!=typeof r?this.manualRowPositions=r:Array.isArray(o)?this.manualRowPositions=o:this.manualRowPositions=[],("afterInit"===e||"afterUpdateSettings"===e&&0===v.context.eventListeners.length)&&(E.call(this),this.manualRowPositions.length>0&&(t.forceFullRender=!0,t.render()))}else{var i=t.manualRowPositionsPluginUsages?t.manualRowPositionsPluginUsages.indexOf("manualColumnMove"):-1;i>-1&&(S.call(this),t.manualRowPositions=[],t.manualRowPositionsPluginUsages[i]=void 0)}},this.modifyRow=function(e){var t=this;return t.getSettings().manualRowMove?("undefined"==typeof t.manualRowPositions[e]&&T(this.manualRowPositions,e+1),t.manualRowPositions[e]):e}}Object.defineProperties(n,{ManualRowMove:{get:function(){return o}},__esModule:{value:!0}});var r,i,s,l,a=(r=e("helpers/dom/element"),r&&r.__esModule&&r||{"default":r}),u=a.addClass,c=a.hasClass,d=a.removeClass,h=(i=e("eventManager"),i&&i.__esModule&&i||{"default":i}).eventManager,f=(s=e("helpers/dom/event"),s&&s.__esModule&&s||{"default":s}),g=(f.pageX,f.pageY),p=((l=e("plugins"),l&&l.__esModule&&l||{"default":l}).registerPlugin,new o);Handsontable.hooks.add("beforeInit",p.beforeInit),Handsontable.hooks.add("afterInit",function(){p.init.call(this,"afterInit")}),Handsontable.hooks.add("afterUpdateSettings",function(){p.init.call(this,"afterUpdateSettings")}),Handsontable.hooks.add("modifyRow",p.modifyRow),Handsontable.hooks.register("beforeRowMove"),Handsontable.hooks.register("afterRowMove")},{eventManager:41,"helpers/dom/element":45,"helpers/dom/event":46,plugins:57}],80:[function(e,t,n){"use strict";Object.defineProperties(n,{ManualRowResize:{get:function(){return w}},__esModule:{value:!0}});var o,r,i,s,l,a=(o=e("_base.js"),o&&o.__esModule&&o||{"default":o})["default"],u=(r=e("helpers/dom/element"),r&&r.__esModule&&r||{"default":r}),c=u.addClass,d=u.hasClass,h=u.removeClass,f=(i=e("eventManager"),i&&i.__esModule&&i||{"default":i}).eventManager,g=(s=e("helpers/dom/event"),s&&s.__esModule&&s||{"default":s}),p=(g.pageX,g.pageY),m=(l=e("plugins"),l&&l.__esModule&&l||{"default":l}).registerPlugin,w=function(e){$traceurRuntime.superConstructor(v).call(this,e),this.currentTH=null,this.currentRow=null,this.currentHeight=null,this.newSize=null,this.startY=null,this.startHeight=null,this.startOffset=null,this.handle=document.createElement("DIV"),this.guide=document.createElement("DIV"),this.eventManager=f(this),this.pressed=null,this.dblclick=0,this.autoresizeTimeout=null,this.manualRowHeights=[],c(this.handle,"manualRowResizer"),c(this.guide,"manualRowResizerGuide")},v=w;$traceurRuntime.createClass(w,{isEnabled:function(){return this.hot.getSettings().manualRowResize},enablePlugin:function(){var e=this;if(!this.enabled){this.manualRowHeights=[];var t=this.hot.getSettings().manualRowResize,n=this.loadManualRowHeights();"undefined"!=typeof n?this.manualRowHeights=n:Array.isArray(t)?this.manualRowHeights=t:this.manualRowHeights=[],this.addHook("modifyRowHeight",function(t,n){return e.onModifyRowHeight(t,n)}),Handsontable.hooks.register("beforeRowResize"),Handsontable.hooks.register("afterRowResize"),this.bindEvents(),$traceurRuntime.superGet(this,v.prototype,"enablePlugin").call(this)}},updatePlugin:function(){var e=this.hot.getSettings().manualRowResize;Array.isArray(e)?this.manualRowHeights=e:this.manualRowHeights=[]},disablePlugin:function(){$traceurRuntime.superGet(this,v.prototype,"disablePlugin").call(this)},saveManualRowHeights:function(){this.hot.runHooks("persistentStateSave","manualRowHeights",this.manualRowHeights)},loadManualRowHeights:function(){var e={};return this.hot.runHooks("persistentStateLoad","manualRowHeights",e),e.value},setupHandlePosition:function(e){this.currentTH=e;var t=this.hot.view.wt.wtTable.getCoords(e).row;if(t>=0){var n=this.currentTH.getBoundingClientRect();this.currentRow=t,this.startOffset=n.top-6,this.startHeight=parseInt(n.height,10),this.handle.style.left=n.left+"px",this.handle.style.top=this.startOffset+this.startHeight+"px",this.hot.rootElement.appendChild(this.handle)}},refreshHandlePosition:function(){this.handle.style.top=this.startOffset+this.currentHeight+"px"},setupGuidePosition:function(){c(this.handle,"active"),c(this.guide,"active"),this.guide.style.top=this.handle.style.top,this.guide.style.left=this.handle.style.left,this.guide.style.width=this.hot.view.maximumVisibleElementWidth(0)+"px",this.hot.rootElement.appendChild(this.guide)},refreshGuidePosition:function(){this.guide.style.top=this.handle.style.top},hideHandleAndGuide:function(){h(this.handle,"active"),h(this.guide,"active")},checkIfRowHeader:function(e){return"BODY"!=e.tagName?"TBODY"==e.parentNode.tagName?!0:(e=e.parentNode,this.checkIfRowHeader(e)):!1},getTHFromTargetElement:function(e){return"TABLE"!=e.tagName?"TH"==e.tagName?e:this.getTHFromTargetElement(e.parentNode):null},onMouseOver:function(e){if(this.checkIfRowHeader(e.target)){var t=this.getTHFromTargetElement(e.target);t&&(this.pressed||this.setupHandlePosition(t))}},afterMouseDownTimeout:function(){if(this.dblclick>=2){var e=this.hot.runHooks("beforeRowResize",this.currentRow,this.newSize,!0);void 0!==e&&(this.newSize=e),this.setManualSize(this.currentRow,this.newSize),this.hot.forceFullRender=!0,this.hot.view.render(),this.hot.view.wt.wtOverlays.adjustElementsSize(!0),this.hot.runHooks("afterRowResize",this.currentRow,this.newSize,!0)}this.dblclick=0,this.autoresizeTimeout=null},onMouseDown:function(e){var t=this;d(e.target,"manualRowResizer")&&(this.setupGuidePosition(),this.pressed=this.hot,null==this.autoresizeTimeout&&(this.autoresizeTimeout=setTimeout(function(){return t.afterMouseDownTimeout()},500),this.hot._registerTimeout(this.autoresizeTimeout)),this.dblclick++,this.startY=p(e),this.newSize=this.startHeight)},onMouseMove:function(e){this.pressed&&(this.currentHeight=this.startHeight+(p(e)-this.startY),this.newSize=this.setManualSize(this.currentRow,this.currentHeight),this.refreshHandlePosition(),this.refreshGuidePosition())},onMouseUp:function(e){this.pressed&&(this.hideHandleAndGuide(),this.pressed=!1,this.newSize!=this.startHeight&&(this.hot.runHooks("beforeRowResize",this.currentRow,this.newSize),this.hot.forceFullRender=!0,this.hot.view.render(),this.hot.view.wt.wtOverlays.adjustElementsSize(!0),this.saveManualRowHeights(),this.hot.runHooks("afterRowResize",this.currentRow,this.newSize)),this.setupHandlePosition(this.currentTH))},bindEvents:function(){var e=this;this.eventManager.addEventListener(this.hot.rootElement,"mouseover",function(t){return e.onMouseOver(t)}),this.eventManager.addEventListener(this.hot.rootElement,"mousedown",function(t){return e.onMouseDown(t)}),this.eventManager.addEventListener(window,"mousemove",function(t){return e.onMouseMove(t)}),this.eventManager.addEventListener(window,"mouseup",function(t){return e.onMouseUp(t)})},setManualSize:function(e,t){return e=this.hot.runHooks("modifyRow",e),this.manualRowHeights[e]=t,t},onModifyRowHeight:function(e,t){if(this.enabled){var n=this.hot.getPlugin("autoRowSize"),o=n?n.heights[t]:null;t=this.hot.runHooks("modifyRow",t);var r=this.manualRowHeights[t];if(void 0!==r&&(r===o||r>(e||0)))return r}return e}},{},a),m("manualRowResize",w)},{"_base.js":58,eventManager:41,"helpers/dom/element":45,"helpers/dom/event":46,plugins:57}],81:[function(e,t,n){"use strict";function o(){var e=[];return e.getInfo=function(e,t){for(var n=0,o=this.length;o>n;n++)if(this[n].row<=e&&this[n].row+this[n].rowspan-1>=e&&this[n].col<=t&&this[n].col+this[n].colspan-1>=t)return this[n]},e.setInfo=function(e){for(var t=0,n=this.length;n>t;t++)if(this[t].row===e.row&&this[t].col===e.col)return void(this[t]=e);this.push(e)},e.removeInfo=function(e,t){for(var n=0,o=this.length;o>n;n++)if(this[n].row===e&&this[n].col===t){this.splice(n,1);break}},e}function r(e){if(this.mergedCellInfoCollection=new o,Array.isArray(e))for(var t=0,n=e.length;n>t;t++)this.mergedCellInfoCollection.setInfo(e[t])}function i(e,t){var n=this.getSettings().mergeCells;if(n&&!this.selection.isMultiple()){var o=this.mergeCells.mergedCellInfoCollection.getInfo(e[0],e[1]);o&&(e[0]=o.row,e[1]=o.col,e[2]=o.row+o.rowspan-1,e[3]=o.col+o.colspan-1)}}function s(e,t){this.mergeCells&&this.mergeCells.shiftCollection("right",e,t)}function l(e,t){this.mergeCells&&this.mergeCells.shiftCollection("left",e,t)}function a(e,t){this.mergeCells&&this.mergeCells.shiftCollection("down",e,t)}function u(e,t){this.mergeCells&&this.mergeCells.shiftCollection("up",e,t)}Object.defineProperties(n,{MergeCells:{get:function(){return r}},__esModule:{value:!0}});var c,d,h,f,g,p=((c=e("plugins"),c&&c.__esModule&&c||{"default":c}).registerPlugin,(d=e("helpers/dom/event"),d&&d.__esModule&&d||{"default":d}).stopImmediatePropagation),m=(h=e("3rdparty/walkontable/src/cell/coords"),h&&h.__esModule&&h||{"default":h}).WalkontableCellCoords,w=(f=e("3rdparty/walkontable/src/cell/range"),f&&f.__esModule&&f||{"default":f}).WalkontableCellRange,v=(g=e("3rdparty/walkontable/src/table"),g&&g.__esModule&&g||{"default":g}).WalkontableTable;r.prototype.canMergeRange=function(e){return!e.isSingle()},r.prototype.mergeRange=function(e){if(this.canMergeRange(e)){var t=e.getTopLeftCorner(),n=e.getBottomRightCorner(),o={};o.row=t.row,o.col=t.col,o.rowspan=n.row-t.row+1,o.colspan=n.col-t.col+1,this.mergedCellInfoCollection.setInfo(o)}},r.prototype.mergeOrUnmergeSelection=function(e){var t=this.mergedCellInfoCollection.getInfo(e.from.row,e.from.col);t?this.unmergeSelection(e.from):this.mergeSelection(e)},r.prototype.mergeSelection=function(e){this.mergeRange(e)},r.prototype.unmergeSelection=function(e){var t=this.mergedCellInfoCollection.getInfo(e.row,e.col);this.mergedCellInfoCollection.removeInfo(t.row,t.col)},r.prototype.applySpanProperties=function(e,t,n){var o=this.mergedCellInfoCollection.getInfo(t,n);o?o.row===t&&o.col===n?(e.setAttribute("rowspan",o.rowspan),e.setAttribute("colspan",o.colspan)):(e.removeAttribute("rowspan"),e.removeAttribute("colspan"),e.style.display="none"):(e.removeAttribute("rowspan"),e.removeAttribute("colspan"))},r.prototype.modifyTransform=function(e,t,n){var o=function(e,t){return t.row>=e.row&&t.row<=e.row+e.rowspan-1?!0:!1},r=function(e,t){return t.col>=e.col&&t.col<=e.col+e.colspan-1?!0:!1},i=function(e){return new m(t.to.row+e.row,t.to.col+e.col)},s={row:n.row,col:n.col};if("modifyTransformStart"==e){this.lastDesiredCoords||(this.lastDesiredCoords=new m(null,null));for(var l,a=new m(t.highlight.row,t.highlight.col),u=this.mergedCellInfoCollection.getInfo(a.row,a.col),c=0,d=this.mergedCellInfoCollection.length;d>c;c++){var h=this.mergedCellInfoCollection[c];if(h=new m(h.row+h.rowspan-1,h.col+h.colspan-1),t.includes(h)){l=!0;break}}if(u){var f=new m(u.row,u.col),g=new m(u.row+u.rowspan-1,u.col+u.colspan-1),p=new w(f,f,g);p.includes(this.lastDesiredCoords)||(this.lastDesiredCoords=new m(null,null)),s.row=this.lastDesiredCoords.row?this.lastDesiredCoords.row-a.row:s.row,s.col=this.lastDesiredCoords.col?this.lastDesiredCoords.col-a.col:s.col,n.row>0?s.row=u.row+u.rowspan-1-a.row+n.row:n.row<0&&(s.row=a.row-u.row+n.row),n.col>0?s.col=u.col+u.colspan-1-a.col+n.col:n.col<0&&(s.col=a.col-u.col+n.col)}var v=new m(t.highlight.row+s.row,t.highlight.col+s.col),b=this.mergedCellInfoCollection.getInfo(v.row,v.col);b&&(this.lastDesiredCoords=v,s={row:b.row-a.row,col:b.col-a.col})}else if("modifyTransformEnd"==e)for(var c=0,d=this.mergedCellInfoCollection.length;d>c;c++){var C=this.mergedCellInfoCollection[c],f=new m(C.row,C.col),g=new m(C.row+C.rowspan-1,C.col+C.colspan-1),y=new w(f,f,g),R=t.getBordersSharedWith(y);if(y.isEqual(t))t.setDirection("NW-SE");else if(R.length>0){var E=t.highlight.isEqual(y.from);R.indexOf("top")>-1?t.to.isSouthEastOf(y.from)&&E?t.setDirection("NW-SE"):t.to.isSouthWestOf(y.from)&&E&&t.setDirection("NE-SW"):R.indexOf("bottom")>-1&&(t.to.isNorthEastOf(y.from)&&E?t.setDirection("SW-NE"):t.to.isNorthWestOf(y.from)&&E&&t.setDirection("SE-NW"))}var v=i(s),S=o(C,v),T=r(C,v);t.includesRange(y)&&(y.includes(v)||S||T)&&(S&&(s.row<0?s.row-=C.rowspan-1:s.row>0&&(s.row+=C.rowspan-1)),T&&(s.col<0?s.col-=C.colspan-1:s.col>0&&(s.col+=C.colspan-1)))}0!==s.row&&(n.row=s.row),0!==s.col&&(n.col=s.col)},r.prototype.shiftCollection=function(e,t,n){var o=[0,0];switch(e){case"right":o[0]+=1;break;case"left":o[0]-=1;break;case"down":o[1]+=1;break;case"up":o[1]-=1}for(var r=0;rn;n++)e.mergeCells.mergedCellInfoCollection.setInfo(t[n])}else e.mergeCells=new r(t);else e.mergeCells&&(e.mergeCells.mergedCellInfoCollection=new o)},R=function(e){if(this.mergeCells){var t=(e.ctrlKey||e.metaKey)&&!e.altKey;t&&77===e.keyCode&&(this.mergeCells.mergeOrUnmergeSelection(this.getSelectedRange()),this.render(), -p(e))}},E=function(e){this.getSettings().mergeCells&&(e.items.push(Handsontable.plugins.ContextMenu.SEPARATOR),e.items.push({key:"mergeCells",name:function(){var e=this.getSelected(),t=this.mergeCells.mergedCellInfoCollection.getInfo(e[0],e[1]);return t?"Unmerge cells":"Merge cells"},callback:function(){this.mergeCells.mergeOrUnmergeSelection(this.getSelectedRange()),this.render()},disabled:function(){return!1}}))},S=function(e,t,n,o,r,i){this.mergeCells&&this.mergeCells.applySpanProperties(e,t,n)},T=function(e){return function(t){var n=this.getSettings().mergeCells;if(n){var o=this.getSelectedRange();if(this.mergeCells.modifyTransform(e,o,t),"modifyTransformEnd"===e){var r=this.countRows(),i=this.countCols();o.from.row<0?o.from.row=0:o.from.row>0&&o.from.row>=r&&(o.from.row=o.from-1),o.from.col<0?o.from.col=0:o.from.col>0&&o.from.col>=i&&(o.from.col=i-1)}}}},O=function(e){this.lastDesiredCoords=null;var t=this.getSettings().mergeCells;if(t){var n=this.getSelectedRange();n.highlight=new m(n.highlight.row,n.highlight.col),n.to=e;var o=!1;do{o=!1;for(var r=0,i=this.mergeCells.mergedCellInfoCollection.length;i>r;r++){var s=this.mergeCells.mergedCellInfoCollection[r],l=new m(s.row,s.col),a=new m(s.row+s.rowspan-1,s.col+s.colspan-1),u=new w(l,l,a);n.expandByRange(u)&&(e.row=n.to.row,e.col=n.to.col,o=!0)}}while(o)}},_=function(e,t){if(t&&"area"==t){var n=this.getSettings().mergeCells;if(n)for(var o=this.getSelectedRange(),r=new w(o.from,o.from,o.from),i=new w(o.to,o.to,o.to),s=0,l=this.mergeCells.mergedCellInfoCollection.length;l>s;s++){var a=this.mergeCells.mergedCellInfoCollection[s],u=new m(a.row,a.col),c=new m(a.row+a.rowspan-1,a.col+a.colspan-1),d=new w(u,u,c);r.expandByRange(d)&&(e[0]=r.from.row,e[1]=r.from.col),i.expandByRange(d)&&(e[2]=i.from.row,e[3]=i.from.col)}}},M=function(e,t,n){var o=this.getSettings().mergeCells;if(o){var r=this.mergeCells.mergedCellInfoCollection.getInfo(e,t);!r||r.row==e&&r.col==t||(n.copyable=!1)}},H=function(e){var t=this.getSettings().mergeCells;if(t)for(var n,o=this.countCols(),r=0;o>r;r++){if(n=this.mergeCells.mergedCellInfoCollection.getInfo(e.startRow,r),n&&n.rowe.endRow)return e.endRow=i,H.call(this,e)}}},k=function(e){var t=this.getSettings().mergeCells;if(t)for(var n,o=this.countRows(),r=0;o>r;r++){if(n=this.mergeCells.mergedCellInfoCollection.getInfo(r,e.startColumn),n&&n.cole.endColumn)return e.endColumn=i,k.call(this,e)}}},A=function(e){if(e&&this.mergeCells){var t=this.mergeCells.mergedCellInfoCollection,n=this.getSelectedRange();for(var o in t)if(n.highlight.row==t[o].row&&n.highlight.col==t[o].col&&n.to.row==t[o].row+t[o].rowspan-1&&n.to.col==t[o].col+t[o].colspan-1)return!1}return e};Handsontable.hooks.add("beforeInit",b),Handsontable.hooks.add("afterInit",C),Handsontable.hooks.add("afterUpdateSettings",y),Handsontable.hooks.add("beforeKeyDown",R),Handsontable.hooks.add("modifyTransformStart",T("modifyTransformStart")),Handsontable.hooks.add("modifyTransformEnd",T("modifyTransformEnd")),Handsontable.hooks.add("beforeSetRangeEnd",O),Handsontable.hooks.add("beforeDrawBorders",_),Handsontable.hooks.add("afterIsMultipleSelection",A),Handsontable.hooks.add("afterRenderer",S),Handsontable.hooks.add("afterContextMenuDefaultOptions",E),Handsontable.hooks.add("afterGetCellMeta",M),Handsontable.hooks.add("afterViewportRowCalculatorOverride",H),Handsontable.hooks.add("afterViewportColumnCalculatorOverride",k),Handsontable.hooks.add("afterAutofillApplyValues",i),Handsontable.hooks.add("afterCreateCol",s),Handsontable.hooks.add("afterRemoveCol",l),Handsontable.hooks.add("afterCreateRow",a),Handsontable.hooks.add("afterRemoveRow",u),Handsontable.MergeCells=r},{"3rdparty/walkontable/src/cell/coords":5,"3rdparty/walkontable/src/cell/range":6,"3rdparty/walkontable/src/table":20,"helpers/dom/event":46,plugins:57}],82:[function(e,t,n){"use strict";Object.defineProperties(n,{MultipleSelectionHandles:{get:function(){return g}},__esModule:{value:!0}});var o,r,i,s,l=(o=e("helpers/dom/element"),o&&o.__esModule&&o||{"default":o}),a=l.getWindowScrollTop,u=l.hasClass,c=l.getWindowScrollLeft,d=(r=e("_base"),r&&r.__esModule&&r||{"default":r})["default"],h=(i=e("eventManager"),i&&i.__esModule&&i||{"default":i}).EventManager,f=(s=e("plugins"),s&&s.__esModule&&s||{"default":s}).registerPlugin,g=function(e){$traceurRuntime.superConstructor(p).call(this,e),this.dragged=[],this.eventManager=null,this.lastSetCell=null},p=g;$traceurRuntime.createClass(g,{isEnabled:function(){return Handsontable.mobileBrowser},enablePlugin:function(){this.enabled||(this.eventManager||(this.eventManager=new h(this)),this.registerListeners(),$traceurRuntime.superGet(this,p.prototype,"enablePlugin").call(this))},registerListeners:function(){function e(e){if(1===t.dragged.length)return t.dragged.splice(0,t.dragged.length),!0;var n=t.dragged.indexOf(e);return-1==n?!1:void(0===n?t.dragged=t.dragged.slice(0,1):1==n&&(t.dragged=t.dragged.slice(-1)))}var t=this;this.eventManager.addEventListener(this.hot.rootElement,"touchstart",function(e){var n;return u(e.target,"topLeftSelectionHandle-HitArea")?(n=t.hot.getSelectedRange(),t.dragged.push("topLeft"),t.touchStartRange={width:n.getWidth(),height:n.getHeight(),direction:n.getDirection()},e.preventDefault(),!1):u(e.target,"bottomRightSelectionHandle-HitArea")?(n=t.hot.getSelectedRange(),t.dragged.push("bottomRight"),t.touchStartRange={width:n.getWidth(),height:n.getHeight(),direction:n.getDirection()},e.preventDefault(),!1):void 0}),this.eventManager.addEventListener(this.hot.rootElement,"touchend",function(n){return u(n.target,"topLeftSelectionHandle-HitArea")?(e.call(t,"topLeft"),t.touchStartRange=void 0,n.preventDefault(),!1):u(n.target,"bottomRightSelectionHandle-HitArea")?(e.call(t,"bottomRight"),t.touchStartRange=void 0,n.preventDefault(),!1):void 0}),this.eventManager.addEventListener(this.hot.rootElement,"touchmove",function(e){var n,o,r,i,s,l,u,d=a(),h=c();0!==t.dragged.length&&(n=document.elementFromPoint(e.touches[0].screenX-h,e.touches[0].screenY-d),n&&n!==t.lastSetCell&&(("TD"==n.nodeName||"TH"==n.nodeName)&&(o=t.hot.getCoords(n),-1==o.col&&(o.col=0),r=t.hot.getSelectedRange(),i=r.getWidth(),s=r.getHeight(),l=r.getDirection(),1==i&&1==s&&t.hot.selection.setRangeEnd(o),u=t.getCurrentRangeCoords(r,o,t.touchStartRange.direction,l,t.dragged[0]),null!==u.start&&t.hot.selection.setRangeStart(u.start),t.hot.selection.setRangeEnd(u.end),t.lastSetCell=n),e.preventDefault()))})},getCurrentRangeCoords:function(e,t,n,o,r){var i=e.getTopLeftCorner(),s=e.getBottomRightCorner(),l=e.getBottomLeftCorner(),a=e.getTopRightCorner(),u={start:null,end:null};switch(n){case"NE-SW":switch(o){case"NE-SW":case"NW-SE":u="topLeft"==r?{start:new WalkontableCellCoords(t.row,e.highlight.col),end:new WalkontableCellCoords(l.row,t.col)}:{start:new WalkontableCellCoords(e.highlight.row,t.col),end:new WalkontableCellCoords(t.row,i.col)};break;case"SE-NW":"bottomRight"==r&&(u={start:new WalkontableCellCoords(s.row,t.col),end:new WalkontableCellCoords(t.row,i.col)})}break;case"NW-SE":switch(o){case"NE-SW":"topLeft"==r?u={start:t,end:l}:u.end=t;break;case"NW-SE":"topLeft"==r?u={start:t,end:s}:u.end=t;break;case"SE-NW":"topLeft"==r?u={start:t,end:i}:u.end=t;break;case"SW-NE":"topLeft"==r?u={start:t,end:a}:u.end=t}break;case"SW-NE":switch(o){case"NW-SE":u="bottomRight"==r?{start:new WalkontableCellCoords(t.row,i.col),end:new WalkontableCellCoords(l.row,t.col)}:{start:new WalkontableCellCoords(i.row,t.col),end:new WalkontableCellCoords(t.row,s.col)};break;case"SW-NE":u="topLeft"==r?{start:new WalkontableCellCoords(e.highlight.row,t.col),end:new WalkontableCellCoords(t.row,s.col)}:{start:new WalkontableCellCoords(t.row,i.col),end:new WalkontableCellCoords(i.row,t.col)};break;case"SE-NW":"bottomRight"==r?u={start:new WalkontableCellCoords(t.row,a.col),end:new WalkontableCellCoords(i.row,t.col)}:"topLeft"==r&&(u={start:l,end:t})}break;case"SE-NW":switch(o){case"NW-SE":case"NE-SW":case"SW-NE":"topLeft"==r&&(u.end=t);break;case"SE-NW":"topLeft"==r?u.end=t:u={start:t,end:i}}}return u},isDragged:function(){return this.dragged.length>0}},{},d),f("multipleSelectionHandles",g)},{_base:58,eventManager:41,"helpers/dom/element":45,plugins:57}],83:[function(e,t,n){"use strict";function o(){}function r(){var e=this,t=e.getSettings().observeChanges;t?(e.observer&&l.call(e),i.call(e),u.call(e)):t||l.call(e)}function i(){var e=this;e.observeChangesActive=!0,e.pauseObservingChanges=function(){e.observeChangesActive=!1},e.resumeObservingChanges=function(){e.observeChangesActive=!0},e.observedData=e.getSourceData(),e.observer=g.observe(e.observedData,function(t){e.observeChangesActive&&(s.call(e,t),e.render()),e.runHooks("afterChangesObserved")})}function s(e){function t(e){var t;return t=o(e),t=n(t)}function n(e){var t=[];return e.filter(function(e){var n=r(e.path);if(-1!=["add","remove"].indexOf(e.op)&&!isNaN(n.col)){if(-1!=t.indexOf(n.col))return!1;t.push(n.col)}return!0})}function o(e){return e.filter(function(e){return!/[\/]length/gi.test(e.path)})}function r(e){var t=e.match(/^\/(\d+)\/?(.*)?$/);return{row:parseInt(t[1],10),col:/^\d*$/.test(t[2])?parseInt(t[2],10):t[2]}}for(var i=this,s=t(e),l=0,a=s.length;a>l;l++){var u=s[l],c=r(u.path);switch(u.op){case"add":isNaN(c.col)?i.runHooks("afterCreateRow",c.row):i.runHooks("afterCreateCol",c.col);break;case"remove":isNaN(c.col)?i.runHooks("afterRemoveRow",c.row,1):i.runHooks("afterRemoveCol",c.col,1);break;case"replace":i.runHooks("afterChange",[c.row,c.col,null,u.value],"external")}}}function l(){var e=this;e.observer&&(a.call(e),c.call(e))}function a(){var e=this;g.unobserve(e.observedData,e.observer),delete e.observedData,delete e.observeChangesActive,delete e.pauseObservingChanges,delete e.resumeObservingChanges}function u(){var e=this;e.addHook("afterDestroy",l),e.addHook("afterCreateRow",d),e.addHook("afterRemoveRow",d),e.addHook("afterCreateCol",d),e.addHook("afterRemoveCol",d),e.addHook("afterChange",function(e,t){"loadData"!=t&&d.call(this)})}function c(){var e=this;e.removeHook("afterDestroy",l),e.removeHook("afterCreateRow",d),e.removeHook("afterRemoveRow",d),e.removeHook("afterCreateCol",d),e.removeHook("afterRemoveCol",d),e.removeHook("afterChange",d)}function d(){var e=this;e.pauseObservingChanges(),e.addHookOnce("afterChangesObserved",function(){e.resumeObservingChanges()})}Object.defineProperties(n,{ObserveChanges:{get:function(){return o}},__esModule:{value:!0}});var h,f,g=((h=e("plugins"),h&&h.__esModule&&h||{"default":h}).registerPlugin,(f=e("jsonpatch"),f&&f.__esModule&&f||{"default":f})["default"]);Handsontable.hooks.add("afterLoadData",r),Handsontable.hooks.add("afterUpdateSettings",r),Handsontable.hooks.register("afterChangesObserved")},{jsonpatch:"jsonpatch",plugins:57}],84:[function(e,t,n){"use strict";function o(e){var t,n=function(){window.localStorage[e+"__persistentStateKeys"]=JSON.stringify(t)},o=function(){var n=window.localStorage[e+"__persistentStateKeys"],o="string"==typeof n?JSON.parse(n):void 0;t=o?o:[]},r=function(){t=[],n()};o(),this.saveValue=function(o,r){window.localStorage[e+"_"+o]=JSON.stringify(r),-1==t.indexOf(o)&&(t.push(o),n())},this.loadValue=function(t,n){t="undefined"==typeof t?n:t;var o=window.localStorage[e+"_"+t];return"undefined"==typeof o?void 0:JSON.parse(o)},this.reset=function(t){window.localStorage.removeItem(e+"_"+t)},this.resetAll=function(){for(var n=0;nl;l++)for(var a=0;i>a;a++){var u=e.getDataAtCell(l,a),c=e.getCellMeta(l,a),d=c.search.callback||n,h=c.search.queryMethod||o,f=h(t,u);if(f){var g={row:l,col:a,data:u};s.push(g)}d&&d(e,l,a,u,f)}return s}},Handsontable.Search.DEFAULT_CALLBACK=function(e,t,n,o,r){e.getCellMeta(t,n).isSearchResult=r},Handsontable.Search.DEFAULT_QUERY_METHOD=function(e,t){return"undefined"!=typeof e&&null!=e&&e.toLowerCase&&0!==e.length?"undefined"==typeof t||null==t?!1:-1!=t.toString().toLowerCase().indexOf(e.toLowerCase()):!1},Handsontable.Search.DEFAULT_SEARCH_RESULT_CLASS="htSearchResult",Handsontable.Search.global=function(){var e=Handsontable.Search.DEFAULT_CALLBACK,t=Handsontable.Search.DEFAULT_QUERY_METHOD,n=Handsontable.Search.DEFAULT_SEARCH_RESULT_CLASS;return{getDefaultCallback:function(){return e},setDefaultCallback:function(t){e=t},getDefaultQueryMethod:function(){return t},setDefaultQueryMethod:function(e){t=e},getDefaultSearchResultClass:function(){return n},setDefaultSearchResultClass:function(e){n=e}}}(),Handsontable.SearchCellDecorator=function(e,t,n,o,r,i,s){var u=null!==s.search&&"object"==typeof s.search&&s.search.searchResultClass||Handsontable.Search.global.getDefaultSearchResultClass();s.isSearchResult?l(t,u):a(t,u)};var h=d("base");c("base",function(e,t,n,o,r,i,s){h.apply(this,arguments),Handsontable.SearchCellDecorator.apply(this,arguments)}),Handsontable.hooks.add("afterInit",o),Handsontable.hooks.add("afterUpdateSettings",o)},{"helpers/dom/element":45,renderers:88}],86:[function(e,t,n){"use strict";Object.defineProperties(n,{TouchScroll:{get:function(){return d}},__esModule:{value:!0}});var o,r,i,s=(o=e("helpers/dom/element"),o&&o.__esModule&&o||{"default":o}),l=s.addClass,a=s.removeClass,u=(r=e("_base"),r&&r.__esModule&&r||{"default":r})["default"],c=(i=e("plugins"),i&&i.__esModule&&i||{"default":i}).registerPlugin,d=function(e){var t=this;$traceurRuntime.superConstructor(h).call(this,e),this.hot.addHook("afterInit",function(){return t.afterInit()}),this.hot.addHook("afterUpdateSettings",function(){return t.onAfterUpdateSettings()}),this.scrollbars=[],this.clones=[]},h=d;$traceurRuntime.createClass(d,{afterInit:function(){this.registerEvents(),this.onAfterUpdateSettings()},onAfterUpdateSettings:function(){var e=this;this.hot.addHookOnce("afterRender",function(){var t=e.hot.view.wt.wtOverlays;e.scrollbars=[],e.scrollbars.push(t.topOverlay),t.bottomOverlay.clone&&e.scrollbars.push(t.bottomOverlay),e.scrollbars.push(t.leftOverlay),t.topLeftCornerOverlay&&e.scrollbars.push(t.topLeftCornerOverlay),t.bottomLeftCornerOverlay&&t.bottomLeftCornerOverlay.clone&&e.scrollbars.push(t.bottomLeftCornerOverlay),e.clones=[],t.topOverlay.needFullRender&&e.clones.push(t.topOverlay.clone.wtTable.holder.parentNode),t.bottomOverlay.needFullRender&&e.clones.push(t.bottomOverlay.clone.wtTable.holder.parentNode),t.leftOverlay.needFullRender&&e.clones.push(t.leftOverlay.clone.wtTable.holder.parentNode),t.topLeftCornerOverlay&&e.clones.push(t.topLeftCornerOverlay.clone.wtTable.holder.parentNode),t.bottomLeftCornerOverlay&&t.bottomLeftCornerOverlay.clone&&e.clones.push(t.bottomLeftCornerOverlay.clone.wtTable.holder.parentNode)})},registerEvents:function(){var e=this;this.hot.addHook("beforeTouchScroll",function(){return e.onBeforeTouchScroll()}),this.hot.addHook("afterMomentumScroll",function(){return e.onAfterMomentumScroll()})},onBeforeTouchScroll:function(){Handsontable.freezeOverlays=!0;for(var e=0,t=this.clones.length;t>e;e++)l(this.clones[e],"hide-tween")},onAfterMomentumScroll:function(){Handsontable.freezeOverlays=!1;for(var e=this,t=0,n=this.clones.length;n>t;t++)a(this.clones[t],"hide-tween");for(var o=0,r=this.clones.length;r>o;o++)l(this.clones[o],"show-tween");setTimeout(function(){for(var t=0,n=e.clones.length;n>t;t++)a(e.clones[t],"show-tween")},400);for(var i=0,s=this.scrollbars.length;s>i;i++)this.scrollbars[i].refresh(),this.scrollbars[i].resetFixedPosition();this.hot.view.wt.wtOverlays.syncScrollWithMaster()}},{},u),c("touchScroll",d)},{_base:58,"helpers/dom/element":45,plugins:57}],87:[function(e,t,n){"use strict";function o(){var e=this,t="undefined"==typeof e.getSettings().undo||e.getSettings().undo;t?e.undoRedo||(e.undoRedo=new Handsontable.UndoRedo(e),s(e),e.addHook("beforeKeyDown",r),e.addHook("afterChange",i)):e.undoRedo&&(delete e.undoRedo,l(e),e.removeHook("beforeKeyDown",r),e.removeHook("afterChange",i))}function r(e){var t=this,n=(e.ctrlKey||e.metaKey)&&!e.altKey;n&&(89===e.keyCode||e.shiftKey&&90===e.keyCode?(t.undoRedo.redo(),f(e)):90===e.keyCode&&(t.undoRedo.undo(),f(e)))}function i(e,t){var n=this;return"loadData"==t?n.undoRedo.clear():void 0}function s(e){e.undo=function(){return e.undoRedo.undo()},e.redo=function(){return e.undoRedo.redo()},e.isUndoAvailable=function(){return e.undoRedo.isUndoAvailable()},e.isRedoAvailable=function(){return e.undoRedo.isRedoAvailable()},e.clearUndo=function(){return e.undoRedo.clear()}}function l(e){delete e.undo,delete e.redo,delete e.isUndoAvailable,delete e.isRedoAvailable,delete e.clearUndo}var a,u,c=(a=e("helpers/object"),a&&a.__esModule&&a||{"default":a}),d=c.inherit,h=c.deepClone,f=(u=e("helpers/dom/event"),u&&u.__esModule&&u||{"default":u}).stopImmediatePropagation;Handsontable.UndoRedo=function(e){var t=this;this.instance=e,this.doneActions=[],this.undoneActions=[],this.ignoreNewActions=!1,e.addHook("afterChange",function(e,n){if(e){var o=new Handsontable.UndoRedo.ChangeAction(e);t.done(o)}}),e.addHook("afterCreateRow",function(e,n,o){if(!o){var r=new Handsontable.UndoRedo.CreateRowAction(e,n);t.done(r)}}),e.addHook("beforeRemoveRow",function(e,n){var o=t.instance.getSourceData();e=(o.length+e)%o.length;var r=o.slice(e,e+n),i=new Handsontable.UndoRedo.RemoveRowAction(e,r);t.done(i)}),e.addHook("afterCreateCol",function(e,n,o){if(!o){var r=new Handsontable.UndoRedo.CreateColumnAction(e,n);t.done(r)}}),e.addHook("beforeRemoveCol",function(n,o){var r=t.instance.getSourceData();n=(t.instance.countCols()+n)%t.instance.countCols();for(var i=[],s=0,l=r.length;l>s;s++)i[s]=r[s].slice(n,n+o);var a;Array.isArray(e.getSettings().colHeaders)&&(a=e.getSettings().colHeaders.slice(n,n+i.length));var u=new Handsontable.UndoRedo.RemoveColumnAction(n,i,a);t.done(u)}),e.addHook("beforeCellAlignment",function(e,n,o,r){var i=new Handsontable.UndoRedo.CellAlignmentAction(e,n,o,r);t.done(i)})},Handsontable.UndoRedo.prototype.done=function(e){this.ignoreNewActions||(this.doneActions.push(e),this.undoneActions.length=0)},Handsontable.UndoRedo.prototype.undo=function(){if(this.isUndoAvailable()){var e=this.doneActions.pop();this.ignoreNewActions=!0;var t=this;e.undo(this.instance,function(){t.ignoreNewActions=!1,t.undoneActions.push(e)})}},Handsontable.UndoRedo.prototype.redo=function(){if(this.isRedoAvailable()){var e=this.undoneActions.pop();this.ignoreNewActions=!0;var t=this;e.redo(this.instance,function(){t.ignoreNewActions=!1,t.doneActions.push(e)})}},Handsontable.UndoRedo.prototype.isUndoAvailable=function(){return this.doneActions.length>0},Handsontable.UndoRedo.prototype.isRedoAvailable=function(){return this.undoneActions.length>0},Handsontable.UndoRedo.prototype.clear=function(){this.doneActions.length=0,this.undoneActions.length=0},Handsontable.UndoRedo.Action=function(){},Handsontable.UndoRedo.Action.prototype.undo=function(){},Handsontable.UndoRedo.Action.prototype.redo=function(){},Handsontable.UndoRedo.ChangeAction=function(e){this.changes=e},d(Handsontable.UndoRedo.ChangeAction,Handsontable.UndoRedo.Action),Handsontable.UndoRedo.ChangeAction.prototype.undo=function(e,t){for(var n=h(this.changes),o=e.countEmptyRows(!0),r=e.countEmptyCols(!0),i=0,s=n.length;s>i;i++)n[i].splice(3,1);e.addHookOnce("afterChange",t),e.setDataAtRowProp(n,null,null,"undo");for(var i=0,s=n.length;s>i;i++)e.getSettings().minSpareRows&&n[i][0]+1+e.getSettings().minSpareRows===e.countRows()&&o==e.getSettings().minSpareRows&&(e.alter("remove_row",parseInt(n[i][0]+1,10),e.getSettings().minSpareRows),e.undoRedo.doneActions.pop()),e.getSettings().minSpareCols&&n[i][1]+1+e.getSettings().minSpareCols===e.countCols()&&r==e.getSettings().minSpareCols&&(e.alter("remove_col",parseInt(n[i][1]+1,10),e.getSettings().minSpareCols),e.undoRedo.doneActions.pop())},Handsontable.UndoRedo.ChangeAction.prototype.redo=function(e,t){for(var n=h(this.changes),o=0,r=n.length;r>o;o++)n[o].splice(2,1);e.addHookOnce("afterChange",t),e.setDataAtRowProp(n,null,null,"redo")},Handsontable.UndoRedo.CreateRowAction=function(e,t){this.index=e,this.amount=t},d(Handsontable.UndoRedo.CreateRowAction,Handsontable.UndoRedo.Action),Handsontable.UndoRedo.CreateRowAction.prototype.undo=function(e,t){var n=e.countRows(),o=e.getSettings().minSpareRows;this.index>=n&&this.index-or;r++)n=e.getSourceDataAtRow(r),o=[this.index,0],Array.prototype.push.apply(o,this.data[r]),Array.prototype.splice.apply(n,o);"undefined"!=typeof this.headers&&(o=[this.index,0],Array.prototype.push.apply(o,this.headers),Array.prototype.splice.apply(e.getSettings().colHeaders,o)),e.addHookOnce("afterRender",t),e.render()},Handsontable.UndoRedo.RemoveColumnAction.prototype.redo=function(e,t){e.addHookOnce("afterRemoveCol",t),e.alter("remove_col",this.index,this.amount)},Handsontable.hooks.add("afterInit",o),Handsontable.hooks.add("afterUpdateSettings",o)},{"helpers/dom/event":46,"helpers/object":50}],88:[function(e,t,n){"use strict";function o(e,t){var n;a[e]=t,n=l(e)+"Renderer",Handsontable.renderers[n]=t,Handsontable[n]=t}function r(e){if("function"==typeof e)return e;if("string"!=typeof e)throw Error('Only strings and functions can be passed as "renderer" parameter');if(!(e in a))throw Error('No editor registered under name "'+e+'"');return a[e]}function i(e){return e in a}Object.defineProperties(n,{registerRenderer:{get:function(){return o}},getRenderer:{get:function(){return r}},hasRenderer:{get:function(){return i}},__esModule:{value:!0}});var s,l=(s=e("helpers/string"),s&&s.__esModule&&s||{"default":s}).toUpperCaseFirst,a={};Handsontable.renderers=Handsontable.renderers||{},Handsontable.renderers.registerRenderer=o,Handsontable.renderers.getRenderer=r},{"helpers/string":52}],89:[function(e,t,n){"use strict";function o(e,t,n,o,r,i,s){s.className&&(t.className?t.className=t.className+" "+s.className:t.className=s.className),s.readOnly&&l(t,s.readOnlyCellClassName),s.valid===!1&&s.invalidCellClassName?l(t,s.invalidCellClassName):a(t,s.invalidCellClassName),s.wordWrap===!1&&s.noWordWrapClassName&&l(t,s.noWordWrapClassName),!i&&s.placeholder&&l(t,s.placeholderCellClassName)}Object.defineProperties(n,{cellDecorator:{get:function(){return o}},__esModule:{value:!0}});var r,i,s=(r=e("helpers/dom/element"),r&&r.__esModule&&r||{"default":r}),l=s.addClass,a=s.removeClass,u=(i=e("renderers"),i&&i.__esModule&&i||{"default":i}).registerRenderer;u("base",o),Handsontable.renderers.cellDecorator=o},{"helpers/dom/element":45,renderers:88}],90:[function(e,t,n){"use strict";function o(e,t,n,o,r,i,s){var l=(m.cloneNode(!0),w.cloneNode(!0));if(f("text")(e,t,n,o,r,i,s),t.appendChild(l),u(t,"htAutocomplete"),t.firstChild||t.appendChild(document.createTextNode(String.fromCharCode(160))),!e.acArrowListener){var a=d(e);e.acArrowListener=function(r){c(r.target,"htAutocompleteArrow")&&e.view.wt.getSetting("onCellDblClick",null,new p(n,o),t)},a.addEventListener(e.rootElement,"mousedown",e.acArrowListener),e.addHookOnce("afterDestroy",function(){a.destroy()})}}Object.defineProperties(n,{autocompleteRenderer:{get:function(){return o}},__esModule:{value:!0}});var r,i,s,l,a=(r=e("helpers/dom/element"),r&&r.__esModule&&r||{"default":r}),u=a.addClass,c=a.hasClass,d=(a.empty,(i=e("eventManager"),i&&i.__esModule&&i||{"default":i}).eventManager),h=(s=e("renderers"),s&&s.__esModule&&s||{"default":s}),f=h.getRenderer,g=h.registerRenderer,p=(l=e("3rdparty/walkontable/src/cell/coords"),l&&l.__esModule&&l||{"default":l}).WalkontableCellCoords,m=document.createElement("DIV");m.className="htAutocompleteWrapper";var w=document.createElement("DIV");w.className="htAutocompleteArrow",w.appendChild(document.createTextNode(String.fromCharCode(9660)));g("autocomplete",o)},{"3rdparty/walkontable/src/cell/coords":5,eventManager:41,"helpers/dom/element":45,renderers:88}],91:[function(e,t,n){"use strict";function o(e,t,n,o,l,a,u){function c(e){var t=[y.SPACE,y.ENTER,y.DELETE,y.BACKSPACE];-1===t.indexOf(e.keyCode)||T(e)||f(function(){S(e),e.preventDefault()}),(e.keyCode==y.SPACE||e.keyCode==y.ENTER)&&d(),(e.keyCode==y.DELETE||e.keyCode==y.BACKSPACE)&&d(!1)}function d(){var e=void 0!==arguments[0]?arguments[0]:null;f(function(t){for(var n=0,o=t.length;o>n;n++){if(m(t[n],_)&&null===e)return;h(t[n],e)}})}function h(e){var t=void 0!==arguments[1]?arguments[1]:null;null===t?e.checked=!e.checked:e.checked=t,b.fireEvent(e,"change")}function f(t){for(var n=e.getSelectedRange(),o=n.getTopLeftCorner(),r=n.getBottomRightCorner(),i=o.row;i<=r.row;i++)for(var s=o.col;s<=r.col;s++){var l=e.getCell(i,s),a=e.getCellMeta(i,s),u=l.querySelectorAll("input[type=checkbox]");u.length>0&&!a.readOnly&&t(u)}}var b=new v(e),C=r(),R=u.label,M=!1;if("undefined"==typeof u.checkedTemplate&&(u.checkedTemplate=!0),"undefined"==typeof u.uncheckedTemplate&&(u.uncheckedTemplate=!1),g(t),a===u.checkedTemplate||w(a,u.checkedTemplate)?C.checked=!0:a===u.uncheckedTemplate||w(a,u.uncheckedTemplate)?C.checked=!1:null===a?p(C,"noValue"):(C.style.display="none",p(C,_),M=!0),!M&&R){var H="";R.value?H="function"==typeof R.value?R.value.call(this,n,o,l,a):R.value:R.property&&(H=e.getDataAtRowProp(n,R.property));var k=i(H);"before"===R.position?k.appendChild(C):k.insertBefore(C,k.firstChild),C=k}t.appendChild(C),M&&t.appendChild(document.createTextNode("#bad-value#")),u.readOnly?b.addEventListener(C,"click",s):(b.addEventListener(C,"mousedown",E),b.addEventListener(C,"mouseup",E),b.addEventListener(C,"change",function(t){e.setDataAtRowProp(n,l,t.target.checked?u.checkedTemplate:u.uncheckedTemplate)})),O.has(e)||(O.set(e,!0),e.addHook("beforeKeyDown",c))}function r(){var e=document.createElement("input");return e.className="htCheckboxRendererInput",e.type="checkbox",e.setAttribute("autocomplete","off"),e.cloneNode(!1)}function i(e){var t=document.createElement("label");return t.className="htCheckboxRendererLabel",t.appendChild(document.createTextNode(e)),t.cloneNode(!0)}function s(e){e.preventDefault()}Object.defineProperties(n,{checkboxRenderer:{get:function(){return o}},__esModule:{value:!0}});var l,a,u,c,d,h,f=(l=e("helpers/dom/element"),l&&l.__esModule&&l||{"default":l}),g=f.empty,p=f.addClass,m=f.hasClass,w=(a=e("helpers/string"),a&&a.__esModule&&a||{"default":a}).equalsIgnoreCase,v=(u=e("eventManager"),u&&u.__esModule&&u||{"default":u}).EventManager,b=(c=e("renderers"),c&&c.__esModule&&c||{"default":c}),C=(b.getRenderer,b.registerRenderer),y=(d=e("helpers/unicode"),d&&d.__esModule&&d||{"default":d}).KEY_CODES,R=(h=e("helpers/dom/event"),h&&h.__esModule&&h||{"default":h}),E=R.stopPropagation,S=R.stopImmediatePropagation,T=R.isImmediatePropagationStopped,O=new WeakMap,_="htBadValue";C("checkbox",o)},{eventManager:41,"helpers/dom/element":45,"helpers/dom/event":46,"helpers/string":52,"helpers/unicode":53,renderers:88}],92:[function(e,t,n){"use strict";function o(e,t,n,o,r,i,l){a("base").apply(this,arguments),s(t,i)}Object.defineProperties(n,{htmlRenderer:{get:function(){return o}},__esModule:{value:!0}});var r,i,s=(r=e("helpers/dom/element"),r&&r.__esModule&&r||{"default":r}).fastInnerHTML,l=(i=e("renderers"),i&&i.__esModule&&i||{"default":i}),a=l.getRenderer,u=l.registerRenderer;u("html",o)},{"helpers/dom/element":45,renderers:88}],93:[function(e,t,n){"use strict";function o(e,t,n,o,r,i,s){f(i)&&("undefined"!=typeof s.language&&a.language(s.language),i=a(i).format(s.format||"0"),u(t,"htNumeric")),d("text")(e,t,n,o,r,i,s)}Object.defineProperties(n,{numericRenderer:{get:function(){return o}},__esModule:{value:!0}});var r,i,s,l,a=(r=e("numeral"),r&&r.__esModule&&r||{"default":r})["default"],u=(i=e("helpers/dom/element"),i&&i.__esModule&&i||{"default":i}).addClass,c=(s=e("renderers"),s&&s.__esModule&&s||{"default":s}),d=c.getRenderer,h=c.registerRenderer,f=(l=e("helpers/number"),l&&l.__esModule&&l||{"default":l}).isNumeric;h("numeric",o)},{"helpers/dom/element":45,"helpers/number":49,numeral:"numeral",renderers:88 -}],94:[function(e,t,n){"use strict";function o(e,t,n,o,r,i,l){a("text").apply(this,arguments),i=t.innerHTML;var u,c=l.hashLength||i.length,d=l.hashSymbol||"*";for(u="";u.split(d).length-13?("function"==typeof o&&(e.__proto__=o),e.prototype=d(l(o),i(t))):e.prototype=t,f(e,"prototype",{configurable:!1,writable:!1}),h(e,i(n))}function l(e){if("function"==typeof e){var t=e.prototype;if(u(t)===t||null===t)return e.prototype;throw new c("super prototype must be an Object or null")}if(null===e)return null;throw new c("Super expression must either be null or a function, not "+typeof e+".")}function a(e,t,o){null!==p(t)&&n(e,t,"constructor",o)}var u=Object,c=TypeError,d=u.create,h=$traceurRuntime.defineProperties,f=$traceurRuntime.defineProperty,g=$traceurRuntime.getOwnPropertyDescriptor,p=Object.getPrototypeOf,m=$traceurRuntime.toProperty,w=Object,v=w.getOwnPropertyNames,b=w.getOwnPropertySymbols;$traceurRuntime.createClass=s,$traceurRuntime.defaultSuperCall=a,$traceurRuntime.superCall=n,$traceurRuntime.superConstructor=t,$traceurRuntime.superGet=o,$traceurRuntime.superSet=r}()},{}],97:[function(e,t,n){"use strict";function o(e){var t=this;this.eventManager=C(e),this.instance=e,this.settings=e.getSettings(),this.selectionMouseDown=!1;var n=e.rootElement.getAttribute("style");n&&e.rootElement.setAttribute("data-originalstyle",n),d(e.rootElement,"handsontable");var o=document.createElement("TABLE");d(o,"htCore"),e.getSettings().tableClassName&&d(o,e.getSettings().tableClassName),this.THEAD=document.createElement("THEAD"),o.appendChild(this.THEAD),this.TBODY=document.createElement("TBODY"),o.appendChild(this.TBODY),e.table=o,e.container.insertBefore(o,e.container.firstChild),this.eventManager.addEventListener(e.rootElement,"mousedown",function(e){this.selectionMouseDown=!0,t.isTextSelectionAllowed(e.target)||(i(),e.preventDefault(),window.focus())}),this.eventManager.addEventListener(e.rootElement,"mouseup",function(e){this.selectionMouseDown=!1}),this.eventManager.addEventListener(e.rootElement,"mousemove",function(e){this.selectionMouseDown&&!t.isTextSelectionAllowed(e.target)&&(i(),e.preventDefault())}),this.eventManager.addEventListener(document.documentElement,"keyup",function(t){e.selection.isInProgress()&&!t.shiftKey&&e.selection.finish()});var r;this.isMouseDown=function(){return r},this.eventManager.addEventListener(document.documentElement,"mouseup",function(t){e.selection.isInProgress()&&1===t.which&&e.selection.finish(),r=!1,b(document.activeElement)&&e.unlisten()}),this.eventManager.addEventListener(document.documentElement,"mousedown",function(n){var o=n.target,i=n.x||n.clientX,s=n.y||n.clientY;if(!r&&e.rootElement){if(o===e.view.wt.wtTable.holder){var l=p();if(document.elementFromPoint(i+l,s)!==e.view.wt.wtTable.holder||document.elementFromPoint(i,s+l)!==e.view.wt.wtTable.holder)return}else for(;o!==document.documentElement;){if(null===o){if(n.isTargetWebComponent)break;return}if(o===e.rootElement)return;o=o.parentNode}t.settings.outsideClickDeselects?e.deselectCell():e.destroyEditor()}}),this.eventManager.addEventListener(o,"selectstart",function(e){t.settings.fragmentSelection||v(e.target)||e.preventDefault()});var i=function(){window.getSelection?window.getSelection().empty?window.getSelection().empty():window.getSelection().removeAllRanges&&window.getSelection().removeAllRanges():document.selection&&document.selection.empty()},s=[new T({className:"current",border:{width:2,color:"#5292F7",cornerVisible:function(){return t.settings.fillHandle&&!t.isCellEdited()&&!e.selection.isMultiple()},multipleSelectionHandlesVisible:function(){return!t.isCellEdited()&&!e.selection.isMultiple()}}}),new T({className:"area",border:{width:1,color:"#89AFF9",cornerVisible:function(){return t.settings.fillHandle&&!t.isCellEdited()&&e.selection.isMultiple()},multipleSelectionHandlesVisible:function(){return!t.isCellEdited()&&e.selection.isMultiple()}}}),new T({className:"highlight",highlightRowClassName:t.settings.currentRowClassName,highlightColumnClassName:t.settings.currentColClassName}),new T({className:"fill",border:{width:1,color:"red"}})];s.current=s[0],s.area=s[1],s.highlight=s[2],s.fill=s[3];var l={debug:function(){return t.settings.debug},externalRowCalculator:this.instance.getPlugin("autoRowSize")&&this.instance.getPlugin("autoRowSize").isEnabled(),table:o,stretchH:this.settings.stretchH,data:e.getDataAtCell,totalRows:function(){return e.countRows()},totalColumns:function(){return e.countCols()},fixedColumnsLeft:function(){return t.settings.fixedColumnsLeft},fixedRowsTop:function(){return t.settings.fixedRowsTop},fixedRowsBottom:function(){return t.settings.fixedRowsBottom},minSpareRows:function(){return t.settings.minSpareRows},renderAllRows:t.settings.renderAllRows,rowHeaders:function(){var n=[];return e.hasRowHeaders()&&n.push(function(e,n){t.appendRowHeader(e,n)}),Handsontable.hooks.run(e,"afterGetRowHeaderRenderers",n),n},columnHeaders:function(){var n=[];return e.hasColHeaders()&&n.push(function(e,n){t.appendColHeader(e,n)}),Handsontable.hooks.run(e,"afterGetColumnHeaderRenderers",n),n},columnWidth:e.getColWidth,rowHeight:e.getRowHeight,cellRenderer:function(e,n,o){var r=t.instance.colToProp(n),i=t.instance.getCellMeta(e,n),s=t.instance.getCellRenderer(i),l=t.instance.getDataAtRowProp(e,r);s(t.instance,o,e,n,r,l,i),Handsontable.hooks.run(t.instance,"afterRenderer",o,e,n,r,l,i)},selections:s,hideBorderOnMouseDownOver:function(){return t.settings.fragmentSelection},onCellMouseDown:function(n,o,i,s){var l,a,u=i.parentNode,c=u.parentNode;if(e.listen(),t.activeWt=s,r=!0,Handsontable.hooks.run(e,"beforeOnCellMouseDown",n,o,i),e.selection.setSelectedHeaders(!1,!1),!E(n)){if(2===n.button&&e.selection.inInSelection(o));else n.shiftKey?o.row>=0&&o.col>=0&&e.selection.setRangeEnd(o):(o.row<0||o.col<0)&&(o.row>=0||o.col>=0)?(o.row<0&&(l=c.childNodes.length-Array.prototype.indexOf.call(c.childNodes,u)-1,a=e.getHeaderColspan(o.col,l),e.selection.setSelectedHeaders(!1,!0),e.selectCell(0,o.col,e.countRows()-1,o.col+Math.max(0,a-1))),o.col<0&&(e.selection.setSelectedHeaders(!0,!1),e.selectCell(o.row,0,o.row,e.countCols()-1))):(o.row=o.row<0?0:o.row,o.col=o.col<0?0:o.col,e.selection.setRangeStart(o));Handsontable.hooks.run(e,"afterOnCellMouseDown",n,o,i),t.activeWt=t.wt}},onCellMouseOver:function(n,o,i,s){t.activeWt=s,o.row>=0&&o.col>=0?r&&e.selection.setRangeEnd(o):r&&(o.row<0&&(e.selection.selectedHeader.cols?(e.selection.setRangeEnd(new S(e.countRows()-1,o.col)),e.selection.setSelectedHeaders(!1,!0)):e.selection.setRangeEnd(new S(o.row,o.col))),o.col<0&&(e.selection.selectedHeader.rows?(e.selection.setRangeEnd(new S(o.row,e.countCols()-1)),e.selection.setSelectedHeaders(!0,!1)):e.selection.setRangeEnd(new S(o.row,o.col)))),Handsontable.hooks.run(e,"afterOnCellMouseOver",n,o,i),t.activeWt=t.wt},onCellCornerMouseDown:function(t){t.preventDefault(),Handsontable.hooks.run(e,"afterOnCellCornerMouseDown",t)},beforeDraw:function(e){t.beforeRender(e)},onDraw:function(e){t.onDraw(e)},onScrollVertically:function(){e.runHooks("afterScrollVertically")},onScrollHorizontally:function(){e.runHooks("afterScrollHorizontally")},onBeforeDrawBorders:function(t,n){e.runHooks("beforeDrawBorders",t,n)},onBeforeTouchScroll:function(){e.runHooks("beforeTouchScroll")},onAfterMomentumScroll:function(){e.runHooks("afterMomentumScroll")},viewportRowCalculatorOverride:function(n){var o=e.countRows(),r=t.settings.viewportRowRenderingOffset;if("auto"===r&&t.settings.fixedRowsTop&&(r=10),"number"==typeof r&&(n.startRow=Math.max(n.startRow-r,0),n.endRow=Math.min(n.endRow+r,o-1)),"auto"===r){var i=n.startRow+n.endRow-n.startRow,s=Math.ceil(i/o*12);n.startRow=Math.max(n.startRow-s,0),n.endRow=Math.min(n.endRow+s,o-1)}e.runHooks("afterViewportRowCalculatorOverride",n)},viewportColumnCalculatorOverride:function(n){var o=e.countCols(),r=t.settings.viewportColumnRenderingOffset;if("auto"===r&&t.settings.fixedColumnsLeft&&(r=10),"number"==typeof r&&(n.startColumn=Math.max(n.startColumn-r,0),n.endColumn=Math.min(n.endColumn+r,o-1)),"auto"===r){var i=n.startColumn+n.endColumn-n.startColumn,s=Math.ceil(i/o*12);n.startRow=Math.max(n.startColumn-s,0),n.endColumn=Math.min(n.endColumn+s,o-1)}e.runHooks("afterViewportColumnCalculatorOverride",n)}};Handsontable.hooks.run(e,"beforeInitWalkontable",l),this.wt=new O(l),this.activeWt=this.wt,this.eventManager.addEventListener(t.wt.wtTable.spreader,"mousedown",function(e){e.target===t.wt.wtTable.spreader&&3===e.which&&R(e)}),this.eventManager.addEventListener(t.wt.wtTable.spreader,"contextmenu",function(e){e.target===t.wt.wtTable.spreader&&3===e.which&&R(e)}),this.eventManager.addEventListener(document.documentElement,"click",function(){t.settings.observeDOMVisibility&&t.wt.drawInterrupted&&(t.instance.forceFullRender=!0,t.render())})}Object.defineProperties(n,{TableView:{get:function(){return o}},__esModule:{value:!0}});var r,i,s,l,a,u,c=(r=e("helpers/dom/element"),r&&r.__esModule&&r||{"default":r}),d=c.addClass,h=c.empty,f=c.fastInnerHTML,g=c.fastInnerText,p=c.getScrollbarWidth,m=c.hasClass,w=c.isChildOf,v=c.isInput,b=c.isOutsideInput,C=(i=e("eventManager"),i&&i.__esModule&&i||{"default":i}).eventManager,y=(s=e("helpers/dom/event"),s&&s.__esModule&&s||{"default":s}),R=y.stopPropagation,E=y.isImmediatePropagationStopped,S=(l=e("3rdparty/walkontable/src/cell/coords"),l&&l.__esModule&&l||{"default":l}).WalkontableCellCoords,T=(a=e("3rdparty/walkontable/src/selection"),a&&a.__esModule&&a||{"default":a}).WalkontableSelection,O=(u=e("3rdparty/walkontable/src/core"),u&&u.__esModule&&u||{"default":u}).Walkontable;Handsontable.TableView=o,o.prototype.isTextSelectionAllowed=function(e){if(v(e))return!0;var t=w(e,this.instance.view.wt.wtTable.spreader);return this.settings.fragmentSelection===!0&&t?!0:"cell"===this.settings.fragmentSelection&&this.isSelectedOnlyCell()&&t?!0:!1},o.prototype.isSelectedOnlyCell=function(){var e=this.instance.getSelected()||[],t=e[0],n=e[1],o=e[2],r=e[3];return void 0!==t&&t===o&&n===r},o.prototype.isCellEdited=function(){var e=this.instance.getActiveEditor();return e&&e.isOpened()},o.prototype.beforeRender=function(e){e&&Handsontable.hooks.run(this.instance,"beforeRender",this.instance.forceFullRender)},o.prototype.onDraw=function(e){e&&Handsontable.hooks.run(this.instance,"afterRender",this.instance.forceFullRender)},o.prototype.render=function(){this.wt.draw(!this.instance.forceFullRender),this.instance.forceFullRender=!1,this.instance.renderCall=!1},o.prototype.getCellAtCoords=function(e,t){var n=this.wt.getCell(e,t);return 0>n?null:n},o.prototype.scrollViewport=function(e){this.wt.scrollViewport(e)},o.prototype.appendRowHeader=function(e,t){if(t.firstChild){var n=t.firstChild;if(!m(n,"relative"))return h(t),void this.appendRowHeader(e,t);this.updateCellHeader(n.querySelector(".rowHeader"),e,this.instance.getRowHeader)}else{var o=document.createElement("div"),r=document.createElement("span");o.className="relative",r.className="rowHeader",this.updateCellHeader(r,e,this.instance.getRowHeader),o.appendChild(r),t.appendChild(o)}Handsontable.hooks.run(this.instance,"afterGetRowHeader",e,t)},o.prototype.appendColHeader=function(e,t){if(t.firstChild){var n=t.firstChild;m(n,"relative")?this.updateCellHeader(n.querySelector(".colHeader"),e,this.instance.getColHeader):(h(t),this.appendColHeader(e,t))}else{var o=document.createElement("div"),r=document.createElement("span");o.className="relative",r.className="colHeader",this.updateCellHeader(r,e,this.instance.getColHeader),o.appendChild(r),t.appendChild(o)}Handsontable.hooks.run(this.instance,"afterGetColHeader",e,t)},o.prototype.updateCellHeader=function(e,t,n){t>-1?f(e,n(t)):(g(e,String.fromCharCode(160)),d(e,"cornerHeader"))},o.prototype.maximumVisibleElementWidth=function(e){var t=this.wt.wtViewport.getWorkspaceWidth(),n=t-e;return n>0?n:0},o.prototype.maximumVisibleElementHeight=function(e){var t=this.wt.wtViewport.getWorkspaceHeight(),n=t-e;return n>0?n:0},o.prototype.mainViewIsActive=function(){return this.wt===this.activeWt},o.prototype.destroy=function(){this.wt.destroy(),this.eventManager.destroy()}},{"3rdparty/walkontable/src/cell/coords":5,"3rdparty/walkontable/src/core":7,"3rdparty/walkontable/src/selection":18,eventManager:41,"helpers/dom/element":45,"helpers/dom/event":46}],98:[function(e,t,n){"use strict";Object.defineProperties(n,{GhostTable:{get:function(){return f}},__esModule:{value:!0}});var o,r,i,s,l,a=(o=e("helpers/dom/element"),o&&o.__esModule&&o||{"default":o}),u=a.addClass,c=a.outerHeight,d=a.outerWidth,h=(r=e("helpers/array"),r&&r.__esModule&&r||{"default":r}).arrayEach,f=((i=e("helpers/object"),i&&i.__esModule&&i||{"default":i}).objectEach,(s=e("helpers/number"),s&&s.__esModule&&s||{"default":s}).rangeEach,(l=e("helpers/mixed"),l&&l.__esModule&&l||{"default":l}).stringify,function(e){this.hot=e,this.container=null,this.injected=!1,this.rows=[],this.columns=[],this.samples=null});$traceurRuntime.createClass(f,{addRow:function(e,t){if(this.columns.length)throw new Error("Doesn't support multi-dimensional table");this.rows.length||(this.container=this.createContainer(this.hot.rootElement.className));var n={row:e};this.rows.push(n),this.samples=t,this.table=this.createTable(this.hot.table.className),this.table.colGroup.appendChild(this.createColGroupsCol()),this.table.tr.appendChild(this.createRow(e)),this.container.container.appendChild(this.table.fragment),n.table=this.table.table},addColumn:function(e,t){if(this.rows.length)throw new Error("Doesn't support multi-dimensional table");this.columns.length||(this.container=this.createContainer(this.hot.rootElement.className));var n={col:e};this.columns.push(n),this.samples=t,this.table=this.createTable(this.hot.table.className),null!==this.hot.getColHeader(e)&&this.hot.view.appendColHeader(e,this.table.th),this.table.tBody.appendChild(this.createCol(e)),this.container.container.appendChild(this.table.fragment),n.table=this.table.table},getHeights:function(e){this.injected||this.injectTable(),h(this.rows,function(t){e(t.row,c(t.table)-1)})},getWidths:function(e){this.injected||this.injectTable(),h(this.columns,function(t){e(t.col,d(t.table))})},createColGroupsCol:function(){var e=this,t=document,n=t.createDocumentFragment();return n.appendChild(this.createColElement(-1)),this.samples.forEach(function(t){h(t.strings,function(t){n.appendChild(e.createColElement(t.col))})}),n},createRow:function(e){var t=this,n=document,o=n.createDocumentFragment(),r=n.createElement("th");return null!==this.hot.getRowHeader(e)&&this.hot.view.appendRowHeader(e,r),o.appendChild(r),this.samples.forEach(function(r){h(r.strings,function(r){var i=r.col,s=t.hot.getCellMeta(e,i);s.col=i,s.row=e;var l=t.hot.getCellRenderer(s),a=n.createElement("td");l(t.hot,a,e,i,t.hot.colToProp(i),r.value,s),o.appendChild(a)})}),o},createCol:function(e){var t=this,n=document,o=n.createDocumentFragment();return this.samples.forEach(function(r){h(r.strings,function(r){var i=r.row,s=t.hot.getCellMeta(i,e);s.col=e,s.row=i;var l=t.hot.getCellRenderer(s),a=n.createElement("td"),u=n.createElement("tr");l(t.hot,a,i,e,t.hot.colToProp(i),r.value,s),u.appendChild(a),o.appendChild(u)})}),o},clean:function(){this.rows.length=0,this.columns.length=0,this.samples&&this.samples.clear(),this.samples=null,this.removeTable()},injectTable:function(){var e=void 0!==arguments[0]?arguments[0]:null;this.injected||((e||this.hot.rootElement).appendChild(this.container.fragment),this.injected=!0)},removeTable:function(){this.injected&&this.container.container.parentNode&&(this.container.container.parentNode.removeChild(this.container.container),this.container=null,this.injected=!1)},createColElement:function(e){var t=document,n=t.createElement("col");return n.style.width=this.hot.view.wt.wtTable.getStretchedColumnWidth(e)+"px",n},createTable:function(){var e=void 0!==arguments[0]?arguments[0]:"",t=document,n=t.createDocumentFragment(),o=t.createElement("table"),r=t.createElement("thead"),i=t.createElement("tbody"),s=t.createElement("colgroup"),l=t.createElement("tr"),a=t.createElement("th");return this.isVertical()&&o.appendChild(s),this.isHorizontal()&&(l.appendChild(a),r.appendChild(l),o.style.tableLayout="auto",o.style.width="auto"),o.appendChild(r),this.isVertical()&&i.appendChild(l),o.appendChild(i),u(o,e),n.appendChild(o),{fragment:n,table:o,tHead:r,tBody:i,colGroup:s,tr:l,th:a}},createContainer:function(){var e=void 0!==arguments[0]?arguments[0]:"",t=document,n=t.createDocumentFragment(),o=t.createElement("div");return e="htGhostTable htAutoSize "+e.trim(),u(o,e),n.appendChild(o),{fragment:n,container:o}},isVertical:function(){return this.rows.length&&!this.columns.length?!0:!1},isHorizontal:function(){return this.columns.length&&!this.rows.length?!0:!1}},{}),Handsontable.utils=Handsontable.utils||{},Handsontable.utils.GhostTable=f},{"helpers/array":42,"helpers/dom/element":45,"helpers/mixed":48,"helpers/number":49,"helpers/object":50}],99:[function(e,t,n){"use strict";var o;Object.defineProperties(n,{SamplesGenerator:{get:function(){return h}},__esModule:{value:!0}});var r,i,s,l,a,u=(r=e("helpers/dom/element"),r&&r.__esModule&&r||{"default":r}),c=(u.addClass,u.outerHeight,u.outerWidth,(i=e("helpers/array"),i&&i.__esModule&&i||{"default":i}).arrayEach,(s=e("helpers/object"),s&&s.__esModule&&s||{"default":s}).objectEach,(l=e("helpers/number"),l&&l.__esModule&&l||{"default":l}).rangeEach),d=(a=e("helpers/mixed"),a&&a.__esModule&&a||{"default":a}).stringify,h=function(e){this.samples=null,this.dataFactory=e},f=h;$traceurRuntime.createClass(h,(o={},Object.defineProperty(o,"generateRowSamples",{value:function(e,t){return this.generateSamples("row",t,e)},configurable:!0,enumerable:!0,writable:!0}),Object.defineProperty(o,"generateColumnSamples",{value:function(e,t){return this.generateSamples("col",t,e)},configurable:!0,enumerable:!0,writable:!0}),Object.defineProperty(o,"generateSamples",{value:function(e,t,n){var o=this,r=new Map;return"number"==typeof n&&(n={from:n,to:n}),c(n.from,n.to,function(n){var i=o.generateSample(e,t,n);r.set(n,i)}),r},configurable:!0,enumerable:!0,writable:!0}),Object.defineProperty(o,"generateSample",{value:function(e,t,n){var o=this,r=new Map;return c(t.from,t.to,function(t){var i,s;if("row"===e)s=o.dataFactory(n,t);else{if("col"!==e)throw new Error("Unsupported sample type");s=o.dataFactory(t,n)}Array.isArray(s)||(s=d(s));var l=s.length;r.has(l)||r.set(l,{needed:f.SAMPLE_COUNT,strings:[]});var a=r.get(l);if(a.needed){var u="row"===e?"col":"row";a.strings.push((i={},Object.defineProperty(i,"value",{value:s,configurable:!0,enumerable:!0,writable:!0}),Object.defineProperty(i,u,{value:t,configurable:!0,enumerable:!0,writable:!0}),i)),a.needed--}}),r},configurable:!0,enumerable:!0,writable:!0}),o),{get SAMPLE_COUNT(){return 3}}),Handsontable.utils=Handsontable.utils||{},Handsontable.utils.SamplesGenerator=h},{"helpers/array":42,"helpers/dom/element":45,"helpers/mixed":48,"helpers/number":49,"helpers/object":50}],100:[function(e,t,n){"use strict";function o(e,t){var n=e,o="string"==typeof n?n.toLowerCase():null;return function(e){for(var r=!1,s=0,l=e.length;l>s;s++){if(n===e[s]){r=!0;break}if(o===i(e[s]).toLowerCase()){r=!0;break}}t(r)}}var r,i=(r=e("helpers/mixed"),r&&r.__esModule&&r||{"default":r}).stringify;Handsontable.AutocompleteValidator=function(e,t){this.strict&&this.source?"function"==typeof this.source?this.source(e,o(e,t)):o(e,t)(this.source):t(!0)}},{"helpers/mixed":48}],101:[function(e,t,n){"use strict";var o,r,i=(o=e("moment"),o&&o.__esModule&&o||{"default":o})["default"],s=(r=e("editors"),r&&r.__esModule&&r||{"default":r}).getEditor;Handsontable.DateValidator=function(e,t){var n=!0,o=s("date",this.instance);null===e&&(e="");var r=i(new Date(e)).isValid(),a=i(e,this.dateFormat||o.defaultDateFormat,!0).isValid();if(r||(n=!1),!r&&a&&(n=!0),r&&!a)if(this.correctFormat===!0){var u=l(e,this.dateFormat);this.instance.setDataAtCell(this.row,this.col,u,"dateValidator"),n=!0}else n=!1;t(n)};var l=function(e,t){var n=i(new Date(e)),o=n.format("YYYY"),r=i().format("YYYY");return o.substr(0,2)!==r.substr(0,2)?e.match(new RegExp(o))||n.year(o.replace(o.substr(0,2),r.substr(0,2))):o.length>4&&n.year((n.year()+"").substr(0,4)),n.format(t)}},{editors:29,moment:void 0}],102:[function(e,t,n){"use strict";Handsontable.NumericValidator=function(e,t){null===e&&(e=""),t(/^-?\d*(\.|\,)?\d*$/.test(e))}},{}],SheetClip:[function(e,t,n){"use strict";!function(e){function t(e){return e.split('"').length-1}var o={parse:function(e){var n,o,r,i,s,l,a,u=[],c=0;for(r=e.split("\n"),r.length>1&&""===r[r.length-1]&&r.pop(),n=0,o=r.length;o>n;n+=1){for(r[n]=r[n].split(" "),i=0,s=r[n].length;s>i;i+=1)u[c]||(u[c]=[]),l&&0===i?(a=u[c].length-1,u[c][a]=u[c][a]+"\n"+r[n][0],l&&1&t(r[n][0])&&(l=!1,u[c][a]=u[c][a].substring(0,u[c][a].length-1).replace(/""/g,'"'))):i===s-1&&0===r[n][i].indexOf('"')&&1&t(r[n][i])?(u[c].push(r[n][i].substring(1).replace(/""/g,'"')),l=!0):(u[c].push(r[n][i].replace(/""/g,'"')),l=!1);l||(c+=1)}return u},stringify:function(e){var t,n,o,r,i,s="";for(t=0,n=e.length;n>t;t+=1){for(r=e[t].length,o=0;r>o;o+=1)o>0&&(s+=" "),i=e[t][o],s+="string"==typeof i?i.indexOf("\n")>-1?'"'+i.replace(/"/g,'""')+'"':i:null===i||void 0===i?"":i;s+="\n"}return s}};"undefined"!=typeof n?(n.parse=o.parse,n.stringify=o.stringify):e.SheetClip=o}(window)},{}],autoResize:[function(e,t,n){"use strict";function o(){var e,t={minHeight:200,maxHeight:300,minWidth:100,maxWidth:300},n=document.body,o=document.createTextNode(""),r=document.createElement("SPAN"),i=function(e,t,n){window.attachEvent?e.attachEvent("on"+t,n):e.addEventListener(t,n,!1)},s=function(e,t,n){window.removeEventListener?e.removeEventListener(t,n,!1):e.detachEvent("on"+t,n)},l=function(i){var s,l;i?/^[a-zA-Z \.,\\\/\|0-9]$/.test(i)||(i="."):i="",void 0!==o.textContent?o.textContent=e.value+i:o.data=e.value+i,r.style.fontSize=Handsontable.Dom.getComputedStyle(e).fontSize,r.style.fontFamily=Handsontable.Dom.getComputedStyle(e).fontFamily,r.style.whiteSpace="pre",n.appendChild(r),s=r.clientWidth+2,n.removeChild(r),e.style.height=t.minHeight+"px",t.minWidth>s?e.style.width=t.minWidth+"px":s>t.maxWidth?e.style.width=t.maxWidth+"px":e.style.width=s+"px",l=e.scrollHeight?e.scrollHeight-1:0,t.minHeight>l?e.style.height=t.minHeight+"px":t.maxHeight-1||"true"===e.contentEditable}var n=this,o=!1;if(e.metaKey?o=!0:e.ctrlKey&&-1===navigator.userAgent.indexOf("Mac")&&(o=!0),o){if(document.activeElement!==this.elTextarea&&(""!==this.getSelectionText()||t()))return;this.selectNodeText(this.elTextarea),setTimeout(function(){document.activeElement!==n.elTextarea&&n.selectNodeText(n.elTextarea)},0)}!o||67!==e.keyCode&&86!==e.keyCode&&88!==e.keyCode||(88===e.keyCode?setTimeout(function(){n.triggerCut(e)},0):86===e.keyCode&&setTimeout(function(){n.triggerPaste(e)},0))},r.prototype.selectNodeText=function(e){e&&e.select()},r.prototype.getSelectionText=function(){var e="";return window.getSelection?e=window.getSelection().toString():document.selection&&"Control"!==document.selection.type&&(e=document.selection.createRange().text),e},r.prototype.copyable=function(e){if("string"!=typeof e&&void 0===e.toString)throw new Error("copyable requires string parameter");this.elTextarea.value=e,this.selectNodeText(this.elTextarea)},r.prototype.onCut=function(e){this.cutCallbacks.push(e)},r.prototype.onPaste=function(e){this.pasteCallbacks.push(e)},r.prototype.removeCallback=function(e){var t,n;for(t=0,n=this.copyCallbacks.length;n>t;t++)if(this.copyCallbacks[t]===e)return this.copyCallbacks.splice(t,1),!0;for(t=0,n=this.cutCallbacks.length;n>t;t++)if(this.cutCallbacks[t]===e)return this.cutCallbacks.splice(t,1), -!0;for(t=0,n=this.pasteCallbacks.length;n>t;t++)if(this.pasteCallbacks[t]===e)return this.pasteCallbacks.splice(t,1),!0;return!1},r.prototype.triggerCut=function(e){var t=this;t.cutCallbacks&&setTimeout(function(){for(var n=0,o=t.cutCallbacks.length;o>n;n++)t.cutCallbacks[n](e)},50)},r.prototype.triggerPaste=function(e,t){var n=this;n.pasteCallbacks&&setTimeout(function(){for(var o=t||n.elTextarea.value,r=0,i=n.pasteCallbacks.length;i>r;r++)n.pasteCallbacks[r](o,e)},50)},r.prototype.destroy=function(){this.hasBeenDestroyed()||0!==--this.refCounter||(this.elDiv&&this.elDiv.parentNode&&(this.elDiv.parentNode.removeChild(this.elDiv),this.elDiv=null,this.elTextarea=null),document.documentElement.removeEventListener("keydown",this.onKeyDownRef),this.onKeyDownRef=null)},r.prototype.hasBeenDestroyed=function(){return!this.refCounter}},{}],es6collections:[function(e,t,n){"use strict";!function(e){function t(e,t){function o(e){return this&&this.constructor===o?(this._keys=[],this._values=[],this._itp=[],this.objectOnly=t,void(e&&n.call(this,e))):new o(e)}return t||b(e,"size",{get:m}),e.constructor=o,o.prototype=e,o}function n(e){this.add?e.forEach(this.add,this):e.forEach(function(e){this.set(e[0],e[1])},this)}function o(e){return this.has(e)&&(this._keys.splice(v,1),this._values.splice(v,1),this._itp.forEach(function(e){v-1}function r(e){return this.has(e)?this._values[v]:void 0}function i(e,t){if(this.objectOnly&&t!==Object(t))throw new TypeError("Invalid value used as weak collection key");if(t!=t||0===t)for(v=e.length;v--&&!C(e[v],t););else v=e.indexOf(t);return v>-1}function s(e){return i.call(this,this._values,e)}function l(e){return i.call(this,this._keys,e)}function a(e,t){return this.has(e)?this._values[v]=t:this._values[this._keys.push(e)-1]=t,this}function u(e){return this.has(e)||this._values.push(e),this}function c(){this._values.length=0}function d(){return p(this._itp,this._keys)}function h(){return p(this._itp,this._values)}function f(){return p(this._itp,this._keys,this._values)}function g(){return p(this._itp,this._values,this._values)}function p(e,t,n){var o=[0],r=!1;return e.push(o),{next:function(){var i,s=o[0];return!r&&st;t++)if(v[t].obj===e)return v[t]}function i(e){for(var t=0,n=v.length;n>t;t++)v[t]===e&&v.splice(t,1)}function s(e,t){for(var n=0,o=e.observers.length;o>n;n++)if(e.observers[n].callback===t)return e.observers[n].observer}function l(e,t){for(var n=0,o=e.observers.length;o>n;n++)if(e.observers[n].observer===t)return e.observers.splice(n,1),void(e.observers.length||i(e))}function a(e,t){h(t),Object.observe?d(t,e):clearTimeout(t.next);var n=r(e);l(n,t)}function u(e,t){var n,i=[],l=e,a=r(e);if(a?n=s(a,t):(a=new b(e),v.push(a)),n)return n;if(Object.observe)n=function(r){d(n,e),c(n,e);for(var s=0,a=r.length;a>s;){if(("length"!==r[s].name||!R(r[s].object))&&"__Jasmine_been_here_before__"!==r[s].name){var u=r[s].type;switch(u){case"new":u="add";break;case"deleted":u="delete";break;case"updated":u="update"}w[u].call(r[s],i,o(l,r[s].object))}s++}i&&t&&t(i),n.patches=i,i=[]};else if(n={},a.value=JSON.parse(JSON.stringify(e)),t){n.callback=t,n.next=null;var u=this.intervals||[100,1e3,1e4,6e4],f=0,g=function(){h(n)},p=function(){clearTimeout(n.next),n.next=setTimeout(function(){g(),f=0,n.next=setTimeout(m,u[f++])},0)},m=function(){g(),f==u.length&&(f=u.length-1),n.next=setTimeout(m,u[f++])};"undefined"!=typeof window&&(window.addEventListener?(window.addEventListener("mousedown",p),window.addEventListener("mouseup",p),window.addEventListener("keydown",p)):(window.attachEvent("onmousedown",p),window.attachEvent("onmouseup",p),window.attachEvent("onkeydown",p))),n.next=setTimeout(m,u[f++])}return n.patches=i,n.object=e,a.observers.push(new C(t,n)),c(n,e)}function c(e,t){if(Object.observe){Object.observe(t,e);for(var n in t)if(t.hasOwnProperty(n)){var o=t[n];o&&"object"==typeof o&&c(e,o)}}return e}function d(e,t){if(Object.observe){Object.unobserve(t,e);for(var n in t)if(t.hasOwnProperty(n)){var o=t[n];o&&"object"==typeof o&&d(e,o)}}return e}function h(e){if(Object.observe)Object.deliverChangeRecords(e);else{for(var t,n=0,o=v.length;o>n;n++)if(v[n].obj===e.object){t=v[n];break}t&&f(t.value,e.object,e.patches,"")}var r=e.patches;return r.length>0&&(e.patches=[],e.callback&&e.callback(r)),r}function f(e,n,o,r){for(var i=y(n),s=y(e),l=!1,a=!1,u=s.length-1;u>=0;u--){var c=s[u],d=e[c];if(n.hasOwnProperty(c)){var h=n[c];d instanceof Object?f(d,h,o,r+"/"+t(c)):d!=h&&(l=!0,o.push({op:"replace",path:r+"/"+t(c),value:h}),e[c]=h)}else o.push({op:"remove",path:r+"/"+t(c)}),delete e[c],a=!0}if(a||i.length!=s.length)for(var u=0;ur;){n=t[r];for(var s=n.path.split("/"),l=e,a=1,u=s.length;;)if(R(l)){var c=parseInt(s[a],10);if(a++,a>=u){o=m[n.op].call(n,l,c,e);break}l=l[c]}else{var d=s[a];if(-1!=d.indexOf("~")&&(d=d.replace(/~1/g,"/").replace(/~0/g,"~")),a++,a>=u){o=p[n.op].call(n,l,d,e);break}l=l[d]}r++}return o}var p={add:function(e,t){return e[t]=this.value,!0},remove:function(e,t){return delete e[t],!0},replace:function(e,t){return e[t]=this.value,!0},move:function(e,t,n){var o={op:"_get",path:this.from};return g(n,[o]),g(n,[{op:"remove",path:this.from}]),g(n,[{op:"add",path:this.path,value:o.value}]),!0},copy:function(e,t,n){var o={op:"_get",path:this.from};return g(n,[o]),g(n,[{op:"add",path:this.path,value:o.value}]),!0},test:function(e,t){return JSON.stringify(e[t])===JSON.stringify(this.value)},_get:function(e,t){this.value=e[t]}},m={add:function(e,t){return e.splice(t,0,this.value),!0},remove:function(e,t){return e.splice(t,1),!0},replace:function(e,t){return e[t]=this.value,!0},move:p.move,copy:p.copy,test:p.test,_get:p._get},w={add:function(e,n){var o={op:"add",path:n+t(this.name),value:this.object[this.name]};e.push(o)},"delete":function(e,n){var o={op:"remove",path:n+t(this.name)};e.push(o)},update:function(e,n){var o={op:"replace",path:n+t(this.name),value:this.object[this.name]};e.push(o)}},v=[];e.intervals;var b=function(){function e(e){this.observers=[],this.obj=e}return e}(),C=function(){function e(e,t){this.callback=e,this.observer=t}return e}();e.unobserve=a,e.observe=u,e.generate=h;var y;y=Object.keys?Object.keys:function(e){var t=[];for(var n in e)e.hasOwnProperty(n)&&t.push(n);return t};var R;R=Array.isArray?Array.isArray:function(e){return e.push&&"number"==typeof e.length},e.apply=g}(o||(o={})),"undefined"!=typeof n&&(n.apply=o.apply,n.observe=o.observe,n.unobserve=o.unobserve,n.generate=o.generate)},{}],numeral:[function(t,n,o){"use strict";(function(){function t(e){this._value=e}function o(e,t,n,o){var r,i,s=Math.pow(10,t);return i=(n(e*s)/s).toFixed(t),o&&(r=new RegExp("0{1,"+o+"}$"),i=i.replace(r,"")),i}function r(e,t,n){var o;return o=t.indexOf("$")>-1?s(e,t,n):t.indexOf("%")>-1?l(e,t,n):t.indexOf(":")>-1?a(e,t):c(e._value,t,n)}function i(e,t){var n,o,r,i,s,l=t,a=["KB","MB","GB","TB","PB","EB","ZB","YB"],c=!1;if(t.indexOf(":")>-1)e._value=u(t);else if(t===v)e._value=0;else{for("."!==m[w].delimiters.decimal&&(t=t.replace(/\./g,"").replace(m[w].delimiters.decimal,".")),n=new RegExp("[^a-zA-Z]"+m[w].abbreviations.thousand+"(?:\\)|(\\"+m[w].currency.symbol+")?(?:\\))?)?$"),o=new RegExp("[^a-zA-Z]"+m[w].abbreviations.million+"(?:\\)|(\\"+m[w].currency.symbol+")?(?:\\))?)?$"),r=new RegExp("[^a-zA-Z]"+m[w].abbreviations.billion+"(?:\\)|(\\"+m[w].currency.symbol+")?(?:\\))?)?$"),i=new RegExp("[^a-zA-Z]"+m[w].abbreviations.trillion+"(?:\\)|(\\"+m[w].currency.symbol+")?(?:\\))?)?$"),s=0;s<=a.length&&!(c=t.indexOf(a[s])>-1?Math.pow(1024,s+1):!1);s++);e._value=(c?c:1)*(l.match(n)?Math.pow(10,3):1)*(l.match(o)?Math.pow(10,6):1)*(l.match(r)?Math.pow(10,9):1)*(l.match(i)?Math.pow(10,12):1)*(t.indexOf("%")>-1?.01:1)*((t.split("-").length+Math.min(t.split("(").length-1,t.split(")").length-1))%2?1:-1)*Number(t.replace(/[^0-9\.]+/g,"")),e._value=c?Math.ceil(e._value):e._value}return e._value}function s(e,t,n){var o,r,i=t.indexOf("$"),s=t.indexOf("("),l=t.indexOf("-"),a="";return t.indexOf(" $")>-1?(a=" ",t=t.replace(" $","")):t.indexOf("$ ")>-1?(a=" ",t=t.replace("$ ","")):t=t.replace("$",""),r=c(e._value,t,n),1>=i?r.indexOf("(")>-1||r.indexOf("-")>-1?(r=r.split(""),o=1,(s>i||l>i)&&(o=0),r.splice(o,0,m[w].currency.symbol+a),r=r.join("")):r=m[w].currency.symbol+a+r:r.indexOf(")")>-1?(r=r.split(""),r.splice(-1,0,a+m[w].currency.symbol),r=r.join("")):r=r+a+m[w].currency.symbol,r}function l(e,t,n){var o,r="",i=100*e._value;return t.indexOf(" %")>-1?(r=" ",t=t.replace(" %","")):t=t.replace("%",""),o=c(i,t,n),o.indexOf(")")>-1?(o=o.split(""),o.splice(-1,0,r+"%"),o=o.join("")):o=o+r+"%",o}function a(e){var t=Math.floor(e._value/60/60),n=Math.floor((e._value-60*t*60)/60),o=Math.round(e._value-60*t*60-60*n);return t+":"+(10>n?"0"+n:n)+":"+(10>o?"0"+o:o)}function u(e){var t=e.split(":"),n=0;return 3===t.length?(n+=60*Number(t[0])*60,n+=60*Number(t[1]),n+=Number(t[2])):2===t.length&&(n+=60*Number(t[0]),n+=Number(t[1])),Number(n)}function c(e,t,n){var r,i,s,l,a,u,c=!1,d=!1,h=!1,f="",g=!1,p=!1,b=!1,C=!1,y=!1,R="",E="",S=Math.abs(e),T=["B","KB","MB","GB","TB","PB","EB","ZB","YB"],O="",_=!1;if(0===e&&null!==v)return v;if(t.indexOf("(")>-1?(c=!0,t=t.slice(1,-1)):t.indexOf("+")>-1&&(d=!0,t=t.replace(/\+/g,"")),t.indexOf("a")>-1&&(g=t.indexOf("aK")>=0,p=t.indexOf("aM")>=0,b=t.indexOf("aB")>=0,C=t.indexOf("aT")>=0,y=g||p||b||C,t.indexOf(" a")>-1?(f=" ",t=t.replace(" a","")):t=t.replace("a",""),S>=Math.pow(10,12)&&!y||C?(f+=m[w].abbreviations.trillion,e/=Math.pow(10,12)):S=Math.pow(10,9)&&!y||b?(f+=m[w].abbreviations.billion,e/=Math.pow(10,9)):S=Math.pow(10,6)&&!y||p?(f+=m[w].abbreviations.million,e/=Math.pow(10,6)):(S=Math.pow(10,3)&&!y||g)&&(f+=m[w].abbreviations.thousand,e/=Math.pow(10,3))),t.indexOf("b")>-1)for(t.indexOf(" b")>-1?(R=" ",t=t.replace(" b","")):t=t.replace("b",""),s=0;s<=T.length;s++)if(r=Math.pow(1024,s),i=Math.pow(1024,s+1),e>=r&&i>e){R+=T[s],r>0&&(e/=r);break}return t.indexOf("o")>-1&&(t.indexOf(" o")>-1?(E=" ",t=t.replace(" o","")):t=t.replace("o",""),E+=m[w].ordinal(e)),t.indexOf("[.]")>-1&&(h=!0,t=t.replace("[.]",".")),l=e.toString().split(".")[0],a=t.split(".")[1],u=t.indexOf(","),a?(a.indexOf("[")>-1?(a=a.replace("]",""),a=a.split("["),O=o(e,a[0].length+a[1].length,n,a[1].length)):O=o(e,a.length,n),l=O.split(".")[0],O=O.split(".")[1].length?m[w].delimiters.decimal+O.split(".")[1]:"",h&&0===Number(O.slice(1))&&(O="")):l=o(e,null,n),l.indexOf("-")>-1&&(l=l.slice(1),_=!0),u>-1&&(l=l.toString().replace(/(\d)(?=(\d{3})+(?!\d))/g,"$1"+m[w].delimiters.thousands)),0===t.indexOf(".")&&(l=""),(c&&_?"(":"")+(!c&&_?"-":"")+(!_&&d?"+":"")+l+O+(E?E:"")+(f?f:"")+(R?R:"")+(c&&_?")":"")}function d(e,t){m[e]=t}function h(e){var t=e.toString().split(".");return t.length<2?1:Math.pow(10,t[1].length)}function f(){var e=Array.prototype.slice.call(arguments);return e.reduce(function(e,t){var n=h(e),o=h(t);return n>o?n:o},-(1/0))}var g,p="1.5.3",m={},w="en",v=null,b="0,0",C="undefined"!=typeof n&&n.exports;g=function(e){return g.isNumeral(e)?e=e.value():0===e||"undefined"==typeof e?e=0:Number(e)||(e=g.fn.unformat(e)),new t(Number(e))},g.version=p,g.isNumeral=function(e){return e instanceof t},g.language=function(e,t){if(!e)return w;if(e&&!t){if(!m[e])throw new Error("Unknown language : "+e);w=e}return(t||!m[e])&&d(e,t),g},g.languageData=function(e){if(!e)return m[w];if(!m[e])throw new Error("Unknown language : "+e);return m[e]},g.language("en",{delimiters:{thousands:",",decimal:"."},abbreviations:{thousand:"k",million:"m",billion:"b",trillion:"t"},ordinal:function(e){var t=e%10;return 1===~~(e%100/10)?"th":1===t?"st":2===t?"nd":3===t?"rd":"th"},currency:{symbol:"$"}}),g.zeroFormat=function(e){v="string"==typeof e?e:null},g.defaultFormat=function(e){b="string"==typeof e?e:"0.0"},g.validate=function(e,t){var n,o,r,i,s,l,a,u;if("string"!=typeof e&&(e+="",console.warn&&console.warn("Numeral.js: Value is not string. It has been co-erced to: ",e)),e=e.trim(),""===e)return!1;e=e.replace(/^[+-]?/,"");try{a=g.languageData(t)}catch(c){a=g.languageData(g.language())}return r=a.currency.symbol,s=a.abbreviations,n=a.delimiters.decimal,o="."===a.delimiters.thousands?"\\.":a.delimiters.thousands,u=e.match(/^[^\d\.\,]+/),null!==u&&(e=e.substr(1),u[0]!==r)?!1:(u=e.match(/[^\d]+$/),null!==u&&(e=e.slice(0,-1),u[0]!==s.thousand&&u[0]!==s.million&&u[0]!==s.billion&&u[0]!==s.trillion)?!1:e.match(/^\d+$/)?!0:(l=new RegExp(o+"{2}"),e.match(/[^\d.,]/g)?!1:(i=e.split(n),i.length>2?!1:i.length<2?!!i[0].match(/^\d+.*\d$/)&&!i[0].match(l):""===i[0]?!i[0].match(l)&&!!i[1].match(/^\d+$/):1===i[0].length?!!i[0].match(/^\d+$/)&&!i[0].match(l)&&!!i[1].match(/^\d+$/):!!i[0].match(/^\d+.*\d$/)&&!i[0].match(l)&&!!i[1].match(/^\d+$/))))},"function"!=typeof Array.prototype.reduce&&(Array.prototype.reduce=function(e,t){if(null===this||"undefined"==typeof this)throw new TypeError("Array.prototype.reduce called on null or undefined");if("function"!=typeof e)throw new TypeError(e+" is not a function");var n,o,r=this.length>>>0,i=!1;for(1n;++n)this.hasOwnProperty(n)&&(i?o=e(o,this[n],n,this):(o=this[n],i=!0));if(!i)throw new TypeError("Reduce of empty array with no initial value");return o}),g.fn=t.prototype={clone:function(){return g(this)},format:function(e,t){return r(this,e?e:b,void 0!==t?t:Math.round)},unformat:function(e){return"[object Number]"===Object.prototype.toString.call(e)?e:i(this,e?e:b)},value:function(){return this._value},valueOf:function(){return this._value},set:function(e){return this._value=Number(e),this},add:function(e){function t(e,t,o,r){return e+n*t}var n=f.call(null,this._value,e);return this._value=[this._value,e].reduce(t,0)/n,this},subtract:function(e){function t(e,t,o,r){return e-n*t}var n=f.call(null,this._value,e);return this._value=[e].reduce(t,this._value*n)/n,this},multiply:function(e){function t(e,t,n,o){var r=f(e,t);return e*r*(t*r)/(r*r)}return this._value=[this._value,e].reduce(t,1),this},divide:function(e){function t(e,t,n,o){var r=f(e,t);return e*r/(t*r)}return this._value=[this._value,e].reduce(t),this},difference:function(e){return Math.abs(g(this._value).subtract(e).value())}},C&&(n.exports=g),"undefined"==typeof ender&&(this.numeral=g),"function"==typeof e&&e.amd&&e([],function(){return g})}).call(window)},{}]},{},[23,59,61,60,62,83,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,84,85,86,87,100,101,102,90,91,92,93,94,95,31,35,32,33,40,34,36,37,38,39])("numeral")}); \ No newline at end of file +!function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var t;t="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this,t.Handsontable=e()}}(function(){var e;return function(e,t,n){return function o(e,t,n){function r(l,a){if(!t[l]){if(!e[l]){var u="function"==typeof require&&require;if(!a&&u)return u(l,!0);if(i)return i(l,!0);if(s[l]&&"undefined"!=typeof window[s[l]])return window[s[l]];var c=new Error("Cannot find module '"+l+"'");throw c.code="MODULE_NOT_FOUND",c}var d=t[l]={exports:{}};e[l][0].call(d.exports,function(t){var n=e[l][1][t];return r(n?n:t)},d,d.exports,o,e,t,n)}return t[l].exports}for(var i="function"==typeof require&&require,s=JSON.parse('{"zeroclipboard":"ZeroClipboard","moment":"moment","pikaday":"Pikaday"}')||{},l=0;l1)for(t=1,o=arguments.length;o>t;t++)r.push(arguments[t]);if(a){if("undefined"==typeof a[e])throw new Error("Handsontable do not provide action: "+e);i=a[e].apply(a,r),"destroy"===e&&l.removeData()}return i}}(window,jQuery,Handsontable)},{}],2:[function(e,t,n){"use strict";Object.defineProperties(n,{WalkontableBorder:{get:function(){return C}},__esModule:{value:!0}});var o,r,i,s,l,a=(o=e("helpers/dom/element"),o&&o.__esModule&&o||{"default":o}),u=a.getComputedStyle,c=a.getTrimmingContainer,d=a.innerWidth,h=a.innerHeight,f=a.offset,g=a.outerHeight,p=a.outerWidth,m=(r=e("helpers/dom/event"),r&&r.__esModule&&r||{"default":r}).stopImmediatePropagation,w=(i=e("eventManager"),i&&i.__esModule&&i||{"default":i}).EventManager,v=(s=e("cell/coords"),s&&s.__esModule&&s||{"default":s}).WalkontableCellCoords,b=(l=e("overlay/_base.js"),l&&l.__esModule&&l||{"default":l}).WalkontableOverlay,C=function(e,t){t&&(this.eventManager=new w(e),this.instance=e,this.wot=e,this.settings=t,this.mouseDown=!1,this.main=null,this.top=null,this.left=null,this.bottom=null,this.right=null,this.topStyle=null,this.leftStyle=null,this.bottomStyle=null,this.rightStyle=null,this.cornerDefaultStyle={width:"5px",height:"5px",borderWidth:"2px",borderStyle:"solid",borderColor:"#FFF"},this.corner=null,this.cornerStyle=null,this.createBorders(t),this.registerListeners())};$traceurRuntime.createClass(C,{registerListeners:function(){var e=this;this.eventManager.addEventListener(document.body,"mousedown",function(){return e.onMouseDown()}),this.eventManager.addEventListener(document.body,"mouseup",function(){return e.onMouseUp()});for(var t=this,n=function(n,o){t.eventManager.addEventListener(t.main.childNodes[n],"mouseenter",function(t){return e.onMouseEnter(t,e.main.childNodes[n])})},o=0,r=this.main.childNodes.length;r>o;o++)n(o,r)},onMouseDown:function(){this.mouseDown=!0},onMouseUp:function(){this.mouseDown=!1},onMouseEnter:function(e,t){function n(e){return e.clientYMath.ceil(i.top+i.height)?!0:e.clientXMath.ceil(i.left+i.width)?!0:void 0}function o(e){n(e)&&(r.eventManager.removeEventListener(document.body,"mousemove",o),t.style.display="block")}if(this.mouseDown&&this.wot.getSetting("hideBorderOnMouseDownOver")){e.preventDefault(),m(e);var r=this,i=t.getBoundingClientRect();t.style.display="none",this.eventManager.addEventListener(document.body,"mousemove",o)}},createBorders:function(e){this.main=document.createElement("div");var t=["top","left","bottom","right","corner"],n=this.main.style;n.position="absolute",n.top=0,n.left=0;for(var o=0;5>o;o++){var r=t[o],i=document.createElement("div");i.className="wtBorder "+(this.settings.className||""),this.settings[r]&&this.settings[r].hide&&(i.className+=" hidden"),n=i.style,n.backgroundColor=this.settings[r]&&this.settings[r].color?this.settings[r].color:e.border.color,n.height=this.settings[r]&&this.settings[r].width?this.settings[r].width+"px":e.border.width+"px",n.width=this.settings[r]&&this.settings[r].width?this.settings[r].width+"px":e.border.width+"px",this.main.appendChild(i)}this.top=this.main.childNodes[0],this.left=this.main.childNodes[1],this.bottom=this.main.childNodes[2],this.right=this.main.childNodes[3],this.topStyle=this.top.style,this.leftStyle=this.left.style,this.bottomStyle=this.bottom.style,this.rightStyle=this.right.style,this.corner=this.main.childNodes[4],this.corner.className+=" corner",this.cornerStyle=this.corner.style,this.cornerStyle.width=this.cornerDefaultStyle.width,this.cornerStyle.height=this.cornerDefaultStyle.height,this.cornerStyle.border=[this.cornerDefaultStyle.borderWidth,this.cornerDefaultStyle.borderStyle,this.cornerDefaultStyle.borderColor].join(" "),Handsontable.mobileBrowser&&this.createMultipleSelectorHandles(),this.disappear(),this.wot.wtTable.bordersHolder||(this.wot.wtTable.bordersHolder=document.createElement("div"),this.wot.wtTable.bordersHolder.className="htBorders",this.wot.wtTable.spreader.appendChild(this.wot.wtTable.bordersHolder)),this.wot.wtTable.bordersHolder.insertBefore(this.main,this.wot.wtTable.bordersHolder.firstChild)},createMultipleSelectorHandles:function(){this.selectionHandles={topLeft:document.createElement("DIV"),topLeftHitArea:document.createElement("DIV"),bottomRight:document.createElement("DIV"),bottomRightHitArea:document.createElement("DIV")};var e=10,t=40;this.selectionHandles.topLeft.className="topLeftSelectionHandle",this.selectionHandles.topLeftHitArea.className="topLeftSelectionHandle-HitArea",this.selectionHandles.bottomRight.className="bottomRightSelectionHandle",this.selectionHandles.bottomRightHitArea.className="bottomRightSelectionHandle-HitArea",this.selectionHandles.styles={topLeft:this.selectionHandles.topLeft.style,topLeftHitArea:this.selectionHandles.topLeftHitArea.style,bottomRight:this.selectionHandles.bottomRight.style,bottomRightHitArea:this.selectionHandles.bottomRightHitArea.style};var n={position:"absolute",height:t+"px",width:t+"px","border-radius":parseInt(t/1.5,10)+"px"};for(var o in n)n.hasOwnProperty(o)&&(this.selectionHandles.styles.bottomRightHitArea[o]=n[o],this.selectionHandles.styles.topLeftHitArea[o]=n[o]);var r={position:"absolute",height:e+"px",width:e+"px","border-radius":parseInt(e/1.5,10)+"px",background:"#F5F5FF",border:"1px solid #4285c8"};for(var i in r)r.hasOwnProperty(i)&&(this.selectionHandles.styles.bottomRight[i]=r[i],this.selectionHandles.styles.topLeft[i]=r[i]);this.main.appendChild(this.selectionHandles.topLeft),this.main.appendChild(this.selectionHandles.bottomRight),this.main.appendChild(this.selectionHandles.topLeftHitArea),this.main.appendChild(this.selectionHandles.bottomRightHitArea)},isPartRange:function(e,t){return!this.wot.selections.area.cellRange||e==this.wot.selections.area.cellRange.to.row&&t==this.wot.selections.area.cellRange.to.col?!1:!0},updateMultipleSelectionHandlesPosition:function(e,t,n,o,r,i){var s=parseInt(this.selectionHandles.styles.topLeft.width,10),l=parseInt(this.selectionHandles.styles.topLeftHitArea.width,10);this.selectionHandles.styles.topLeft.top=parseInt(n-s,10)+"px",this.selectionHandles.styles.topLeft.left=parseInt(o-s,10)+"px",this.selectionHandles.styles.topLeftHitArea.top=parseInt(n-l/4*3,10)+"px",this.selectionHandles.styles.topLeftHitArea.left=parseInt(o-l/4*3,10)+"px",this.selectionHandles.styles.bottomRight.top=parseInt(n+i,10)+"px",this.selectionHandles.styles.bottomRight.left=parseInt(o+r,10)+"px",this.selectionHandles.styles.bottomRightHitArea.top=parseInt(n+i-l/4,10)+"px",this.selectionHandles.styles.bottomRightHitArea.left=parseInt(o+r-l/4,10)+"px",this.settings.border.multipleSelectionHandlesVisible&&this.settings.border.multipleSelectionHandlesVisible()?(this.selectionHandles.styles.topLeft.display="block",this.selectionHandles.styles.topLeftHitArea.display="block",this.isPartRange(e,t)?(this.selectionHandles.styles.bottomRight.display="none",this.selectionHandles.styles.bottomRightHitArea.display="none"):(this.selectionHandles.styles.bottomRight.display="block",this.selectionHandles.styles.bottomRightHitArea.display="block")):(this.selectionHandles.styles.topLeft.display="none",this.selectionHandles.styles.bottomRight.display="none",this.selectionHandles.styles.topLeftHitArea.display="none",this.selectionHandles.styles.bottomRightHitArea.display="none"),e==this.wot.wtSettings.getSetting("fixedRowsTop")||t==this.wot.wtSettings.getSetting("fixedColumnsLeft")?(this.selectionHandles.styles.topLeft.zIndex="9999",this.selectionHandles.styles.topLeftHitArea.zIndex="9999"):(this.selectionHandles.styles.topLeft.zIndex="",this.selectionHandles.styles.topLeftHitArea.zIndex="")},appear:function(e){if(!this.disabled){var t,n,o,r,i,s,l,a,m,w,C,y,R,E,S,T,O,_,M;M=b.isOverlayTypeOf(this.wot.cloneOverlay,b.CLONE_TOP)||b.isOverlayTypeOf(this.wot.cloneOverlay,b.CLONE_TOP_LEFT_CORNER)?this.wot.getSetting("fixedRowsTop"):b.isOverlayTypeOf(this.wot.cloneOverlay,b.CLONE_BOTTOM)||b.isOverlayTypeOf(this.wot.cloneOverlay,b.CLONE_BOTTOM_LEFT_CORNER)?this.wot.getSetting("fixedRowsBottom"):this.wot.wtTable.getRenderedRowsCount();for(var H=0;M>H;H++){var k=this.wot.wtTable.rowFilter.renderedToSource(H);if(k>=e[0]&&k<=e[2]){R=k;break}}for(var A=M-1;A>=0;A--){var P=this.wot.wtTable.rowFilter.renderedToSource(A);if(P>=e[0]&&P<=e[2]){S=P;break}}M=this.wot.wtTable.getRenderedColumnsCount();for(var x=0;M>x;x++){var D=this.wot.wtTable.columnFilter.renderedToSource(x);if(D>=e[1]&&D<=e[3]){E=D;break}}for(var N=M-1;N>=0;N--){var L=this.wot.wtTable.columnFilter.renderedToSource(N);if(L>=e[1]&&L<=e[3]){T=L;break}}if(void 0===R||void 0===E)return void this.disappear();t=R!==S||E!==T,n=this.wot.wtTable.getCell(new v(R,E)),o=t?this.wot.wtTable.getCell(new v(S,T)):n,r=f(n),i=t?f(o):r,s=f(this.wot.wtTable.TABLE),a=r.top,C=i.top+g(o)-a,w=r.left,y=i.left+p(o)-w,l=a-s.top-1,m=w-s.left-1;var W=u(n);parseInt(W.borderTopWidth,10)>0&&(l+=1,C=C>0?C-1:0),parseInt(W.borderLeftWidth,10)>0&&(m+=1,y=y>0?y-1:0),this.topStyle.top=l+"px",this.topStyle.left=m+"px",this.topStyle.width=y+"px",this.topStyle.display="block",this.leftStyle.top=l+"px",this.leftStyle.left=m+"px",this.leftStyle.height=C+"px",this.leftStyle.display="block";var I=Math.floor(this.settings.border.width/2);this.bottomStyle.top=l+C-I+"px",this.bottomStyle.left=m+"px",this.bottomStyle.width=y+"px",this.bottomStyle.display="block",this.rightStyle.top=l+"px",this.rightStyle.left=m+y-I+"px",this.rightStyle.height=C+1+"px",this.rightStyle.display="block",Handsontable.mobileBrowser||!this.hasSetting(this.settings.border.cornerVisible)||this.isPartRange(S,T)?this.cornerStyle.display="none":(this.cornerStyle.top=l+C-4+"px",this.cornerStyle.left=m+y-4+"px",this.cornerStyle.borderRightWidth=this.cornerDefaultStyle.borderWidth,this.cornerStyle.width=this.cornerDefaultStyle.width,this.cornerStyle.display="block",O=c(this.wot.wtTable.TABLE),T===this.wot.getSetting("totalColumns")-1&&(_=o.offsetLeft+p(o)>=d(O),_&&(this.cornerStyle.left=Math.floor(m+y-3-parseInt(this.cornerDefaultStyle.width)/2)+"px",this.cornerStyle.borderRightWidth=0)),S===this.wot.getSetting("totalRows")-1&&(_=o.offsetTop+g(o)>=h(O),_&&(this.cornerStyle.top=Math.floor(l+C-3-parseInt(this.cornerDefaultStyle.height)/2)+"px",this.cornerStyle.borderBottomWidth=0))),Handsontable.mobileBrowser&&this.updateMultipleSelectionHandlesPosition(R,E,l,m,y,C)}},disappear:function(){this.topStyle.display="none",this.leftStyle.display="none",this.bottomStyle.display="none",this.rightStyle.display="none",this.cornerStyle.display="none",Handsontable.mobileBrowser&&(this.selectionHandles.styles.topLeft.display="none",this.selectionHandles.styles.bottomRight.display="none")},hasSetting:function(e){return"function"==typeof e?e():!!e}},{}),window.WalkontableBorder=C},{"cell/coords":5,eventManager:41,"helpers/dom/element":45,"helpers/dom/event":46,"overlay/_base.js":11}],3:[function(e,t,n){"use strict";Object.defineProperties(n,{WalkontableViewportColumnsCalculator:{get:function(){return r}},__esModule:{value:!0}});var o=new WeakMap,r=function(e,t,n,r,i,s,l){o.set(this,{viewportWidth:e,scrollOffset:t,totalColumns:n,columnWidthFn:r,overrideFn:i,onlyFullyVisible:s}),this.count=0,this.startColumn=null,this.endColumn=null,this.startPosition=null,this.stretchAllRatio=0,this.stretchLastWidth=0,this.stretch=l,this.totalTargetWidth=0,this.needVerifyLastColumnWidth=!0,this.stretchAllColumnsWidth=[],this.calculate()},i=r;$traceurRuntime.createClass(r,{calculate:function(){for(var e,t=0,n=!0,r=[],i=o.get(this),s=i.onlyFullyVisible,l=i.overrideFn,a=i.scrollOffset,u=i.totalColumns,c=i.viewportWidth,d=0;u>d;d++)if(e=this._getColumnWidth(d),a>=t&&!s&&(this.startColumn=d),t>=a&&a+c>=t+e&&(null==this.startColumn&&(this.startColumn=d),this.endColumn=d),r.push(t),t+=e,s||(this.endColumn=d),t>=a+c){n=!1;break}if(this.endColumn===u-1&&n)for(this.startColumn=this.endColumn;this.startColumn>0;){var h=r[this.endColumn]+e-r[this.startColumn-1];if((c>=h||!s)&&this.startColumn--,h>c)break}null!==this.startColumn&&l&&l(this),this.startPosition=r[this.startColumn],void 0==this.startPosition&&(this.startPosition=null),null!==this.startColumn&&(this.count=this.endColumn-this.startColumn+1)},refreshStretching:function(e){if("none"!==this.stretch){for(var t,n,r=0,i=o.get(this),s=i.totalColumns,l=0;s>l;l++)t=this._getColumnWidth(l),r+=t;this.totalTargetWidth=e,n=r-e,"all"===this.stretch&&0>n?(this.stretchAllRatio=e/r,this.stretchAllColumnsWidth=[],this.needVerifyLastColumnWidth=!0):"last"===this.stretch&&e!==1/0&&(this.stretchLastWidth=-n+this._getColumnWidth(s-1))}},getStretchedColumnWidth:function(e,t){var n=null;return"all"===this.stretch&&0!==this.stretchAllRatio?n=this._getStretchedAllColumnWidth(e,t):"last"===this.stretch&&0!==this.stretchLastWidth&&(n=this._getStretchedLastColumnWidth(e)),n},_getStretchedAllColumnWidth:function(e,t){var n=0,r=o.get(this),i=r.totalColumns;if(this.stretchAllColumnsWidth[e]||(this.stretchAllColumnsWidth[e]=Math.round(t*this.stretchAllRatio)),this.stretchAllColumnsWidth.length===i&&this.needVerifyLastColumnWidth){this.needVerifyLastColumnWidth=!1;for(var s=0;sf;f++){var g=a(f);if(void 0===g&&(g=i.DEFAULT_HEIGHT),u>=e&&!s&&(this.startRow=f),e>=u&&u+d-h>=e+g&&(null===this.startRow&&(this.startRow=f),this.endRow=f),n.push(e),e+=g,s||(this.endRow=f),e>=u+d-h){t=!1;break}}if(this.endRow===c-1&&t)for(this.startRow=this.endRow;this.startRow>0;){var p=n[this.endRow]+g-n[this.startRow-1];if((d-h>=p||!s)&&this.startRow--,p>=d-h)break}null!==this.startRow&&l&&l(this),this.startPosition=n[this.startRow],void 0==this.startPosition&&(this.startPosition=null),null!==this.startRow&&(this.count=this.endRow-this.startRow+1)}},{get DEFAULT_HEIGHT(){return 23}}),window.WalkontableViewportRowsCalculator=r},{}],5:[function(e,t,n){"use strict";Object.defineProperties(n,{WalkontableCellCoords:{get:function(){return o}},__esModule:{value:!0}});var o=function(e,t){"undefined"!=typeof e&&"undefined"!=typeof t?(this.row=e,this.col=t):(this.row=null,this.col=null)};$traceurRuntime.createClass(o,{isValid:function(e){return this.row<0||this.col<0?!1:this.row>=e.getSetting("totalRows")||this.col>=e.getSetting("totalColumns")?!1:!0},isEqual:function(e){return e===this?!0:this.row===e.row&&this.col===e.col},isSouthEastOf:function(e){return this.row>=e.row&&this.col>=e.col},isNorthWestOf:function(e){return this.row<=e.row&&this.col<=e.col},isSouthWestOf:function(e){return this.row>=e.row&&this.col<=e.col},isNorthEastOf:function(e){return this.row<=e.row&&this.col>=e.col}},{}),window.WalkontableCellCoords=o},{}],6:[function(e,t,n){"use strict";Object.defineProperties(n,{WalkontableCellRange:{get:function(){return i}},__esModule:{value:!0}});var o,r=(o=e("cell/coords"),o&&o.__esModule&&o||{"default":o}).WalkontableCellCoords,i=function(e,t,n){this.highlight=e,this.from=t,this.to=n},s=i;$traceurRuntime.createClass(i,{isValid:function(e){return this.from.isValid(e)&&this.to.isValid(e)},isSingle:function(){return this.from.row===this.to.row&&this.from.col===this.to.col},getHeight:function(){return Math.max(this.from.row,this.to.row)-Math.min(this.from.row,this.to.row)+1},getWidth:function(){return Math.max(this.from.col,this.to.col)-Math.min(this.from.col,this.to.col)+1},includes:function(e){var t=this.getTopLeftCorner(),n=this.getBottomRightCorner();return e.row<0&&(e.row=0),e.col<0&&(e.col=0),t.row<=e.row&&n.row>=e.row&&t.col<=e.col&&n.col>=e.col},includesRange:function(e){return this.includes(e.getTopLeftCorner())&&this.includes(e.getBottomRightCorner())},isEqual:function(e){return Math.min(this.from.row,this.to.row)==Math.min(e.from.row,e.to.row)&&Math.max(this.from.row,this.to.row)==Math.max(e.from.row,e.to.row)&&Math.min(this.from.col,this.to.col)==Math.min(e.from.col,e.to.col)&&Math.max(this.from.col,this.to.col)==Math.max(e.from.col,e.to.col)},overlaps:function(e){return e.isSouthEastOf(this.getTopLeftCorner())&&e.isNorthWestOf(this.getBottomRightCorner())},isSouthEastOf:function(e){return this.getTopLeftCorner().isSouthEastOf(e)||this.getBottomRightCorner().isSouthEastOf(e)},isNorthWestOf:function(e){return this.getTopLeftCorner().isNorthWestOf(e)||this.getBottomRightCorner().isNorthWestOf(e)},expand:function(e){var t=this.getTopLeftCorner(),n=this.getBottomRightCorner();return e.rown.row||e.col>n.col?(this.from=new r(Math.min(t.row,e.row),Math.min(t.col,e.col)),this.to=new r(Math.max(n.row,e.row),Math.max(n.col,e.col)),!0):!1},expandByRange:function(e){if(this.includesRange(e)||!this.overlaps(e))return!1;var t=this.getTopLeftCorner(),n=this.getBottomRightCorner(),o=(this.getTopRightCorner(),this.getBottomLeftCorner(),e.getTopLeftCorner()),i=e.getBottomRightCorner(),l=Math.min(t.row,o.row),a=Math.min(t.col,o.col),u=Math.max(n.row,i.row),c=Math.max(n.col,i.col),d=new r(l,a),h=new r(u,c),f=new s(d,d,h).isCorner(this.from,e),g=e.isEqual(new s(d,d,h));return f&&!g&&(this.from.col>d.col&&(d.col=c,h.col=a),this.from.row>d.row&&(d.row=u,h.row=l)),this.from=d,this.to=h,!0},getDirection:function(){return this.from.isNorthWestOf(this.to)?"NW-SE":this.from.isNorthEastOf(this.to)?"NE-SW":this.from.isSouthEastOf(this.to)?"SE-NW":this.from.isSouthWestOf(this.to)?"SW-NE":void 0},setDirection:function(e){switch(e){case"NW-SE":this.from=this.getTopLeftCorner(),this.to=this.getBottomRightCorner();break;case"NE-SW":this.from=this.getTopRightCorner(),this.to=this.getBottomLeftCorner();break;case"SE-NW":this.from=this.getBottomRightCorner(),this.to=this.getTopLeftCorner();break;case"SW-NE":this.from=this.getBottomLeftCorner(),this.to=this.getTopRightCorner()}},getTopLeftCorner:function(){return new r(Math.min(this.from.row,this.to.row),Math.min(this.from.col,this.to.col))},getBottomRightCorner:function(){return new r(Math.max(this.from.row,this.to.row),Math.max(this.from.col,this.to.col))},getTopRightCorner:function(){return new r(Math.min(this.from.row,this.to.row),Math.max(this.from.col,this.to.col))},getBottomLeftCorner:function(){return new r(Math.max(this.from.row,this.to.row),Math.min(this.from.col,this.to.col))},isCorner:function(e,t){return t&&t.includes(e)&&(this.getTopLeftCorner().isEqual(new r(t.from.row,t.from.col))||this.getTopRightCorner().isEqual(new r(t.from.row,t.to.col))||this.getBottomLeftCorner().isEqual(new r(t.to.row,t.from.col))||this.getBottomRightCorner().isEqual(new r(t.to.row,t.to.col)))?!0:e.isEqual(this.getTopLeftCorner())||e.isEqual(this.getTopRightCorner())||e.isEqual(this.getBottomLeftCorner())||e.isEqual(this.getBottomRightCorner())},getOppositeCorner:function(e,t){if(!(e instanceof r))return!1;if(t&&t.includes(e)){if(this.getTopLeftCorner().isEqual(new r(t.from.row,t.from.col)))return this.getBottomRightCorner();if(this.getTopRightCorner().isEqual(new r(t.from.row,t.to.col)))return this.getBottomLeftCorner();if(this.getBottomLeftCorner().isEqual(new r(t.to.row,t.from.col)))return this.getTopRightCorner();if(this.getBottomRightCorner().isEqual(new r(t.to.row,t.to.col)))return this.getTopLeftCorner()}return e.isEqual(this.getBottomRightCorner())?this.getTopLeftCorner():e.isEqual(this.getTopLeftCorner())?this.getBottomRightCorner():e.isEqual(this.getTopRightCorner())?this.getBottomLeftCorner():e.isEqual(this.getBottomLeftCorner())?this.getTopRightCorner():void 0},getBordersSharedWith:function(e){if(!this.includesRange(e))return[];var t={top:Math.min(this.from.row,this.to.row),bottom:Math.max(this.from.row,this.to.row),left:Math.min(this.from.col,this.to.col),right:Math.max(this.from.col,this.to.col)},n={top:Math.min(e.from.row,e.to.row),bottom:Math.max(e.from.row,e.to.row),left:Math.min(e.from.col,e.to.col),right:Math.max(e.from.col,e.to.col)},o=[];return t.top==n.top&&o.push("top"),t.right==n.right&&o.push("right"),t.bottom==n.bottom&&o.push("bottom"),t.left==n.left&&o.push("left"),o},getInner:function(){for(var e=this.getTopLeftCorner(),t=this.getBottomRightCorner(),n=[],o=e.row;o<=t.row;o++)for(var i=e.col;i<=t.col;i++)this.from.row===o&&this.from.col===i||this.to.row===o&&this.to.col===i||n.push(new r(o,i));return n},getAll:function(){for(var e=this.getTopLeftCorner(),t=this.getBottomRightCorner(),n=[],o=e.row;o<=t.row;o++)for(var i=e.col;i<=t.col;i++)e.row===o&&e.col===i?n.push(e):t.row===o&&t.col===i?n.push(t):n.push(new r(o,i));return n},forAll:function(e){for(var t=this.getTopLeftCorner(),n=this.getBottomRightCorner(),o=t.row;o<=n.row;o++)for(var r=t.col;r<=n.col;r++){var i=e(o,r);if(i===!1)return}}},{}),window.WalkontableCellRange=i},{"cell/coords":5}],7:[function(e,t,n){"use strict";Object.defineProperties(n,{Walkontable:{get:function(){return P}},__esModule:{value:!0}});var o,r,i,s,l,a,u,c,d,h,f,g,p,m,w=(o=e("helpers/dom/element"),o&&o.__esModule&&o||{"default":o}),v=w.addClass,b=w.fastInnerText,C=w.isVisible,y=w.removeClass,R=(r=e("helpers/object"),r&&r.__esModule&&r||{"default":r}).objectEach,E=(i=e("helpers/string"),i&&i.__esModule&&i||{"default":i}),S=E.toUpperCaseFirst,T=E.randomString,O=(s=e("event"),s&&s.__esModule&&s||{"default":s}).WalkontableEvent,_=(l=e("overlays"),l&&l.__esModule&&l||{"default":l}).WalkontableOverlays,M=(a=e("scroll"),a&&a.__esModule&&a||{"default":a}).WalkontableScroll,H=(u=e("settings"),u&&u.__esModule&&u||{"default":u}).WalkontableSettings,k=(c=e("table"),c&&c.__esModule&&c||{"default":c}).WalkontableTable,A=(d=e("viewport"),d&&d.__esModule&&d||{"default":d}).WalkontableViewport,P=((h=e("overlay/_base.js"),h&&h.__esModule&&h||{"default":h}).WalkontableOverlay,(f=e("overlay/top.js"),f&&f.__esModule&&f||{"default":f}).WalkontableTopOverlay,(g=e("overlay/left.js"),g&&g.__esModule&&g||{"default":g}).WalkontableLeftOverlay,(p=e("overlay/debug.js"),p&&p.__esModule&&p||{"default":p}).WalkontableDebugOverlay,(m=e("overlay/topLeftCorner.js"),m&&m.__esModule&&m||{"default":m}).WalkontableTopLeftCornerOverlay,function(e){var t=[];if(this.guid="wt_"+T(),e.cloneSource?(this.cloneSource=e.cloneSource,this.cloneOverlay=e.cloneOverlay,this.wtSettings=e.cloneSource.wtSettings,this.wtTable=new k(this,e.table,e.wtRootElement),this.wtScroll=new M(this),this.wtViewport=e.cloneSource.wtViewport,this.wtEvent=new O(this),this.selections=this.cloneSource.selections):(this.wtSettings=new H(this,e),this.wtTable=new k(this,e.table),this.wtScroll=new M(this),this.wtViewport=new A(this),this.wtEvent=new O(this),this.selections=this.getSetting("selections"),this.wtOverlays=new _(this),this.exportSettingsAsClassNames()),this.wtTable.THEAD.childNodes.length&&this.wtTable.THEAD.childNodes[0].childNodes.length){for(var n=0,o=this.wtTable.THEAD.childNodes[0].childNodes.length;o>n;n++)t.push(this.wtTable.THEAD.childNodes[0].childNodes[n].innerHTML);this.getSetting("columnHeaders").length||this.update("columnHeaders",[function(e,n){b(n,t[e])}])}this.drawn=!1,this.drawInterrupted=!1});$traceurRuntime.createClass(P,{draw:function(){var e=void 0!==arguments[0]?arguments[0]:!1;return this.drawInterrupted=!1,e||C(this.wtTable.TABLE)?this.wtTable.draw(e):this.drawInterrupted=!0,this},getCell:function(e){var t=void 0!==arguments[1]?arguments[1]:!1;if(!t)return this.wtTable.getCell(e);var n=this.wtSettings.getSetting("totalRows"),o=this.wtSettings.getSetting("fixedRowsTop"),r=this.wtSettings.getSetting("fixedRowsBottom"),i=this.wtSettings.getSetting("fixedColumnsLeft");if(e.row=n-r){if(this.wtOverlays.bottomLeftCornerOverlay.clone)return this.wtOverlays.bottomLeftCornerOverlay.clone.wtTable.getCell(e)}else{if(e.coln-r&&this.wtOverlays.bottomOverlay.clone)return this.wtOverlays.bottomOverlay.clone.wtTable.getCell(e)}return this.wtTable.getCell(e)},update:function(e,t){return this.wtSettings.update(e,t)},scrollVertical:function(e){return this.wtOverlays.topOverlay.scrollTo(e),this.getSetting("onScrollVertically"),this},scrollHorizontal:function(e){return this.wtOverlays.leftOverlay.scrollTo(e),this.getSetting("onScrollHorizontally"),this},scrollViewport:function(e){return this.wtScroll.scrollViewport(e),this},getViewport:function(){return[this.wtTable.getFirstVisibleRow(),this.wtTable.getFirstVisibleColumn(),this.wtTable.getLastVisibleRow(),this.wtTable.getLastVisibleColumn()]},getOverlayName:function(){return this.cloneOverlay?this.cloneOverlay.type:"master"},exportSettingsAsClassNames:function(){var e=this,t={rowHeaders:["array"],columnHeaders:["array"]},n=[],o=[];R(t,function(t,r){t.indexOf("array")>-1&&e.getSetting(r).length&&o.push("ht"+S(r)),n.push("ht"+S(r))}),y(this.wtTable.wtRootElement.parentNode,n),v(this.wtTable.wtRootElement.parentNode,o)},getSetting:function(e,t,n,o,r){return this.wtSettings.getSetting(e,t,n,o,r)},hasSetting:function(e){return this.wtSettings.has(e)},destroy:function(){this.wtOverlays.destroy(),this.wtEvent.destroy()}},{}),window.Walkontable=P},{event:8,"helpers/dom/element":45,"helpers/object":50,"helpers/string":52,"overlay/_base.js":11,"overlay/debug.js":12,"overlay/left.js":13,"overlay/top.js":14,"overlay/topLeftCorner.js":15,overlays:16,scroll:17,settings:19,table:20,viewport:22}],8:[function(e,t,n){"use strict";function o(e){var t=this,n=c(e);this.instance=e;var o=[null,null];this.dblClickTimeout=[null,null];var r,i,s=function(e){var n=t.parentCell(e.realTarget);a(e.realTarget,"corner")?t.instance.getSetting("onCellCornerMouseDown",e,e.realTarget):n.TD&&t.instance.hasSetting("onCellMouseDown")&&t.instance.getSetting("onCellMouseDown",e,n.coords,n.TD,t.instance),2!==e.button&&n.TD&&(o[0]=n.TD,clearTimeout(t.dblClickTimeout[0]),t.dblClickTimeout[0]=setTimeout(function(){o[0]=null},1e3))},d=function(e){t.instance.touchMoving=!0},h=function(e){n.addEventListener(this,"touchmove",d),t.checkIfTouchMove=setTimeout(function(){return t.instance.touchMoving===!0?(t.instance.touchMoving=void 0,void n.removeEventListener("touchmove",d,!1)):void s(e)},30)},f=function(e){var n,o;t.instance.hasSetting("onCellMouseOver")&&(n=t.instance.wtTable.TABLE,o=l(e.realTarget,["TD","TH"],n),o&&o!==i&&u(o,n)&&(i=o,t.instance.getSetting("onCellMouseOver",e,t.instance.wtTable.getCoords(o),o,t.instance)))},g=function(e){if(2!==e.button){var n=t.parentCell(e.realTarget);n.TD===o[0]&&n.TD===o[1]?(a(e.realTarget,"corner")?t.instance.getSetting("onCellCornerDblClick",e,n.coords,n.TD,t.instance):t.instance.getSetting("onCellDblClick",e,n.coords,n.TD,t.instance),o[0]=null,o[1]=null):n.TD===o[0]&&(o[1]=n.TD,clearTimeout(t.dblClickTimeout[1]),t.dblClickTimeout[1]=setTimeout(function(){o[1]=null},500))}},p=function(e){clearTimeout(r),e.preventDefault(),g(e)};if(n.addEventListener(this.instance.wtTable.holder,"mousedown",s),n.addEventListener(this.instance.wtTable.TABLE,"mouseover",f),n.addEventListener(this.instance.wtTable.holder,"mouseup",g),this.instance.wtTable.holder.parentNode.parentNode&&Handsontable.mobileBrowser&&!t.instance.wtTable.isWorkingOnClone()){var m="."+this.instance.wtTable.holder.parentNode.className.split(" ").join(".");n.addEventListener(this.instance.wtTable.holder,"touchstart",function(e){t.instance.touchApplied=!0,u(e.target,m)&&h.call(e.target,e)}),n.addEventListener(this.instance.wtTable.holder,"touchend",function(e){t.instance.touchApplied=!1,u(e.target,m)&&p.call(e.target,e)}),t.instance.momentumScrolling||(t.instance.momentumScrolling={}),n.addEventListener(this.instance.wtTable.holder,"scroll",function(e){clearTimeout(t.instance.momentumScrolling._timeout),t.instance.momentumScrolling.ongoing||t.instance.getSetting("onBeforeTouchScroll"),t.instance.momentumScrolling.ongoing=!0,t.instance.momentumScrolling._timeout=setTimeout(function(){t.instance.touchApplied||(t.instance.momentumScrolling.ongoing=!1,t.instance.getSetting("onAfterMomentumScroll"))},200)})}n.addEventListener(window,"resize",function(){"none"!==t.instance.getSetting("stretchH")&&t.instance.draw()}),this.destroy=function(){clearTimeout(this.dblClickTimeout[0]),clearTimeout(this.dblClickTimeout[1]),n.destroy()}}Object.defineProperties(n,{WalkontableEvent:{get:function(){return o}},__esModule:{value:!0}});var r,i,s=(r=e("helpers/dom/element"),r&&r.__esModule&&r||{"default":r}),l=s.closest,a=s.hasClass,u=s.isChildOf,c=(i=e("eventManager"),i&&i.__esModule&&i||{"default":i}).eventManager;o.prototype.parentCell=function(e){var t={},n=this.instance.wtTable.TABLE,o=l(e,["TD","TH"],n);return o&&u(o,n)?(t.coords=this.instance.wtTable.getCoords(o),t.TD=o):a(e,"wtBorder")&&a(e,"current")?(t.coords=this.instance.selections.current.cellRange.highlight,t.TD=this.instance.wtTable.getCell(t.coords)):a(e,"wtBorder")&&a(e,"area")&&this.instance.selections.area.cellRange&&(t.coords=this.instance.selections.area.cellRange.to,t.TD=this.instance.wtTable.getCell(t.coords)),t},window.WalkontableEvent=o},{eventManager:41,"helpers/dom/element":45}],9:[function(e,t,n){"use strict";Object.defineProperties(n,{WalkontableColumnFilter:{get:function(){return o}},__esModule:{value:!0}});var o=function(e,t,n){this.offset=e,this.total=t,this.countTH=n};$traceurRuntime.createClass(o,{offsetted:function(e){return e+this.offset},unOffsetted:function(e){return e-this.offset},renderedToSource:function(e){return this.offsetted(e)},sourceToRendered:function(e){return this.unOffsetted(e)},offsettedTH:function(e){return e-this.countTH},unOffsettedTH:function(e){return e+this.countTH},visibleRowHeadedColumnToSourceColumn:function(e){return this.renderedToSource(this.offsettedTH(e))},sourceColumnToVisibleRowHeadedColumn:function(e){return this.unOffsettedTH(this.sourceToRendered(e))}},{}),window.WalkontableColumnFilter=o; +},{}],10:[function(e,t,n){"use strict";Object.defineProperties(n,{WalkontableRowFilter:{get:function(){return o}},__esModule:{value:!0}});var o=function(e,t,n){this.offset=e,this.total=t,this.countTH=n};$traceurRuntime.createClass(o,{offsetted:function(e){return e+this.offset},unOffsetted:function(e){return e-this.offset},renderedToSource:function(e){return this.offsetted(e)},sourceToRendered:function(e){return this.unOffsetted(e)},offsettedTH:function(e){return e-this.countTH},unOffsettedTH:function(e){return e+this.countTH},visibleColHeadedRowToSourceRow:function(e){return this.renderedToSource(this.offsettedTH(e))},sourceRowToVisibleColHeadedRow:function(e){return this.unOffsettedTH(this.sourceToRendered(e))}},{}),window.WalkontableRowFilter=o},{}],11:[function(e,t,n){"use strict";Object.defineProperties(n,{WalkontableOverlay:{get:function(){return h}},__esModule:{value:!0}});var o,r,i,s=(o=e("helpers/dom/element"),o&&o.__esModule&&o||{"default":o}),l=s.getScrollableElement,a=s.getTrimmingContainer,u=(r=e("helpers/object"),r&&r.__esModule&&r||{"default":r}).defineGetter,c=(i=e("eventManager"),i&&i.__esModule&&i||{"default":i}).eventManager,d={},h=function(e){u(this,"wot",e,{writable:!1}),this.instance=this.wot,this.type="",this.TABLE=this.wot.wtTable.TABLE,this.hider=this.wot.wtTable.hider,this.spreader=this.wot.wtTable.spreader,this.holder=this.wot.wtTable.holder,this.wtRootElement=this.wot.wtTable.wtRootElement,this.trimmingContainer=a(this.hider.parentNode.parentNode),this.mainTableScrollableElement=l(this.wot.wtTable.TABLE),this.needFullRender=this.shouldBeRendered(),this.areElementSizesAdjusted=!1},f=h;$traceurRuntime.createClass(h,{shouldBeRendered:function(){return!0},makeClone:function(e){if(-1===f.CLONE_TYPES.indexOf(e))throw new Error('Clone type "'+e+'" is not supported.');var t=document.createElement("DIV"),n=document.createElement("TABLE");return t.className="ht_clone_"+e+" handsontable",t.style.position="absolute",t.style.top=0,t.style.left=0,t.style.overflow="hidden",n.className=this.wot.wtTable.TABLE.className,t.appendChild(n),this.type=e,this.wot.wtTable.wtRootElement.parentNode.appendChild(t),new Walkontable({cloneSource:this.wot,cloneOverlay:this,table:n})},refresh:function(){var e=void 0!==arguments[0]?arguments[0]:!1,t=this.shouldBeRendered();this.clone&&(this.needFullRender||t)&&this.clone.draw(e),this.needFullRender=t},destroy:function(){c(this.clone).destroy()}},{get CLONE_TOP(){return"top"},get CLONE_BOTTOM(){return"bottom"},get CLONE_LEFT(){return"left"},get CLONE_TOP_LEFT_CORNER(){return"top_left_corner"},get CLONE_BOTTOM_LEFT_CORNER(){return"bottom_left_corner"},get CLONE_DEBUG(){return"debug"},get CLONE_TYPES(){return[f.CLONE_TOP,f.CLONE_BOTTOM,f.CLONE_LEFT,f.CLONE_TOP_LEFT_CORNER,f.CLONE_BOTTOM_LEFT_CORNER,f.CLONE_DEBUG]},registerOverlay:function(e,t){if(-1===f.CLONE_TYPES.indexOf(e))throw new Error("Unsupported overlay ("+e+").");d[e]=t},createOverlay:function(e,t){return new d[e](t)},isOverlayTypeOf:function(e,t){return e&&d[t]?e instanceof d[t]:!1}}),window.WalkontableOverlay=h},{eventManager:41,"helpers/dom/element":45,"helpers/object":50}],12:[function(e,t,n){"use strict";Object.defineProperties(n,{WalkontableDebugOverlay:{get:function(){return l}},__esModule:{value:!0}});var o,r,i=(o=e("helpers/dom/element"),o&&o.__esModule&&o||{"default":o}).addClass,s=(r=e("_base"),r&&r.__esModule&&r||{"default":r}).WalkontableOverlay,l=function(e){$traceurRuntime.superConstructor(a).call(this,e),this.clone=this.makeClone(s.CLONE_DEBUG),this.clone.wtTable.holder.style.opacity=.4,this.clone.wtTable.holder.style.textShadow="0 0 2px #ff0000",i(this.clone.wtTable.holder.parentNode,"wtDebugVisible")},a=l;$traceurRuntime.createClass(l,{},{},s),window.WalkontableDebugOverlay=l,s.registerOverlay(s.CLONE_DEBUG,l)},{_base:11,"helpers/dom/element":45}],13:[function(e,t,n){"use strict";Object.defineProperties(n,{WalkontableLeftOverlay:{get:function(){return p}},__esModule:{value:!0}});var o,r,i=(o=e("helpers/dom/element"),o&&o.__esModule&&o||{"default":o}),s=i.addClass,l=i.getScrollbarWidth,a=i.getScrollLeft,u=i.getWindowScrollTop,c=i.hasClass,d=i.outerWidth,h=i.removeClass,f=i.setOverlayPosition,g=(r=e("_base"),r&&r.__esModule&&r||{"default":r}).WalkontableOverlay,p=function(e){$traceurRuntime.superConstructor(m).call(this,e),this.clone=this.makeClone(g.CLONE_LEFT)},m=p;$traceurRuntime.createClass(p,{shouldBeRendered:function(){return this.wot.getSetting("fixedColumnsLeft")||this.wot.getSetting("rowHeaders").length?!0:!1},resetFixedPosition:function(){if(this.needFullRender&&this.wot.wtTable.holder.parentNode){var e=this.clone.wtTable.holder.parentNode,t=0;if(this.trimmingContainer===window){var n,o,r=this.wot.wtTable.hider.getBoundingClientRect(),i=Math.ceil(r.left),s=Math.ceil(r.right);o=this.wot.wtTable.hider.style.top,o=""===o?0:o,n=0>i&&s-e.offsetWidth>0?-i:0,t=n,n+="px",f(e,n,o)}else t=this.getScrollPosition();this.adjustHeaderBordersPosition(t),this.adjustElementsSize()}},setScrollPosition:function(e){this.mainTableScrollableElement===window?window.scrollTo(e,u()):this.mainTableScrollableElement.scrollLeft=e},onScroll:function(){this.wot.getSetting("onScrollVertically")},sumCellSizes:function(e,t){for(var n=0,o=this.wot.wtSettings.defaultColumnWidth;t>e;)n+=this.wot.wtTable.getStretchedColumnWidth(e)||o,e++;return n},adjustElementsSize:function(){var e=void 0!==arguments[0]?arguments[0]:!1;(this.needFullRender||e)&&(this.adjustRootElementSize(),this.adjustRootChildrenSize(),e||(this.areElementSizesAdjusted=!0))},adjustRootElementSize:function(){var e,t=this.wot.wtTable.holder,n=t.clientHeight===t.offsetHeight?0:l(),o=this.clone.wtTable.holder.parentNode,r=o.style;this.trimmingContainer!==window&&(r.height=this.wot.wtViewport.getWorkspaceHeight()-n+"px"),this.clone.wtTable.holder.style.height=r.height,e=d(this.clone.wtTable.TABLE),r.width=(0===e?e:e+4)+"px"},adjustRootChildrenSize:function(){var e=l();this.clone.wtTable.hider.style.height=this.hider.style.height,this.clone.wtTable.holder.style.height=this.clone.wtTable.holder.parentNode.style.height,0===e&&(e=30),this.clone.wtTable.holder.style.width=parseInt(this.clone.wtTable.holder.parentNode.style.width,10)+e+"px"},applyToDOM:function(){var e=this.wot.getSetting("totalColumns");if(this.areElementSizesAdjusted||this.adjustElementsSize(),"number"==typeof this.wot.wtViewport.columnsRenderCalculator.startPosition)this.spreader.style.left=this.wot.wtViewport.columnsRenderCalculator.startPosition+"px";else{if(0!==e)throw new Error("Incorrect value of the columnsRenderCalculator");this.spreader.style.left="0"}this.spreader.style.right="",this.needFullRender&&this.syncOverlayOffset()},syncOverlayOffset:function(){"number"==typeof this.wot.wtViewport.rowsRenderCalculator.startPosition?this.clone.wtTable.spreader.style.top=this.wot.wtViewport.rowsRenderCalculator.startPosition+"px":this.clone.wtTable.spreader.style.top=""},scrollTo:function(e,t){var n=this.getTableParentOffset(),o=this.wot.cloneSource?this.wot.cloneSource:this.wot,r=o.wtTable.holder,i=0;t&&r.offsetWidth!==r.clientWidth&&(i=l()),t?(n+=this.sumCellSizes(0,e+1),n-=this.wot.wtViewport.getViewportWidth()):n+=this.sumCellSizes(this.wot.getSetting("fixedColumnsLeft"),e),n+=i,this.setScrollPosition(n)},getTableParentOffset:function(){return this.trimmingContainer===window?this.wot.wtTable.holderOffset.left:0},getScrollPosition:function(){return a(this.mainTableScrollableElement)},adjustHeaderBordersPosition:function(e){var t=this.wot.wtTable.holder.parentNode,n=this.wot.getSetting("rowHeaders"),o=this.wot.getSetting("fixedColumnsLeft");if(o&&!n.length)s(t,"innerBorderLeft");else if(!o&&n.length){var r=c(t,"innerBorderLeft");e?s(t,"innerBorderLeft"):h(t,"innerBorderLeft"),(!r&&e||r&&!e)&&this.wot.wtOverlays.adjustElementsSize()}}},{},g),window.WalkontableLeftOverlay=p,g.registerOverlay(g.CLONE_LEFT,p)},{_base:11,"helpers/dom/element":45}],14:[function(e,t,n){"use strict";Object.defineProperties(n,{WalkontableTopOverlay:{get:function(){return p}},__esModule:{value:!0}});var o,r,i=(o=e("helpers/dom/element"),o&&o.__esModule&&o||{"default":o}),s=i.addClass,l=i.getScrollbarWidth,a=i.getScrollTop,u=i.getWindowScrollLeft,c=i.hasClass,d=i.outerHeight,h=i.removeClass,f=i.setOverlayPosition,g=(r=e("_base"),r&&r.__esModule&&r||{"default":r}).WalkontableOverlay,p=function(e){$traceurRuntime.superConstructor(m).call(this,e),this.clone=this.makeClone(g.CLONE_TOP)},m=p;$traceurRuntime.createClass(p,{shouldBeRendered:function(){return this.wot.getSetting("fixedRowsTop")||this.wot.getSetting("columnHeaders").length?!0:!1},resetFixedPosition:function(){if(this.needFullRender&&this.wot.wtTable.holder.parentNode){var e=this.clone.wtTable.holder.parentNode,t=0;if(this.wot.wtOverlays.leftOverlay.trimmingContainer===window){var n,o,r=this.wot.wtTable.hider.getBoundingClientRect(),i=Math.ceil(r.top),s=Math.ceil(r.bottom);n=this.wot.wtTable.hider.style.left,n=""===n?0:n,o=0>i&&s-e.offsetHeight>0?-i:0,t=o,o+="px",f(e,n,o)}else t=this.getScrollPosition();this.adjustHeaderBordersPosition(t),this.adjustElementsSize()}},setScrollPosition:function(e){this.mainTableScrollableElement===window?window.scrollTo(u(),e):this.mainTableScrollableElement.scrollTop=e},onScroll:function(){this.wot.getSetting("onScrollHorizontally")},sumCellSizes:function(e,t){for(var n=0,o=this.wot.wtSettings.settings.defaultRowHeight;t>e;){var r=this.wot.wtTable.getRowHeight(e);n+=void 0===r?o:r,e++}return n},adjustElementsSize:function(){var e=void 0!==arguments[0]?arguments[0]:!1;(this.needFullRender||e)&&(this.adjustRootElementSize(),this.adjustRootChildrenSize(),e||(this.areElementSizesAdjusted=!0))},adjustRootElementSize:function(){var e,t=this.wot.wtTable.holder,n=t.clientWidth===t.offsetWidth?0:l(),o=this.clone.wtTable.holder.parentNode,r=o.style;this.trimmingContainer!==window&&(r.width=this.wot.wtViewport.getWorkspaceWidth()-n+"px"),this.clone.wtTable.holder.style.width=r.width,e=d(this.clone.wtTable.TABLE),r.height=(0===e?e:e+4)+"px"},adjustRootChildrenSize:function(){var e=l();this.clone.wtTable.hider.style.width=this.hider.style.width,this.clone.wtTable.holder.style.width=this.clone.wtTable.holder.parentNode.style.width,0===e&&(e=30),this.clone.wtTable.holder.style.height=parseInt(this.clone.wtTable.holder.parentNode.style.height,10)+e+"px"},applyToDOM:function(){var e=this.wot.getSetting("totalRows");if(this.areElementSizesAdjusted||this.adjustElementsSize(),"number"==typeof this.wot.wtViewport.rowsRenderCalculator.startPosition)this.spreader.style.top=this.wot.wtViewport.rowsRenderCalculator.startPosition+"px";else{if(0!==e)throw new Error("Incorrect value of the rowsRenderCalculator");this.spreader.style.top="0"}this.spreader.style.bottom="",this.needFullRender&&this.syncOverlayOffset()},syncOverlayOffset:function(){"number"==typeof this.wot.wtViewport.columnsRenderCalculator.startPosition?this.clone.wtTable.spreader.style.left=this.wot.wtViewport.columnsRenderCalculator.startPosition+"px":this.clone.wtTable.spreader.style.left=""},scrollTo:function(e,t){var n=this.getTableParentOffset(),o=this.wot.cloneSource?this.wot.cloneSource:this.wot,r=o.wtTable.holder,i=0;if(t&&r.offsetHeight!==r.clientHeight&&(i=l()),t){var s=this.wot.getSetting("fixedRowsBottom"),a=(this.wot.getSetting("fixedRowsTop"),this.wot.getSetting("totalRows"));n+=this.sumCellSizes(0,e+1),n-=this.wot.wtViewport.getViewportHeight()-this.sumCellSizes(a-s,a),n+=1}else n+=this.sumCellSizes(this.wot.getSetting("fixedRowsTop"),e);n+=i,this.setScrollPosition(n)},getTableParentOffset:function(){return this.mainTableScrollableElement===window?this.wot.wtTable.holderOffset.top:0},getScrollPosition:function(){return a(this.mainTableScrollableElement)},adjustHeaderBordersPosition:function(e){if(0===this.wot.getSetting("fixedRowsTop")&&this.wot.getSetting("columnHeaders").length>0){var t=this.wot.wtTable.holder.parentNode,n=c(t,"innerBorderTop");e?s(t,"innerBorderTop"):h(t,"innerBorderTop"),(!n&&e||n&&!e)&&this.wot.wtOverlays.adjustElementsSize()}if(0===this.wot.getSetting("rowHeaders").length){var o=this.clone.wtTable.THEAD.querySelectorAll("th:nth-of-type(2)");if(o)for(var r=0;rc&&h-e.offsetWidth>0?-c+"px":"0",r=0>u&&d-e.offsetHeight>0?-u+"px":"0",a(e,o,r)}e.style.height=(0===t?t:t+4)+"px",e.style.width=(0===n?n:n+4)+"px"}}},{},u),window.WalkontableTopLeftCornerOverlay=c,u.registerOverlay(u.CLONE_TOP_LEFT_CORNER,c)},{_base:11,"helpers/dom/element":45}],16:[function(e,t,n){"use strict";Object.defineProperties(n,{WalkontableOverlays:{get:function(){return f}},__esModule:{value:!0}});var o,r,i,s=(o=e("helpers/dom/element"),o&&o.__esModule&&o||{"default":o}),l=s.getScrollableElement,a=s.getScrollbarWidth,u=s.getScrollLeft,c=s.getScrollTop,d=(r=e("helpers/unicode"),r&&r.__esModule&&r||{"default":r}).isKey,h=(i=e("eventManager"),i&&i.__esModule&&i||{"default":i}).EventManager,f=function(e){this.wot=e,this.instance=this.wot,this.eventManager=new h(this.wot),this.wot.update("scrollbarWidth",a()),this.wot.update("scrollbarHeight",a()),this.mainTableScrollableElement=l(this.wot.wtTable.TABLE),this.topOverlay=WalkontableOverlay.createOverlay(WalkontableOverlay.CLONE_TOP,this.wot),"undefined"==typeof WalkontableBottomOverlay?this.bottomOverlay={needFullRender:!1}:this.bottomOverlay=WalkontableOverlay.createOverlay(WalkontableOverlay.CLONE_BOTTOM,this.wot),this.leftOverlay=WalkontableOverlay.createOverlay(WalkontableOverlay.CLONE_LEFT,this.wot),this.topOverlay.needFullRender&&this.leftOverlay.needFullRender&&(this.topLeftCornerOverlay=WalkontableOverlay.createOverlay(WalkontableOverlay.CLONE_TOP_LEFT_CORNER,this.wot)),this.bottomOverlay.needFullRender&&this.leftOverlay.needFullRender&&"undefined"!=typeof WalkontableBottomLeftCornerOverlay?this.bottomLeftCornerOverlay=WalkontableOverlay.createOverlay(WalkontableOverlay.CLONE_BOTTOM_LEFT_CORNER,this.wot):this.bottomLeftCornerOverlay={needFullRender:!1},this.wot.getSetting("debug")&&(this.debug=WalkontableOverlay.createOverlay(WalkontableOverlay.CLONE_DEBUG,this.wot)),this.destroyed=!1,this.keyPressed=!1,this.spreaderLastSize={width:null,height:null},this.overlayScrollPositions={master:{top:0,left:0},top:{top:null,left:0},bottom:{top:null,left:0},left:{top:0,left:null}},this.verticalScrolling=!1,this.horizontalScrolling=!1,this.delegatedScrollCallback=!1,this.registerListeners()};$traceurRuntime.createClass(f,{refreshAll:function(){if(this.wot.drawn){if(!this.wot.wtTable.holder.parentNode)return void this.destroy();this.wot.draw(!0),this.verticalScrolling&&this.leftOverlay.onScroll(),this.horizontalScrolling&&this.topOverlay.onScroll(),this.verticalScrolling=!1,this.horizontalScrolling=!1}},registerListeners:function(){var e=this;this.eventManager.addEventListener(document.documentElement,"keydown",function(t){return e.onKeyDown(t)}),this.eventManager.addEventListener(document.documentElement,"keyup",function(){return e.onKeyUp()}),this.eventManager.addEventListener(document,"visibilitychange",function(){return e.onKeyUp()}),this.eventManager.addEventListener(this.mainTableScrollableElement,"scroll",function(t){return e.onTableScroll(t)}),this.topOverlay.needFullRender&&(this.eventManager.addEventListener(this.topOverlay.clone.wtTable.holder,"scroll",function(t){return e.onTableScroll(t)}),this.eventManager.addEventListener(this.topOverlay.clone.wtTable.holder,"wheel",function(t){return e.onTableScroll(t)})),this.bottomOverlay.needFullRender&&(this.eventManager.addEventListener(this.bottomOverlay.clone.wtTable.holder,"scroll",function(t){return e.onTableScroll(t)}),this.eventManager.addEventListener(this.bottomOverlay.clone.wtTable.holder,"wheel",function(t){return e.onTableScroll(t)})),this.leftOverlay.needFullRender&&(this.eventManager.addEventListener(this.leftOverlay.clone.wtTable.holder,"scroll",function(t){return e.onTableScroll(t)}),this.eventManager.addEventListener(this.leftOverlay.clone.wtTable.holder,"wheel",function(t){return e.onTableScroll(t)})),this.topOverlay.trimmingContainer!==window&&this.leftOverlay.trimmingContainer!==window&&this.eventManager.addEventListener(window,"wheel",function(t){var n,o=t.wheelDeltaY||t.deltaY,r=t.wheelDeltaX||t.deltaX;e.topOverlay.clone.wtTable.holder.contains(t.realTarget)?n="top":e.bottomOverlay.clone&&e.bottomOverlay.clone.wtTable.holder.contains(t.realTarget)?n="bottom":e.leftOverlay.clone.wtTable.holder.contains(t.realTarget)&&(n="left"),"top"==n&&0!==o?t.preventDefault():"left"==n&&0!==r?t.preventDefault():"bottom"==n&&0!==o&&t.preventDefault()})},onTableScroll:function(e){Handsontable.mobileBrowser||(!this.keyPressed||this.mainTableScrollableElement===window||e.target.contains(this.mainTableScrollableElement))&&("scroll"===e.type?this.syncScrollPositions(e):this.translateMouseWheelToScroll(e))},onKeyDown:function(e){this.keyPressed=d(e.keyCode,"ARROW_UP|ARROW_RIGHT|ARROW_DOWN|ARROW_LEFT")},onKeyUp:function(){this.keyPressed=!1},translateMouseWheelToScroll:function(e){for(var t,n=this.topOverlay.clone.wtTable.holder,o=this.bottomOverlay.clone?this.bottomOverlay.clone.wtTable.holder:null,r=this.leftOverlay.clone.wtTable.holder,i={type:"wheel"},s=e.target,l=e.wheelDeltaY||-1*e.deltaY,a=e.wheelDeltaX||-1*e.deltaX;s!=document&&null!=s;){if(s.className.indexOf("wtHolder")>-1){t=s;break}s=s.parentNode}return i.target=t,t==n?this.syncScrollPositions(i,-.2*l):t==o?this.syncScrollPositions(i,-.2*l):t==r&&this.syncScrollPositions(i,-.2*a),!1},syncScrollPositions:function(e){var t=void 0!==arguments[1]?arguments[1]:null;if(!this.destroyed){if(0===arguments.length)return void this.syncScrollWithMaster();var n,o,r,i=this.mainTableScrollableElement,s=e.target,l=0,a=!1,d=!1;this.topOverlay.needFullRender&&(n=this.topOverlay.clone.wtTable.holder),this.bottomOverlay.needFullRender&&(r=this.bottomOverlay.clone.wtTable.holder),this.leftOverlay.needFullRender&&(o=this.leftOverlay.clone.wtTable.holder),s===document&&(s=window),s===i?(l=u(s),this.overlayScrollPositions.master.left!==l&&(this.horizontalScrolling=!0,this.overlayScrollPositions.master.left=l,a=!0,n&&(n.scrollLeft=l,d=this.mainTableScrollableElement!==window),r&&(r.scrollLeft=l,d=this.mainTableScrollableElement!==window)),l=c(s),this.overlayScrollPositions.master.top!==l&&(this.verticalScrolling=!0,this.overlayScrollPositions.master.top=l,a=!0,o&&(o.scrollTop=l,d=this.mainTableScrollableElement!==window))):s===r?(l=u(s),this.overlayScrollPositions.bottom.left!==l&&(this.horizontalScrolling=!0,this.overlayScrollPositions.bottom.left=l,a=!0,i.scrollLeft=l),null!==t&&(a=!0,i.scrollTop+=t)):s===n?(l=u(s),this.overlayScrollPositions.top.left!==l&&(this.horizontalScrolling=!0,this.overlayScrollPositions.top.left=l,a=!0,i.scrollLeft=l),null!==t&&(a=!0,i.scrollTop+=t)):s===o&&(l=c(s),this.overlayScrollPositions.left.top!==l&&(this.verticalScrolling=!0,this.overlayScrollPositions.left.top=l,a=!0,i.scrollTop=l),null!==t&&(a=!0,i.scrollLeft+=t)),!this.keyPressed&&a&&"scroll"===e.type&&(this.delegatedScrollCallback?this.delegatedScrollCallback=!1:this.refreshAll(),d&&(this.delegatedScrollCallback=!0))}},syncScrollWithMaster:function(){var e=this.topOverlay.mainTableScrollableElement;this.topOverlay.needFullRender&&(this.topOverlay.clone.wtTable.holder.scrollLeft=e.scrollLeft),this.leftOverlay.needFullRender&&(this.leftOverlay.clone.wtTable.holder.scrollTop=e.scrollTop)},destroy:function(){this.eventManager.destroy(),this.topOverlay.destroy(),this.bottomOverlay.clone&&this.bottomOverlay.destroy(),this.leftOverlay.destroy(),this.topLeftCornerOverlay&&this.topLeftCornerOverlay.destroy(),this.bottomLeftCornerOverlay&&this.bottomLeftCornerOverlay.clone&&this.bottomLeftCornerOverlay.destroy(),this.debug&&this.debug.destroy(),this.destroyed=!0},refresh:function(){var e=void 0!==arguments[0]?arguments[0]:!1;if(this.topOverlay.areElementSizesAdjusted&&this.leftOverlay.areElementSizesAdjusted){var t=this.wot.wtTable.wtRootElement.parentNode||this.wot.wtTable.wtRootElement,n=t.clientWidth,o=t.clientHeight;(n!==this.spreaderLastSize.width||o!==this.spreaderLastSize.height)&&(this.spreaderLastSize.width=n,this.spreaderLastSize.height=o,this.adjustElementsSize())}this.bottomOverlay.clone&&this.bottomOverlay.refresh(e),this.leftOverlay.refresh(e),this.topOverlay.refresh(e),this.topLeftCornerOverlay&&this.topLeftCornerOverlay.refresh(e),this.bottomLeftCornerOverlay&&this.bottomLeftCornerOverlay.clone&&this.bottomLeftCornerOverlay.refresh(e),this.debug&&this.debug.refresh(e)},adjustElementsSize:function(){var e=void 0!==arguments[0]?arguments[0]:!1,t=this.wot.getSetting("totalColumns"),n=this.wot.getSetting("totalRows"),o=this.wot.wtViewport.getRowHeaderWidth(),r=this.wot.wtViewport.getColumnHeaderHeight(),i=this.wot.wtTable.hider.style;i.width=o+this.leftOverlay.sumCellSizes(0,t)+"px",i.height=r+this.topOverlay.sumCellSizes(0,n)+1+"px",this.topOverlay.adjustElementsSize(e),this.leftOverlay.adjustElementsSize(e),this.bottomOverlay.clone&&this.bottomOverlay.adjustElementsSize(e)},applyToDOM:function(){this.topOverlay.areElementSizesAdjusted&&this.leftOverlay.areElementSizesAdjusted||this.adjustElementsSize(),this.topOverlay.applyToDOM(),this.bottomOverlay.clone&&this.bottomOverlay.applyToDOM(),this.leftOverlay.applyToDOM()}},{}),window.WalkontableOverlays=f},{eventManager:41,"helpers/dom/element":45,"helpers/unicode":53}],17:[function(e,t,n){"use strict";Object.defineProperties(n,{WalkontableScroll:{get:function(){return o}},__esModule:{value:!0}});var o=function(e){this.wot=e,this.instance=e};$traceurRuntime.createClass(o,{scrollViewport:function(e){if(this.wot.drawn){var t=this.wot.getSetting("totalRows"),n=this.wot.getSetting("totalColumns"),o=this.instance.getSetting("fixedRowsTop"),r=this.instance.getSetting("fixedRowsBottom"),i=this.instance.getSetting("fixedColumnsLeft");if(e.row<0||e.row>t-1)throw new Error("row "+e.row+" does not exist");if(e.col<0||e.col>n-1)throw new Error("column "+e.col+" does not exist");e.row>this.instance.wtTable.getLastVisibleRow()&&e.row=o&&e.rowthis.instance.wtTable.getLastVisibleColumn()?this.wot.wtOverlays.leftOverlay.scrollTo(e.col,!0):e.col>=i&&e.colu;u++)o=e.wtTable.columnFilter.renderedToSource(u),o>=a[1]&&o<=a[3]&&(r=e.wtTable.getColumnHeader(o),r&&this.settings.highlightColumnClassName&&l(r,this.settings.highlightColumnClassName));for(var c=0;i>c;c++){n=e.wtTable.rowFilter.renderedToSource(c),n>=a[0]&&n<=a[2]&&(r=e.wtTable.getRowHeader(n),r&&this.settings.highlightRowClassName&&l(r,this.settings.highlightRowClassName));for(var d=0;s>d;d++)o=e.wtTable.columnFilter.renderedToSource(d),n>=a[0]&&n<=a[2]&&o>=a[1]&&o<=a[3]?this.settings.className&&this.addClassAtCoords(e,n,o,this.settings.className):n>=a[0]&&n<=a[2]?this.settings.highlightRowClassName&&this.addClassAtCoords(e,n,o,this.settings.highlightRowClassName):o>=a[1]&&o<=a[3]&&this.settings.highlightColumnClassName&&this.addClassAtCoords(e,n,o,this.settings.highlightColumnClassName)}if(e.getSetting("onBeforeDrawBorders",a,this.settings.className),this.settings.border){var h=this.getBorder(e);h&&h.appear(a)}}}},{}),window.WalkontableSelection=d},{border:2,"cell/coords":5,"cell/range":6,"helpers/dom/element":45}],19:[function(e,t,n){"use strict";Object.defineProperties(n,{WalkontableSettings:{get:function(){return i}},__esModule:{value:!0}});var o,r=(o=e("helpers/dom/element"),o&&o.__esModule&&o||{"default":o}).fastInnerText,i=function(e,t){var n=this;this.wot=e,this.instance=e,this.defaults={table:void 0,debug:!1,externalRowCalculator:!1,stretchH:"none",currentRowClassName:null,currentColumnClassName:null,data:void 0,fixedColumnsLeft:0,fixedRowsTop:0,fixedRowsBottom:0,minSpareRows:0,rowHeaders:function(){return[]},columnHeaders:function(){return[]},totalRows:void 0,totalColumns:void 0,cellRenderer:function(e,t,o){var i=n.getSetting("data",e,t);r(o,void 0===i||null===i?"":i)},columnWidth:function(e){},rowHeight:function(e){},defaultRowHeight:23,defaultColumnWidth:50,selections:null,hideBorderOnMouseDownOver:!1,viewportRowCalculatorOverride:null,viewportColumnCalculatorOverride:null,onCellMouseDown:null,onCellMouseOver:null,onCellDblClick:null,onCellCornerMouseDown:null,onCellCornerDblClick:null,beforeDraw:null,onDraw:null,onBeforeDrawBorders:null,onScrollVertically:null,onScrollHorizontally:null,onBeforeTouchScroll:null,onAfterMomentumScroll:null,scrollbarWidth:10,scrollbarHeight:10,renderAllRows:!1,groups:!1},this.settings={};for(var o in this.defaults)if(this.defaults.hasOwnProperty(o))if(void 0!==t[o])this.settings[o]=t[o];else{if(void 0===this.defaults[o])throw new Error('A required setting "'+o+'" was not provided');this.settings[o]=this.defaults[o]}};$traceurRuntime.createClass(i,{update:function(e,t){if(void 0===t)for(var n in e)e.hasOwnProperty(n)&&(this.settings[n]=e[n]);else this.settings[e]=t;return this.wot},getSetting:function(e,t,n,o,r){return"function"==typeof this.settings[e]?this.settings[e](t,n,o,r):void 0!==t&&Array.isArray(this.settings[e])?this.settings[e][t]:this.settings[e]},has:function(e){return!!this.settings[e]}},{}),window.WalkontableSettings=i},{"helpers/dom/element":45}],20:[function(e,t,n){"use strict";Object.defineProperties(n,{WalkontableTable:{get:function(){return y}},__esModule:{value:!0}});var o,r,i,s,l,a,u=(o=e("helpers/dom/element"),o&&o.__esModule&&o||{"default":o}),c=u.getStyle,d=u.getTrimmingContainer,h=u.hasClass,f=u.index,g=u.offset,p=u.removeClass,m=u.removeTextNodes,w=(u.overlayContainsElement,(r=e("cell/coords"),r&&r.__esModule&&r||{"default":r}).WalkontableCellCoords),v=((i=e("cell/range"),i&&i.__esModule&&i||{"default":i}).WalkontableCellRange,(s=e("filter/column"),s&&s.__esModule&&s||{"default":s}).WalkontableColumnFilter),b=(l=e("filter/row"),l&&l.__esModule&&l||{"default":l}).WalkontableRowFilter,C=(a=e("tableRenderer"),a&&a.__esModule&&a||{"default":a}).WalkontableTableRenderer,y=function(e,t){this.wot=e,this.instance=this.wot,this.TABLE=t,this.TBODY=null,this.THEAD=null,this.COLGROUP=null,this.tableOffset=0,this.holderOffset=0,m(this.TABLE),this.spreader=this.createSpreader(this.TABLE),this.hider=this.createHider(this.spreader),this.holder=this.createHolder(this.hider),this.wtRootElement=this.holder.parentNode,this.alignOverlaysWithTrimmingContainer(),this.fixTableDomTree(),this.colgroupChildrenLength=this.COLGROUP.childNodes.length,this.theadChildrenLength=this.THEAD.firstChild?this.THEAD.firstChild.childNodes.length:0,this.tbodyChildrenLength=this.TBODY.childNodes.length,this.rowFilter=null,this.columnFilter=null};$traceurRuntime.createClass(y,{fixTableDomTree:function(){this.TBODY=this.TABLE.querySelector("tbody"),this.TBODY||(this.TBODY=document.createElement("tbody"),this.TABLE.appendChild(this.TBODY)),this.THEAD=this.TABLE.querySelector("thead"),this.THEAD||(this.THEAD=document.createElement("thead"),this.TABLE.insertBefore(this.THEAD,this.TBODY)),this.COLGROUP=this.TABLE.querySelector("colgroup"),this.COLGROUP||(this.COLGROUP=document.createElement("colgroup"),this.TABLE.insertBefore(this.COLGROUP,this.THEAD)),this.wot.getSetting("columnHeaders").length&&!this.THEAD.childNodes.length&&this.THEAD.appendChild(document.createElement("TR"))},createSpreader:function(e){var t,n=e.parentNode;return n&&1===n.nodeType&&h(n,"wtHolder")||(t=document.createElement("div"),t.className="wtSpreader",n&&n.insertBefore(t,e),t.appendChild(e)),t.style.position="relative",t},createHider:function(e){var t,n=e.parentNode;return n&&1===n.nodeType&&h(n,"wtHolder")||(t=document.createElement("div"),t.className="wtHider",n&&n.insertBefore(t,e),t.appendChild(e)),t},createHolder:function(e){var t,n=e.parentNode;return n&&1===n.nodeType&&h(n,"wtHolder")||(t=document.createElement("div"),t.style.position="relative",t.className="wtHolder",n&&n.insertBefore(t,e),this.isWorkingOnClone()||(t.parentNode.className+="ht_master handsontable"),t.appendChild(e)),t},alignOverlaysWithTrimmingContainer:function(){var e=d(this.wtRootElement);this.isWorkingOnClone()||(this.holder.parentNode.style.position="relative",e===window?(this.holder.style.overflow="visible",this.wtRootElement.style.overflow="visible"):(this.holder.style.width=c(e,"width"),this.holder.style.height=c(e,"height"),this.holder.style.overflow=""))},isWorkingOnClone:function(){return!!this.wot.cloneSource},draw:function(e){var t=this.instance.getSetting("totalRows");if(this.isWorkingOnClone()||(this.holderOffset=g(this.holder),e=this.wot.wtViewport.createRenderCalculators(e)),e)this.isWorkingOnClone()||this.wot.wtViewport.createVisibleCalculators(),this.wot.wtOverlays&&this.wot.wtOverlays.refresh(!0);else{this.isWorkingOnClone()?this.tableOffset=this.wot.cloneSource.wtTable.tableOffset:this.tableOffset=g(this.TABLE);var n;n=WalkontableOverlay.isOverlayTypeOf(this.wot.cloneOverlay,WalkontableOverlay.CLONE_DEBUG)||WalkontableOverlay.isOverlayTypeOf(this.wot.cloneOverlay,WalkontableOverlay.CLONE_TOP)||WalkontableOverlay.isOverlayTypeOf(this.wot.cloneOverlay,WalkontableOverlay.CLONE_TOP_LEFT_CORNER)?0:WalkontableOverlay.isOverlayTypeOf(this.instance.cloneOverlay,WalkontableOverlay.CLONE_BOTTOM)||WalkontableOverlay.isOverlayTypeOf(this.instance.cloneOverlay,WalkontableOverlay.CLONE_BOTTOM_LEFT_CORNER)?t-this.wot.getSetting("fixedRowsBottom"):this.wot.wtViewport.rowsRenderCalculator.startRow; +var o;o=WalkontableOverlay.isOverlayTypeOf(this.wot.cloneOverlay,WalkontableOverlay.CLONE_DEBUG)||WalkontableOverlay.isOverlayTypeOf(this.wot.cloneOverlay,WalkontableOverlay.CLONE_LEFT)||WalkontableOverlay.isOverlayTypeOf(this.wot.cloneOverlay,WalkontableOverlay.CLONE_TOP_LEFT_CORNER)||WalkontableOverlay.isOverlayTypeOf(this.wot.cloneOverlay,WalkontableOverlay.CLONE_BOTTOM_LEFT_CORNER)?0:this.wot.wtViewport.columnsRenderCalculator.startColumn,this.rowFilter=new b(n,t,this.wot.getSetting("columnHeaders").length),this.columnFilter=new v(o,this.wot.getSetting("totalColumns"),this.wot.getSetting("rowHeaders").length),this._doDraw(),this.alignOverlaysWithTrimmingContainer()}return this.refreshSelections(e),this.isWorkingOnClone()||(this.wot.wtOverlays.topOverlay.resetFixedPosition(),this.wot.wtOverlays.bottomOverlay.clone&&this.wot.wtOverlays.bottomOverlay.resetFixedPosition(),this.wot.wtOverlays.leftOverlay.resetFixedPosition(),this.wot.wtOverlays.topLeftCornerOverlay&&this.wot.wtOverlays.topLeftCornerOverlay.resetFixedPosition(),this.instance.wtOverlays.bottomLeftCornerOverlay&&this.instance.wtOverlays.bottomLeftCornerOverlay.clone&&this.wot.wtOverlays.bottomLeftCornerOverlay.resetFixedPosition()),this.wot.drawn=!0,this},_doDraw:function(){var e=new C(this);e.render()},removeClassFromCells:function(e){for(var t=this.TABLE.querySelectorAll("."+e),n=0,o=t.length;o>n;n++)p(t[n],e)},refreshSelections:function(e){if(this.wot.selections){var t=this.wot.selections.length;if(e)for(var n=0;t>n;n++)this.wot.selections[n].settings.className&&this.removeClassFromCells(this.wot.selections[n].settings.className),this.wot.selections[n].settings.highlightRowClassName&&this.removeClassFromCells(this.wot.selections[n].settings.highlightRowClassName),this.wot.selections[n].settings.highlightColumnClassName&&this.removeClassFromCells(this.wot.selections[n].settings.highlightColumnClassName);for(var o=0;t>o;o++)this.wot.selections[o].draw(this.wot,e)}},getCell:function(e){if(this.isRowBeforeRenderedRows(e.row))return-1;if(this.isRowAfterRenderedRows(e.row))return-2;var t=this.TBODY.childNodes[this.rowFilter.sourceToRendered(e.row)];return t?t.childNodes[this.columnFilter.sourceColumnToVisibleRowHeadedColumn(e.col)]:void 0},getColumnHeader:function(e){var t=void 0!==arguments[1]?arguments[1]:0,n=this.THEAD.childNodes[t];return n?n.childNodes[this.columnFilter.sourceColumnToVisibleRowHeadedColumn(e)]:void 0},getRowHeader:function(e){if(0===this.columnFilter.sourceColumnToVisibleRowHeadedColumn(0))return null;var t=this.TBODY.childNodes[this.rowFilter.sourceToRendered(e)];return t?t.childNodes[0]:void 0},getCoords:function(e){var t=e.parentNode,n=f(t);n=t.parentNode===this.THEAD?this.rowFilter.visibleColHeadedRowToSourceRow(n):this.rowFilter.renderedToSource(n);var o=this.columnFilter.visibleRowHeadedColumnToSourceColumn(e.cellIndex);return new w(n,o)},getTrForRow:function(e){return this.TBODY.childNodes[this.rowFilter.sourceToRendered(e)]},getFirstRenderedRow:function(){return this.wot.wtViewport.rowsRenderCalculator.startRow},getFirstVisibleRow:function(){return this.wot.wtViewport.rowsVisibleCalculator.startRow},getFirstRenderedColumn:function(){return this.wot.wtViewport.columnsRenderCalculator.startColumn},getFirstVisibleColumn:function(){return this.wot.wtViewport.columnsVisibleCalculator.startColumn},getLastRenderedRow:function(){return this.wot.wtViewport.rowsRenderCalculator.endRow},getLastVisibleRow:function(){return this.wot.wtViewport.rowsVisibleCalculator.endRow},getLastRenderedColumn:function(){return this.wot.wtViewport.columnsRenderCalculator.endColumn},getLastVisibleColumn:function(){return this.wot.wtViewport.columnsVisibleCalculator.endColumn},isRowBeforeRenderedRows:function(e){return this.rowFilter.sourceToRendered(e)<0&&e>=0},isRowAfterViewport:function(e){return this.rowFilter.sourceToRendered(e)>this.getLastVisibleRow()},isRowAfterRenderedRows:function(e){return this.rowFilter.sourceToRendered(e)>this.getLastRenderedRow()},isColumnBeforeViewport:function(e){return this.columnFilter.sourceToRendered(e)<0&&e>=0},isColumnAfterViewport:function(e){return this.columnFilter.sourceToRendered(e)>this.getLastVisibleColumn()},isLastRowFullyVisible:function(){return this.getLastVisibleRow()===this.getLastRenderedRow()},isLastColumnFullyVisible:function(){return this.getLastVisibleColumn()===this.getLastRenderedColumn()},getRenderedColumnsCount:function(){return WalkontableOverlay.isOverlayTypeOf(this.wot.cloneOverlay,WalkontableOverlay.CLONE_DEBUG)?this.wot.getSetting("totalColumns"):WalkontableOverlay.isOverlayTypeOf(this.wot.cloneOverlay,WalkontableOverlay.CLONE_LEFT)||WalkontableOverlay.isOverlayTypeOf(this.wot.cloneOverlay,WalkontableOverlay.CLONE_TOP_LEFT_CORNER)||WalkontableOverlay.isOverlayTypeOf(this.wot.cloneOverlay,WalkontableOverlay.CLONE_BOTTOM_LEFT_CORNER)?this.wot.getSetting("fixedColumnsLeft"):this.wot.wtViewport.columnsRenderCalculator.count},getRenderedRowsCount:function(){return WalkontableOverlay.isOverlayTypeOf(this.wot.cloneOverlay,WalkontableOverlay.CLONE_DEBUG)?this.wot.getSetting("totalRows"):WalkontableOverlay.isOverlayTypeOf(this.wot.cloneOverlay,WalkontableOverlay.CLONE_TOP)||WalkontableOverlay.isOverlayTypeOf(this.wot.cloneOverlay,WalkontableOverlay.CLONE_TOP_LEFT_CORNER)?this.wot.getSetting("fixedRowsTop"):WalkontableOverlay.isOverlayTypeOf(this.wot.cloneOverlay,WalkontableOverlay.CLONE_BOTTOM)||WalkontableOverlay.isOverlayTypeOf(this.wot.cloneOverlay,WalkontableOverlay.CLONE_BOTTOM_LEFT_CORNER)?this.instance.getSetting("fixedRowsBottom"):this.wot.wtViewport.rowsRenderCalculator.count},getVisibleRowsCount:function(){return this.wot.wtViewport.rowsVisibleCalculator.count},allRowsInViewport:function(){return this.wot.getSetting("totalRows")==this.getVisibleRowsCount()},getRowHeight:function(e){var t=this.wot.wtSettings.settings.rowHeight(e),n=this.wot.wtViewport.oversizedRows[e];return void 0!==n&&(t=void 0===t?n:Math.max(t,n)),t},getColumnHeaderHeight:function(e){var t=this.wot.wtSettings.settings.defaultRowHeight,n=this.wot.wtViewport.oversizedColumnHeaders[e];return void 0!==n&&(t=t?Math.max(t,n):n),t},getVisibleColumnsCount:function(){return this.wot.wtViewport.columnsVisibleCalculator.count},allColumnsInViewport:function(){return this.wot.getSetting("totalColumns")==this.getVisibleColumnsCount()},getColumnWidth:function(e){var t=this.wot.wtSettings.settings.columnWidth;return"function"==typeof t?t=t(e):"object"==typeof t&&(t=t[e]),t||this.wot.wtSettings.settings.defaultColumnWidth},getStretchedColumnWidth:function(e){var t=this.getColumnWidth(e),n=-1===[void 0,null].indexOf(t)?t:this.instance.wtSettings.settings.defaultColumnWidth,o=this.wot.wtViewport.columnsRenderCalculator;if(o){var r=o.getStretchedColumnWidth(e,n);r&&(n=r)}return n}},{}),window.WalkontableTable=y},{"cell/coords":5,"cell/range":6,"filter/column":9,"filter/row":10,"helpers/dom/element":45,tableRenderer:21}],21:[function(e,t,n){"use strict";function o(e,t){var n=document.createElement("TH");return t.insertBefore(n,e),t.removeChild(e),n}function r(e,t){var n=document.createElement("TD");return t.insertBefore(n,e),t.removeChild(e),n}Object.defineProperties(n,{WalkontableTableRenderer:{get:function(){return h}},__esModule:{value:!0}});var i,s=(i=e("helpers/dom/element"),i&&i.__esModule&&i||{"default":i}),l=s.addClass,a=s.empty,u=s.getScrollbarWidth,c=s.hasClass,d=s.innerHeight,h=function(e){this.wtTable=e,this.wot=e.instance,this.instance=e.instance,this.rowFilter=e.rowFilter,this.columnFilter=e.columnFilter,this.TABLE=e.TABLE,this.THEAD=e.THEAD,this.TBODY=e.TBODY,this.COLGROUP=e.COLGROUP,this.rowHeaders=[],this.rowHeaderCount=0,this.columnHeaders=[],this.columnHeaderCount=0,this.fixedRowsTop=0,this.fixedRowsBottom=0};$traceurRuntime.createClass(h,{render:function(){this.wtTable.isWorkingOnClone()||this.wot.getSetting("beforeDraw",!0),this.rowHeaders=this.wot.getSetting("rowHeaders"),this.rowHeaderCount=this.rowHeaders.length,this.fixedRowsTop=this.wot.getSetting("fixedRowsTop"),this.fixedRowsBottom=this.wot.getSetting("fixedRowsBottom"),this.columnHeaders=this.wot.getSetting("columnHeaders"),this.columnHeaderCount=this.columnHeaders.length;var e,t=this.wtTable.getRenderedColumnsCount(),n=this.wtTable.getRenderedRowsCount(),o=this.wot.getSetting("totalColumns"),r=this.wot.getSetting("totalRows"),i=!1;if((WalkontableOverlay.isOverlayTypeOf(this.wot.cloneOverlay,WalkontableOverlay.CLONE_BOTTOM)||WalkontableOverlay.isOverlayTypeOf(this.wot.cloneOverlay,WalkontableOverlay.CLONE_BOTTOM_LEFT_CORNER))&&(this.columnHeaders=[],this.columnHeaderCount=0),o>0&&(this.adjustAvailableNodes(),i=!0,this.renderColumnHeaders(),this.renderRows(r,n,t),this.wtTable.isWorkingOnClone()||(e=this.wot.wtViewport.getWorkspaceWidth(),this.wot.wtViewport.containerWidth=null),this.adjustColumnHeaderHeights(),this.adjustColumnWidths(t),this.markOversizedColumns()),i||this.adjustAvailableNodes(),this.removeRedundantRows(n),this.wtTable.isWorkingOnClone()){if(WalkontableOverlay.isOverlayTypeOf(this.wot.cloneOverlay,WalkontableOverlay.CLONE_BOTTOM)){var s=this.wot.cloneOverlay.instance;this.wot.cloneOverlay.markOversizedFixedBottomRows(),s.wtOverlays.adjustElementsSize()}}else{if(this.markOversizedRows(),this.wot.wtViewport.createVisibleCalculators(),this.wot.wtOverlays.refresh(!1),this.wot.wtOverlays.applyToDOM(),e!==this.wot.wtViewport.getWorkspaceWidth()){this.wot.wtViewport.containerWidth=null;for(var l=this.wtTable.getFirstRenderedColumn(),a=this.wtTable.getLastRenderedColumn(),u=l;a>u;u++){var c=this.wtTable.getStretchedColumnWidth(u),d=this.columnFilter.sourceToRendered(u);this.COLGROUP.childNodes[d+this.rowHeaderCount].style.width=c+"px"}}this.wot.getSetting("onDraw",!0)}},removeRedundantRows:function(e){for(;this.wtTable.tbodyChildrenLength>e;)this.TBODY.removeChild(this.TBODY.lastChild),this.wtTable.tbodyChildrenLength--},renderRows:function(e,t,n){for(var o,r,i=0,s=this.rowFilter.renderedToSource(i),l=this.wtTable.isWorkingOnClone();e>s&&s>=0&&(i>1e3&&console.error("Security brake: Too much TRs. Please define height for your table, which will enforce scrollbars."),void 0===t||i!==t);){if(r=this.getOrCreateTrForRow(i,r),this.renderRowHeaders(s,r),this.adjustColumns(r,n+this.rowHeaderCount),o=this.renderCells(s,r,n),(!l||WalkontableOverlay.isOverlayTypeOf(this.wot.cloneOverlay,WalkontableOverlay.CLONE_BOTTOM))&&this.resetOversizedRow(s),r.firstChild){var a=this.wot.wtTable.getRowHeight(s);a?(a--,r.firstChild.style.height=a+"px"):r.firstChild.style.height=""}i++,s=this.rowFilter.renderedToSource(i)}},resetOversizedRow:function(e){this.wot.getSetting("externalRowCalculator")||this.wot.wtViewport.oversizedRows&&this.wot.wtViewport.oversizedRows[e]&&(this.wot.wtViewport.oversizedRows[e]=void 0)},markOversizedRows:function(){if(!this.wot.getSetting("externalRowCalculator")){var e,t,n,o,r,i=this.instance.wtTable.TBODY.childNodes.length,s=i*this.instance.wtSettings.settings.defaultRowHeight,l=d(this.instance.wtTable.TBODY)-1;this.instance.getSetting("totalRows");if(s!==l||this.instance.getSetting("fixedRowsBottom"))for(;i;)i--,n=this.instance.wtTable.rowFilter.renderedToSource(i),e=this.instance.wtTable.getRowHeight(n),o=this.instance.wtTable.getTrForRow(n),r=o.querySelector("th"),t=r?d(r):d(o)-1,(!e&&this.instance.wtSettings.settings.defaultRowHeighte)&&(this.instance.wtViewport.oversizedRows[n]=++t)}},markOversizedColumns:function(){var e=this.wot.getOverlayName();if(this.columnHeaderCount&&!this.wot.wtViewport.isMarkedOversizedColumn[e]&&!this.wtTable.isWorkingOnClone()){for(var t=this.wtTable.getRenderedColumnsCount(),n=0;no;o++)this.markIfOversizedColumnHeader(o);this.wot.wtViewport.isMarkedOversizedColumn[e]=!0}},adjustColumnHeaderHeights:function(){for(var e=this.wot.getSetting("columnHeaders"),t=this.wot.wtTable.THEAD.childNodes,n=this.wot.wtViewport.oversizedColumnHeaders,o=0,r=e.length;r>o;o++)if(n[o]){if(0===t[o].childNodes.length)return;t[o].childNodes[0].style.height=n[o]+"px"}},markIfOversizedColumnHeader:function(e){for(var t,n,o,r=this.wot.wtTable.columnFilter.renderedToSource(e),i=this.columnHeaderCount,s=this.wot.wtSettings.settings.defaultRowHeight;i;)i--,t=this.wot.wtTable.getColumnHeaderHeight(i),n=this.wot.wtTable.getColumnHeader(r,i),n&&(o=d(n),(!t&&o>s||o>t)&&(this.wot.wtViewport.oversizedColumnHeaders[i]=o))},renderCells:function(e,t,n){for(var o,i,s=0;n>s;s++)i=this.columnFilter.renderedToSource(s),o=0===s?t.childNodes[this.columnFilter.sourceColumnToVisibleRowHeadedColumn(i)]:o.nextSibling,"TH"==o.nodeName&&(o=r(o,t)),c(o,"hide")||(o.className=""),o.removeAttribute("style"),this.wot.wtSettings.settings.cellRenderer(e,i,o);return o},adjustColumnWidths:function(e){var t=0,n=this.wot.cloneSource?this.wot.cloneSource:this.wot,o=n.wtTable.holder;o.offsetHeightr;r++){var i=this.wtTable.getStretchedColumnWidth(this.columnFilter.renderedToSource(r));this.COLGROUP.childNodes[r+this.rowHeaderCount].style.width=i+"px"}},appendToTbody:function(e){this.TBODY.appendChild(e),this.wtTable.tbodyChildrenLength++},getOrCreateTrForRow:function(e,t){var n;return e>=this.wtTable.tbodyChildrenLength?(n=this.createRow(),this.appendToTbody(n)):n=0===e?this.TBODY.firstChild:t.nextSibling,n.className&&n.removeAttribute("class"),n},createRow:function(){for(var e=document.createElement("TR"),t=0;to;o++){var r=this.columnFilter.renderedToSource(o);this.renderColumnHeader(t,r,n.childNodes[o+this.rowHeaderCount])}},adjustColGroups:function(){for(var e=this.wtTable.getRenderedColumnsCount();this.wtTable.colgroupChildrenLengthe+this.rowHeaderCount;)this.COLGROUP.removeChild(this.COLGROUP.lastChild),this.wtTable.colgroupChildrenLength--;this.rowHeaderCount&&l(this.COLGROUP.childNodes[0],"rowHeader")},adjustThead:function(){var e=this.wtTable.getRenderedColumnsCount(),t=this.THEAD.firstChild;if(this.columnHeaders.length){for(var n=0,o=this.columnHeaders.length;o>n;n++){for(t=this.THEAD.childNodes[n],t||(t=document.createElement("TR"),this.THEAD.appendChild(t)),this.theadChildrenLength=t.childNodes.length;this.theadChildrenLengthe+this.rowHeaderCount;)t.removeChild(t.lastChild),this.theadChildrenLength--}var r=this.THEAD.childNodes.length;if(r>this.columnHeaders.length)for(var i=this.columnHeaders.length;r>i;i++)this.THEAD.removeChild(this.THEAD.lastChild)}else t&&a(t)},getTrForColumnHeaders:function(e){return this.THEAD.childNodes[e]},renderColumnHeader:function(e,t,n){return n.className="",n.removeAttribute("style"),this.columnHeaders[e](t,n,e)},adjustColumns:function(e,t){for(var n=e.childNodes.length;t>n;){var o=document.createElement("TD");e.appendChild(o),n++}for(;n>t;)e.removeChild(e.lastChild),n--},removeRedundantColumns:function(e){for(;this.wtTable.tbodyChildrenLength>e;)this.TBODY.removeChild(this.TBODY.lastChild),this.wtTable.tbodyChildrenLength--}},{}),window.WalkontableTableRenderer=h},{"helpers/dom/element":45}],22:[function(e,t,n){"use strict";Object.defineProperties(n,{WalkontableViewport:{get:function(){return w}},__esModule:{value:!0}});var o,r,i,s,l=(o=e("helpers/dom/element"),o&&o.__esModule&&o||{"default":o}),a=l.getScrollbarWidth,u=l.getScrollTop,c=l.getStyle,d=l.offset,h=l.outerHeight,f=l.outerWidth,g=(r=e("eventManager"),r&&r.__esModule&&r||{"default":r}).EventManager,p=(i=e("calculator/viewportColumns"),i&&i.__esModule&&i||{"default":i}).WalkontableViewportColumnsCalculator,m=(s=e("calculator/viewportRows"),s&&s.__esModule&&s||{"default":s}).WalkontableViewportRowsCalculator,w=function(e){var t=this;this.wot=e,this.instance=this.wot,this.oversizedRows=[],this.oversizedColumnHeaders=[],this.isMarkedOversizedColumn={},this.clientHeight=0,this.containerWidth=NaN,this.rowHeaderWidth=NaN,this.rowsVisibleCalculator=null,this.columnsVisibleCalculator=null,this.eventManager=new g(this.wot),this.eventManager.addEventListener(window,"resize",function(){t.clientHeight=t.getWorkspaceHeight()})};$traceurRuntime.createClass(w,{getWorkspaceHeight:function(){var e,t=this.instance.wtOverlays.topOverlay.trimmingContainer,n=0;return t===window?n=document.documentElement.clientHeight:(e=h(t),n=e>0&&t.clientHeight>0?t.clientHeight:1/0),n},getWorkspaceWidth:function(){var e,t,n=this.instance.getSetting("totalColumns"),o=this.instance.wtOverlays.leftOverlay.trimmingContainer,r=this.instance.getSetting("stretchH"),i=document.documentElement.offsetWidth;return e=Handsontable.freezeOverlays?Math.min(i-this.getWorkspaceOffset().left,i):Math.min(this.getContainerFillWidth(),i-this.getWorkspaceOffset().left,i),o===window&&n>0&&this.sumColumnWidths(0,n-1)>e?document.documentElement.clientWidth:o!==window&&(t=c(this.instance.wtOverlays.leftOverlay.trimmingContainer,"overflow"),"scroll"==t||"hidden"==t||"auto"==t)?Math.max(e,o.clientWidth):"none"!==r&&r?e:Math.max(e,f(this.instance.wtTable.TABLE))},hasVerticalScroll:function(){return this.getWorkspaceActualHeight()>this.getWorkspaceHeight()},hasHorizontalScroll:function(){return this.getWorkspaceActualWidth()>this.getWorkspaceWidth()},sumColumnWidths:function(e,t){for(var n=0;t>e;)n+=this.wot.wtTable.getColumnWidth(e),e++;return n},getContainerFillWidth:function(){if(this.containerWidth)return this.containerWidth;var e,t,n=this.instance.wtTable.holder;return t=document.createElement("div"),t.style.width="100%",t.style.height="1px",n.appendChild(t),e=t.offsetWidth,this.containerWidth=e,n.removeChild(t),e},getWorkspaceOffset:function(){return d(this.wot.wtTable.TABLE)},getWorkspaceActualHeight:function(){return h(this.wot.wtTable.TABLE)},getWorkspaceActualWidth:function(){return f(this.wot.wtTable.TABLE)||f(this.wot.wtTable.TBODY)||f(this.wot.wtTable.THEAD)},getColumnHeaderHeight:function(){return isNaN(this.columnHeaderHeight)&&(this.columnHeaderHeight=h(this.wot.wtTable.THEAD)),this.columnHeaderHeight},getViewportHeight:function(){var e,t=this.getWorkspaceHeight();return t===1/0?t:(e=this.getColumnHeaderHeight(),e>0&&(t-=e),t)},getRowHeaderWidth:function(){if(this.wot.cloneSource)return this.wot.cloneSource.wtViewport.getRowHeaderWidth();if(isNaN(this.rowHeaderWidth)){var e=this.instance.getSetting("rowHeaders");if(e.length){var t=this.instance.wtTable.TABLE.querySelector("TH");this.rowHeaderWidth=0;for(var n=0,o=e.length;o>n;n++)t?(this.rowHeaderWidth+=f(t),t=t.nextSibling):this.rowHeaderWidth+=50}else this.rowHeaderWidth=0}return this.rowHeaderWidth},getViewportWidth:function(){var e,t=this.getWorkspaceWidth();return t===1/0?t:(e=this.getRowHeaderWidth(),e>0?t-e:t)},createRowsCalculator:function(){var e,t,n,o,r,i,s,l=void 0!==arguments[0]?arguments[0]:!1,c=this;return this.rowHeaderWidth=NaN,e=this.wot.wtSettings.settings.renderAllRows?1/0:this.getViewportHeight(),t=u(this.wot.wtOverlays.mainTableScrollableElement)-this.wot.wtOverlays.topOverlay.getTableParentOffset(),0>t&&(t=0),n=this.wot.getSetting("fixedRowsTop"),r=this.wot.getSetting("fixedRowsBottom"),s=this.wot.getSetting("totalRows"),n&&(i=this.wot.wtOverlays.topOverlay.sumCellSizes(0,n),t+=i,e-=i),r&&this.wot.wtOverlays.bottomOverlay.clone&&(i=this.wot.wtOverlays.bottomOverlay.sumCellSizes(s-r,s),e-=i),o=this.wot.wtTable.holder.clientHeight===this.wot.wtTable.holder.offsetHeight?0:a(),new m(e,t,this.wot.getSetting("totalRows"),function(e){return c.wot.wtTable.getRowHeight(e)},l?null:this.wot.wtSettings.settings.viewportRowCalculatorOverride,l,o)},createColumnsCalculator:function(){var e,t,n=void 0!==arguments[0]?arguments[0]:!1,o=this,r=this.getViewportWidth();if(this.columnHeaderHeight=NaN,e=this.wot.wtOverlays.leftOverlay.getScrollPosition()-this.wot.wtOverlays.leftOverlay.getTableParentOffset(),0>e&&(e=0),t=this.wot.getSetting("fixedColumnsLeft")){var i=this.wot.wtOverlays.leftOverlay.sumCellSizes(0,t);e+=i,r-=i}return this.wot.wtTable.holder.clientWidth!==this.wot.wtTable.holder.offsetWidth&&(r-=a()),new p(r,e,this.wot.getSetting("totalColumns"),function(e){return o.wot.wtTable.getColumnWidth(e)},n?null:this.wot.wtSettings.settings.viewportColumnCalculatorOverride,n,this.wot.getSetting("stretchH"))},createRenderCalculators:function(){var e=void 0!==arguments[0]?arguments[0]:!1;if(e){var t=this.createRowsCalculator(!0),n=this.createColumnsCalculator(!0);this.areAllProposedVisibleRowsAlreadyRendered(t)&&this.areAllProposedVisibleColumnsAlreadyRendered(n)||(e=!1)}return e||(this.rowsRenderCalculator=this.createRowsCalculator(),this.columnsRenderCalculator=this.createColumnsCalculator()),this.rowsVisibleCalculator=null,this.columnsVisibleCalculator=null,e},createVisibleCalculators:function(){this.rowsVisibleCalculator=this.createRowsCalculator(!0),this.columnsVisibleCalculator=this.createColumnsCalculator(!0)},areAllProposedVisibleRowsAlreadyRendered:function(e){return this.rowsVisibleCalculator?e.startRow0?!1:e.endRow>this.rowsRenderCalculator.endRow||e.endRow===this.rowsRenderCalculator.endRow&&e.endRow0?!1:e.endColumn>this.columnsRenderCalculator.endColumn||e.endColumn===this.columnsRenderCalculator.endColumn&&e.endColumn=0;s--)if(null===e[s])e.splice(s,1);else{var l=e[s][0],a=d.propToCol(e[s][1]),u=m.runHooks("modifyCol",a),c=m.getCellMeta(l,u);if("numeric"===c.type&&"string"==typeof e[s][3]&&e[s][3].length>0&&(/^-?[\d\s]*(\.|\,)?\d*$/.test(e[s][3])||c.format)){var h=e[s][3].length;"undefined"==typeof c.language?R.language("en"):e[s][3].indexOf(".")===h-3&&-1===e[s][3].indexOf(",")?R.language("en"):R.language(c.language),R.validate(e[s][3])&&(e[s][3]=R().unformat(e[s][3]))}m.getCellValidator(c)&&(i.addValidatorToQueue(),m.validateCell(e[s][3],c,function(t,n){return function(o){if("boolean"!=typeof o)throw new Error("Validation error: result is not boolean");o===!1&&n.allowInvalid===!1&&(e.splice(t,1),n.valid=!0,--t),i.removeValidatorFormQueue(); +}}(s,c),t))}i.checkIfQueueIsEmpty()}function r(e,t){var n=e.length-1;if(!(0>n)){for(;n>=0;n--)if(null!==e[n]){if(null!=e[n][2]||null!=e[n][3]){if(c.settings.allowInsertRow)for(;e[n][0]>m.countRows()-1;)d.createRow();if("array"===m.dataType&&c.settings.allowInsertColumn)for(;d.propToCol(e[n][1])>m.countCols()-1;)d.createCol();d.set(e[n][0],e[n][1],e[n][3])}}else e.splice(n,1);m.forceFullRender=!0,f.adjustRowsAndCols(),Handsontable.hooks.run(m,"beforeChangeRender",e,t),g.refreshBorders(null,!0),m.view.wt.wtOverlays.adjustElementsSize(),Handsontable.hooks.run(m,"afterChange",e,t||"edit")}}function i(e,t,n){return"object"==typeof e?e:[[e,t,n]]}function s(e){if(e.hasOwnProperty("type")){var t,n={};if("object"==typeof e.type)t=e.type;else if("string"==typeof e.type&&(t=Handsontable.cellTypes[e.type],void 0===t))throw new Error('You declared cell type "'+e.type+'" as a string that is not mapped to a known object. Cell type must be an object or a string mapped to an object in Handsontable.cellTypes');for(var o in t)t.hasOwnProperty(o)&&!e.hasOwnProperty(o)&&(n[o]=t[o]);return n}}function l(e){return Handsontable.hooks.run(m,"modifyRow",e)}function a(e){return Handsontable.hooks.run(m,"modifyCol",e)}function u(){throw new Error("This method cannot be called because this Handsontable instance has been destroyed")}var c,d,h,f,g,p,m=this,w=function(){},v=A(m);x(w.prototype,Q.prototype),x(w.prototype,t),x(w.prototype,s(t)),this.rootElement=e,this.isHotTableEnv=O(this.rootElement),Handsontable.eventManager.isHotTableEnv=this.isHotTableEnv,this.container=document.createElement("DIV"),this.renderCall=!1,e.insertBefore(this.container,e.firstChild),this.guid="ht_"+B(),this.rootElement.id&&"ht_"!==this.rootElement.id.substring(0,3)||(this.rootElement.id=this.guid),c={cellSettings:[],columnSettings:[],columnsSettingConflicts:["data","width"],settings:new w,selRange:null,isPopulated:null,scrollable:null,firstRun:!0},f={alter:function(e,t,n,o,r){var i;switch(n=n||1,e){case"insert_row":if(m.getSettings().maxRows===m.countSourceRows())return;i=d.createRow(t,n),i&&(g.isSelected()&&c.selRange.from.row>=t?(c.selRange.from.row=c.selRange.from.row+i,g.transformEnd(i,0)):g.refreshBorders());break;case"insert_col":if(i=d.createCol(t,n)){if(Array.isArray(m.getSettings().colHeaders)){var s=[t,0];s.length+=i,Array.prototype.splice.apply(m.getSettings().colHeaders,s)}g.isSelected()&&c.selRange.from.col>=t?(c.selRange.from.col=c.selRange.from.col+i,g.transformEnd(0,i)):g.refreshBorders()}break;case"remove_row":d.removeRow(t,n),c.cellSettings.splice(t,n);var l=m.countRows(),a=m.getSettings().fixedRowsTop;a>=t+1&&(m.getSettings().fixedRowsTop-=Math.min(n,a-t));var u=m.getSettings().fixedRowsBottom;u&&t+1>=l-u&&(m.getSettings().fixedRowsBottom-=Math.min(n,u-t)),f.adjustRowsAndCols(),g.refreshBorders();break;case"remove_col":d.removeCol(t,n);for(var h=0,p=d.getAll().length;p>h;h++)h in c.cellSettings&&c.cellSettings[h].splice(t,n);var w=m.getSettings().fixedColumnsLeft;w>=t+1&&(m.getSettings().fixedColumnsLeft-=Math.min(n,w-t)),Array.isArray(m.getSettings().colHeaders)&&("undefined"==typeof t&&(t=-1),m.getSettings().colHeaders.splice(t,n)),f.adjustRowsAndCols(),g.refreshBorders();break;default:throw new Error('There is no such action "'+e+'"')}r||f.adjustRowsAndCols()},adjustRowsAndCols:function(){if(c.settings.minRows){var e=m.countRows();if(et;t++)d.createRow(m.countRows(),1,!0)}if(c.settings.minSpareRows){var o=m.countEmptyRows(!0);if(oi-1?(a=i-1,l=!0,h>a&&(h=a)):h>i-1&&(h=i-1,l=!0,a>h&&(a=h)),u>s-1?(u=s-1,l=!0,f>u&&(f=u)):f>s-1&&(f=s-1,l=!0,u>f&&(u=f)),l&&m.selectCell(a,u,h,f)}m.view&&m.view.wt.wtOverlays.adjustElementsSize()},populateFromArray:function(e,t,n,o,r,i,s){var l,a,u,d,h=[],f={};if(a=t.length,0===a)return!1;var g,p,w,v;({row:null===n?null:n.row,col:null===n?null:n.col});switch(r){case"shift_down":for(g=n?n.col-e.col+1:0,p=n?n.row-e.row+1:0,t=G(t),u=0,d=t.length,w=Math.max(d,g);w>u;u++)if(d>u){for(l=0,a=t[u].length;p-a>l;l++)t[u].push(t[u][l%a]);t[u].unshift(e.col+u,e.row,0),m.spliceCol.apply(m,t[u])}else t[u%d][0]=e.col+u,m.spliceCol.apply(m,t[u%d]);break;case"shift_right":for(g=n?n.col-e.col+1:0,p=n?n.row-e.row+1:0,l=0,a=t.length,v=Math.max(a,p);v>l;l++)if(a>l){for(u=0,d=t[l].length;g-d>u;u++)t[l].push(t[l][u%d]);t[l].unshift(e.row+l,e.col,0),m.spliceRow.apply(m,t[l])}else t[l%a][0]=e.row+l,m.spliceRow.apply(m,t[l%a]);break;case"overwrite":default:f.row=e.row,f.col=e.col;var b,C={row:n&&e?n.row-e.row+1:1,col:n&&e?n.col-e.col+1:1},y=0,R=0,E=!0,S=function(e){var n=void 0!==arguments[1]?arguments[1]:null,o=t[e%t.length];return null!==n?o[n%o.length]:o},T=t.length,O=n?n.row-e.row+1:0;for(a=n?O:Math.max(T,O),l=0;a>l&&!(n&&f.row>n.row&&O>T||!c.settings.allowInsertRow&&f.row>m.countRows()-1||f.row>=c.settings.maxRows);l++){var _=l-y,M=S(_).length,H=n?n.col-e.col+1:0;if(d=n?H:Math.max(M,H),f.col=e.col,b=m.getCellMeta(f.row,f.col),"paste"!==o&&"autofill"!==o||!b.skipRowOnPaste){for(R=0,u=0;d>u&&!(n&&f.col>n.col&&H>M||!c.settings.allowInsertColumn&&f.col>m.countCols()-1||f.col>=c.settings.maxCols);u++)if(b=m.getCellMeta(f.row,f.col),"paste"!==o&&"autofill"!==o||!b.skipColumnOnPaste)if(b.readOnly)f.col++;else{var k=u-R,A=S(_,k),P=m.getDataAtCell(f.row,f.col),x={row:_,col:k};if("autofill"===o){var W=m.runHooks("beforeAutofillInsidePopulate",x,i,t,s,{},C);W&&(A="undefined"==typeof W.value?A:W.value)}if(null!==A&&"object"==typeof A)if(null===P||"object"!=typeof P)E=!1;else{var I=D(P[0]||P),j=D(A[0]||A);N(I,j)?A=L(A):E=!1}else null!==P&&"object"==typeof P&&(E=!1);E&&h.push([f.row,f.col,A]),E=!0,f.col++}else R++,f.col++,d++;f.row++}else y++,f.row++,a++}m.setDataAtCell(h,null,null,o||"populateFromArray")}}},this.selection=g={inProgress:!1,selectedHeader:{cols:!1,rows:!1},setSelectedHeaders:function(e,t){m.selection.selectedHeader.rows=e,m.selection.selectedHeader.cols=t},begin:function(){m.selection.inProgress=!0},finish:function(){var e=m.getSelected();Handsontable.hooks.run(m,"afterSelectionEnd",e[0],e[1],e[2],e[3]),Handsontable.hooks.run(m,"afterSelectionEndByProp",e[0],m.colToProp(e[1]),e[2],m.colToProp(e[3])),m.selection.inProgress=!1},isInProgress:function(){return m.selection.inProgress},setRangeStart:function(e,t){Handsontable.hooks.run(m,"beforeSetRangeStart",e),c.selRange=new X(e,e,e),g.setRangeEnd(e,null,t)},setRangeEnd:function(e,t,n){if(null!==c.selRange){var o,r=!1,i=!0,s=m.view.wt.wtTable.getFirstVisibleRow(),l=m.view.wt.wtTable.getFirstVisibleColumn(),a={row:null,col:null};Handsontable.hooks.run(m,"beforeSetRangeEnd",e),m.selection.begin(),a.row=e.row<0?s:e.row,a.col=e.col<0?l:e.col,c.selRange.to=new Y(a.row,a.col),c.settings.multiSelect||(c.selRange.from=e),m.view.wt.selections.current.clear(),o=m.getCellMeta(c.selRange.highlight.row,c.selRange.highlight.col).disableVisualSelection,"string"==typeof o&&(o=[o]),(o===!1||Array.isArray(o)&&-1===o.indexOf("current"))&&m.view.wt.selections.current.add(c.selRange.highlight),m.view.wt.selections.area.clear(),(o===!1||Array.isArray(o)&&-1===o.indexOf("area"))&&g.isMultiple()&&(m.view.wt.selections.area.add(c.selRange.from),m.view.wt.selections.area.add(c.selRange.to)),(c.settings.currentRowClassName||c.settings.currentColClassName)&&(m.view.wt.selections.highlight.clear(),m.view.wt.selections.highlight.add(c.selRange.from),m.view.wt.selections.highlight.add(c.selRange.to)),Handsontable.hooks.run(m,"afterSelection",c.selRange.from.row,c.selRange.from.col,c.selRange.to.row,c.selRange.to.col),Handsontable.hooks.run(m,"afterSelectionByProp",c.selRange.from.row,d.colToProp(c.selRange.from.col),c.selRange.to.row,d.colToProp(c.selRange.to.col)),(0===c.selRange.from.row&&c.selRange.to.row===m.countRows()-1&&m.countRows()>1||0===c.selRange.from.col&&c.selRange.to.col===m.countCols()-1&&m.countCols()>1)&&(r=!0),(e.row<0||e.col<0)&&(i=!1),t!==!1&&!r&&i&&(c.selRange.from&&!g.isMultiple()?m.view.scrollViewport(c.selRange.from):m.view.scrollViewport(e)),g.refreshBorders(null,n)}},refreshBorders:function(e,t){t||p.destroyEditor(e),m.view.render(),g.isSelected()&&!t&&p.prepareEditor()},isMultiple:function(){var e=!(c.selRange.to.col===c.selRange.from.col&&c.selRange.to.row===c.selRange.from.row),t=Handsontable.hooks.run(m,"afterIsMultipleSelection",e);return e?t:void 0},transformStart:function(e,t,n,o){var r,i,s,l,a=new Y(e,t),u=0,d=0;m.runHooks("modifyTransformStart",a),r=m.countRows(),i=m.countCols(),l=m.getSettings().fixedRowsBottom,c.selRange.highlight.row+e>r-1?n&&c.settings.minSpareRows>0&&!(l&&c.selRange.highlight.row>=r-l-1)?(m.alter("insert_row",r),r=m.countRows()):c.settings.autoWrapCol&&(a.row=1-r,a.col=c.selRange.highlight.col+a.col==i-1?1-i:1):c.settings.autoWrapCol&&c.selRange.highlight.row+a.row<0&&c.selRange.highlight.col+a.col>=0&&(a.row=r-1,a.col=c.selRange.highlight.col+a.col==0?i-1:-1),c.selRange.highlight.col+a.col>i-1?n&&c.settings.minSpareCols>0?(m.alter("insert_col",i),i=m.countCols()):c.settings.autoWrapRow&&(a.row=c.selRange.highlight.row+a.row==r-1?1-r:1,a.col=1-i):c.settings.autoWrapRow&&c.selRange.highlight.col+a.col<0&&c.selRange.highlight.row+a.row>=0&&(a.row=c.selRange.highlight.row+a.row==0?r-1:-1,a.col=i-1),s=new Y(c.selRange.highlight.row+a.row,c.selRange.highlight.col+a.col),s.row<0?(u=-1,s.row=0):s.row>0&&s.row>=r&&(u=1,s.row=r-1),s.col<0?(d=-1,s.col=0):s.col>0&&s.col>=i&&(d=1,s.col=i-1),m.runHooks("afterModifyTransformStart",s,u,d),g.setRangeStart(s,o)},transformEnd:function(e,t){var n,o,r,i=new Y(e,t),s=0,l=0;m.runHooks("modifyTransformEnd",i),n=m.countRows(),o=m.countCols(),r=new Y(c.selRange.to.row+i.row,c.selRange.to.col+i.col),r.row<0?(s=-1,r.row=0):r.row>0&&r.row>=n&&(s=1,r.row=n-1),r.col<0?(l=-1,r.col=0):r.col>0&&r.col>=o&&(l=1,r.col=o-1),m.runHooks("afterModifyTransformEnd",r,s,l),g.setRangeEnd(r,!0)},isSelected:function(){return null!==c.selRange},inInSelection:function(e){return g.isSelected()?c.selRange.includes(e):!1},deselect:function(){g.isSelected()&&(m.selection.inProgress=!1,c.selRange=null,m.view.wt.selections.current.clear(),m.view.wt.selections.area.clear(),(c.settings.currentRowClassName||c.settings.currentColClassName)&&m.view.wt.selections.highlight.clear(),p.destroyEditor(),g.refreshBorders(),Handsontable.hooks.run(m,"afterDeselect"))},selectAll:function(){c.settings.multiSelect&&(g.setRangeStart(new Y(0,0)),g.setRangeEnd(new Y(m.countRows()-1,m.countCols()-1),!1))},empty:function(){if(g.isSelected()){var e,t,n=c.selRange.getTopLeftCorner(),o=c.selRange.getBottomRightCorner(),r=[];for(e=n.row;e<=o.row;e++)for(t=n.col;t<=o.col;t++)m.getCellMeta(e,t).readOnly||r.push([e,t,""]);m.setDataAtCell(r)}}},this.init=function(){h=new z(m,c.settings.data),Handsontable.hooks.run(m,"beforeInit"),Handsontable.mobileBrowser&&S(m.rootElement,"mobile"),this.updateSettings(c.settings,!0),this.view=new F(this),p=new k(m,c,g,d),this.forceFullRender=!0,Handsontable.hooks.run(m,"init"),this.view.render(),"object"==typeof c.firstRun&&(Handsontable.hooks.run(m,"afterChange",c.firstRun[0],c.firstRun[1]),c.firstRun=!1),Handsontable.hooks.run(m,"afterInit")},this.validateCell=function(e,t,n,o){function r(e){var o=t.physicalCol,r=t.physicalRow,i=m.getCell(r,o,!0);i&&m.view.wt.wtSettings.settings.cellRenderer(r,o,i),n(e)}var i=m.getCellValidator(t);"[object RegExp]"===Object.prototype.toString.call(i)&&(i=function(e){return function(t,n){n(e.test(t))}}(i)),"function"==typeof i?(e=Handsontable.hooks.run(m,"beforeValidate",e,t.row,t.prop,o),m._registerTimeout(setTimeout(function(){i.call(t,e,function(n){n=Handsontable.hooks.run(m,"afterValidate",n,e,t.row,t.prop,o),t.valid=n,r(n),Handsontable.hooks.run(m,"postAfterValidate",n,e,t.row,t.prop,o)})},0))):(t.valid=!0,r(t.valid))},this.setDataAtCell=function(e,t,n,s){var l,a,u,c=i(e,t,n),h=[];for(l=0,a=c.length;a>l;l++){if("object"!=typeof c[l])throw new Error("Method `setDataAtCell` accepts row number or changes array of arrays as its first parameter");if("number"!=typeof c[l][1])throw new Error("Method `setDataAtCell` accepts row and column number as its parameters. If you want to use object property name, use method `setDataAtRowProp`");u=d.colToProp(c[l][1]),h.push([c[l][0],u,d.get(c[l][0],u),c[l][2]])}s||"object"!=typeof e||(s=t),o(h,s,function(){r(h,s)})},this.setDataAtRowProp=function(e,t,n,s){var l,a,u=i(e,t,n),c=[];for(l=0,a=u.length;a>l;l++)c.push([u[l][0],u[l][1],d.get(u[l][0],u[l][1]),u[l][2]]);s||"object"!=typeof e||(s=t),o(c,s,function(){r(c,s)})},this.listen=function(){Handsontable.activeGuid=m.guid},this.unlisten=function(){Handsontable.activeGuid=null},this.isListening=function(){return Handsontable.activeGuid===m.guid},this.destroyEditor=function(e){g.refreshBorders(e)},this.populateFromArray=function(e,t,n,o,r,i,s,l,a){var u;if("object"!=typeof n||"object"!=typeof n[0])throw new Error("populateFromArray parameter `input` must be an array of arrays");return u="number"==typeof o?new Y(o,r):null,f.populateFromArray(new Y(e,t),n,u,i,s,l,a)},this.spliceCol=function(e,t,n){return d.spliceCol.apply(d,arguments)},this.spliceRow=function(e,t,n){return d.spliceRow.apply(d,arguments)},this.getSelected=function(){return g.isSelected()?[c.selRange.from.row,c.selRange.from.col,c.selRange.to.row,c.selRange.to.col]:void 0},this.getSelectedRange=function(){return g.isSelected()?c.selRange:void 0},this.render=function(){m.view&&(m.renderCall=!0,m.forceFullRender=!0,g.refreshBorders(null,!0))},this.loadData=function(e){function t(){c.cellSettings.length=0}if("object"==typeof e&&null!==e)e.push&&e.splice||(e=[e]);else{if(null!==e)throw new Error("loadData only accepts array of objects or array of arrays ("+typeof e+" given)");e=[];for(var n,o=0,r=c.settings.startRows;r>o;o++){n=[];for(var i=0,s=c.settings.startCols;s>i;i++)n.push(null);e.push(n)}}c.isPopulated=!1,w.prototype.data=e,Array.isArray(c.settings.dataSchema)||Array.isArray(e[0])?m.dataType="array":"function"==typeof c.settings.dataSchema?m.dataType="function":m.dataType="object",d=new H(m,c,w),h.data=e,h.dataType=m.dataType,h.colToProp=d.colToProp.bind(d),h.propToCol=d.propToCol.bind(d),t(),f.adjustRowsAndCols(),Handsontable.hooks.run(m,"afterLoadData",c.firstRun),c.firstRun?c.firstRun=[null,"loadData"]:(Handsontable.hooks.run(m,"afterChange",null,"loadData"),m.render()),c.isPopulated=!0},this.getData=function(e,t,n,o){return"undefined"==typeof e?d.getAll():d.getRange(new Y(e,t),new Y(n,o),d.DESTINATION_RENDERER)},this.getCopyableText=function(e,t,n,o){return d.getCopyableText(new Y(e,t),new Y(n,o))},this.getCopyableData=function(e,t){return d.getCopyable(e,d.colToProp(t))},this.getSchema=function(){return d.getSchema()},this.updateSettings=function(e,t){var n,o;if("undefined"!=typeof e.rows)throw new Error('"rows" setting is no longer supported. do you mean startRows, minRows or maxRows?');if("undefined"!=typeof e.cols)throw new Error('"cols" setting is no longer supported. do you mean startCols, minCols or maxCols?');for(n in e)"data"!==n&&(Handsontable.hooks.getRegistered().indexOf(n)>-1?("function"==typeof e[n]||Array.isArray(e[n]))&&m.addHook(n,e[n]):!t&&e.hasOwnProperty(n)&&(w.prototype[n]=e[n]));if(void 0===e.data&&void 0===c.settings.data?m.loadData(null):void 0!==e.data?m.loadData(e.data):void 0!==e.columns&&d.createMap(),o=m.countCols(),c.cellSettings.length=0,o>0){var r,i;for(n=0;o>n;n++)c.columnSettings[n]=M(w,c.columnsSettingConflicts),r=c.columnSettings[n].prototype,w.prototype.columns&&(i=w.prototype.columns[n],x(r,i),x(r,s(i)))}if("undefined"!=typeof e.cell)for(n in e.cell)if(e.cell.hasOwnProperty(n)){var l=e.cell[n];m.setCellMetaObject(l.row,l.col,l)}if(Handsontable.hooks.run(m,"afterCellMetaReset"),"undefined"!=typeof e.className&&(w.prototype.className&&_(m.rootElement,w.prototype.className),e.className&&S(m.rootElement,e.className)),"undefined"!=typeof e.height){var a=e.height;"function"==typeof a&&(a=a()),m.rootElement.style.height=a+"px"}if("undefined"!=typeof e.width){var u=e.width;"function"==typeof u&&(u=u()),m.rootElement.style.width=u+"px"}a&&(m.rootElement.style.overflow="hidden"),t||Handsontable.hooks.run(m,"afterUpdateSettings"),f.adjustRowsAndCols(),m.view&&!c.firstRun&&(m.forceFullRender=!0,g.refreshBorders(null,!0))},this.getValue=function(){var e=m.getSelected();if(w.prototype.getValue){if("function"==typeof w.prototype.getValue)return w.prototype.getValue.call(m);if(e)return m.getData()[e[0]][w.prototype.getValue]}else if(e)return m.getDataAtCell(e[0],e[1])},this.getSettings=function(){return c.settings},this.clear=function(){g.selectAll(),g.empty()},this.alter=function(e,t,n,o,r){f.alter(e,t,n,o,r)},this.getCell=function(e,t,n){return m.view.getCellAtCoords(new Y(e,t),n)},this.getCoords=function(e){return this.view.wt.wtTable.getCoords.call(this.view.wt.wtTable,e)},this.colToProp=function(e){return d.colToProp(e)},this.propToCol=function(e){return d.propToCol(e)},this.getDataAtCell=function(e,t){return d.get(e,d.colToProp(t))},this.getDataAtRowProp=function(e,t){return d.get(e,t)},this.getDataAtCol=function(e){var t=[];return t.concat.apply(t,d.getRange(new Y(0,e),new Y(c.settings.data.length-1,e),d.DESTINATION_RENDERER))},this.getDataAtProp=function(e){var t,n=[];return t=d.getRange(new Y(0,d.propToCol(e)),new Y(c.settings.data.length-1,d.propToCol(e)),d.DESTINATION_RENDERER),n.concat.apply(n,t)},this.getSourceData=function(e,t,n,o){var r;return r=void 0===e?h.getData():h.getByRange(new Y(e,t),new Y(n,o))},this.getSourceDataAtCol=function(e){return h.getAtColumn(e)},this.getSourceDataAtRow=function(e){return h.getAtRow(e)},this.getSourceDataAtCell=function(e,t){return h.getAtCell(e,t)},this.getDataAtRow=function(e){var t=d.getRange(new Y(e,0),new Y(e,this.countCols()-1),d.DESTINATION_RENDERER);return t[0]},this.getDataType=function(e,t,n,o){var r=this,i=null,s=null;void 0===e&&(e=0,n=this.countRows(),t=0,o=this.countCols()),void 0===n&&(n=e),void 0===o&&(o=t);var l="mixed";return V(Math.min(e,n),Math.max(e,n),function(e){var n=!0;return V(Math.min(t,o),Math.max(t,o),function(t){var o=r.getCellMeta(e,t);return s=o.type,i?n=i===s:i=s,n}),l=n?s:"mixed",n}),l},this.removeCellMeta=function(e,t,n){var o=m.getCellMeta(e,t);void 0!=o[n]&&delete c.cellSettings[e][t][n]},this.setCellMetaObject=function(e,t,n){if("object"==typeof n)for(var o in n)if(n.hasOwnProperty(o)){var r=n[o];this.setCellMeta(e,t,o,r)}},this.setCellMeta=function(e,t,n,o){c.cellSettings[e]||(c.cellSettings[e]=[]),c.cellSettings[e][t]||(c.cellSettings[e][t]=new c.columnSettings[t]),c.cellSettings[e][t][n]=o,Handsontable.hooks.run(m,"afterSetCellMeta",e,t,n,o)},this.getCellsMeta=function(){return W(c.cellSettings)},this.getCellMeta=function(e,t){var n,o=d.colToProp(t),r=e,i=t;if(e=l(e),t=a(t),c.columnSettings[t]||(c.columnSettings[t]=M(w,c.columnsSettingConflicts)),c.cellSettings[e]||(c.cellSettings[e]=[]),c.cellSettings[e][t]||(c.cellSettings[e][t]=new c.columnSettings[t]),n=c.cellSettings[e][t],n.row=e,n.col=t,n.physicalRow=r,n.physicalCol=i,n.prop=o,n.instance=m,Handsontable.hooks.run(m,"beforeGetCellMeta",e,t,n),x(n,s(n)),n.cells){var u=n.cells.call(n,e,t,o);u&&(x(n,u),x(n,s(u)))}return Handsontable.hooks.run(m,"afterGetCellMeta",e,t,n),n},this.isColumnModificationAllowed=function(){return!("object"===m.dataType||m.getSettings().columns)};var b=$("renderer");this.getCellRenderer=function(e,t){var n=b.call(this,e,t);return j(n)},this.getCellEditor=$("editor"),this.getCellValidator=$("validator"),this.validateCells=function(e){var t=new n;t.onQueueEmpty=e;for(var o=m.countRows()-1;o>=0;){for(var r=m.countCols()-1;r>=0;)t.addValidatorToQueue(),m.validateCell(m.getDataAtCell(o,r),m.getCellMeta(o,r),function(e){if("boolean"!=typeof e)throw new Error("Validation error: result is not boolean");e===!1&&(t.valid=!1),t.removeValidatorFormQueue()},"validateCells"),r--;o--}t.checkIfQueueIsEmpty()},this.getRowHeader=function(e){var t=c.settings.rowHeaders;return void 0!==e&&(e=Handsontable.hooks.run(m,"modifyRowHeader",e)),void 0===e?(t=[],V(m.countRows()-1,function(e){t.push(m.getRowHeader(e))})):Array.isArray(t)&&void 0!==t[e]?t=t[e]:"function"==typeof t?t=t(e):t&&"string"!=typeof t&&"number"!=typeof t&&(t=e+1),t},this.hasRowHeaders=function(){return!!c.settings.rowHeaders},this.hasColHeaders=function(){if(void 0!==c.settings.colHeaders&&null!==c.settings.colHeaders)return!!c.settings.colHeaders;for(var e=0,t=m.countCols();t>e;e++)if(m.getColHeader(e))return!0;return!1},this.getColHeader=function(e){if(e=Handsontable.hooks.run(m,"modifyColHeader",e),void 0===e){for(var t=[],n=0,o=m.countCols();o>n;n++)t.push(m.getColHeader(n));return t}var r=e;return e=Handsontable.hooks.run(m,"modifyCol",e),c.settings.columns&&c.settings.columns[e]&&c.settings.columns[e].title?c.settings.columns[e].title:Array.isArray(c.settings.colHeaders)&&void 0!==c.settings.colHeaders[e]?c.settings.colHeaders[e]:"function"==typeof c.settings.colHeaders?c.settings.colHeaders(e):c.settings.colHeaders&&"string"!=typeof c.settings.colHeaders&&"number"!=typeof c.settings.colHeaders?K(r):c.settings.colHeaders},this._getColWidthFromSettings=function(e){var t=m.getCellMeta(0,e),n=t.width;if((void 0===n||n===c.settings.width)&&(n=t.colWidths),void 0!==n&&null!==n){switch(typeof n){case"object":n=n[e];break;case"function":n=n(e)}"string"==typeof n&&(n=parseInt(n,10))}return n},this.getColWidth=function(e){var t=m._getColWidthFromSettings(e);return t=Handsontable.hooks.run(m,"modifyColWidth",t,e),void 0===t&&(t=q.DEFAULT_WIDTH),t},this._getRowHeightFromSettings=function(e){var t=c.settings.rowHeights;if(void 0!==t&&null!==t){switch(typeof t){case"object":t=t[e];break;case"function":t=t(e)}"string"==typeof t&&(t=parseInt(t,10))}return t},this.getRowHeight=function(e){var t=m._getRowHeightFromSettings(e);return t=Handsontable.hooks.run(m,"modifyRowHeight",t,e)},this.countSourceRows=function(){return m.getSourceData()?m.getSourceData().length:0},this.countRows=function(){return d.getLength()},this.countCols=function(){return"object"===m.dataType||"function"===m.dataType?c.settings.columns&&c.settings.columns.length?c.settings.columns.length:d.colToPropCache.length:"array"===m.dataType?c.settings.columns&&c.settings.columns.length?c.settings.columns.length:c.settings.data&&c.settings.data[0]&&c.settings.data[0].length?c.settings.data[0].length:0:void 0},this.getColspanOffset=function(e,t){var n=0;if(m.colspanArray){for(var o=0;e>o;o++)n+=m.colspanArray[t][o]-1||0;return n}for(var n=0,r=m.view.wt.wtTable.THEAD.childNodes.length-t-1,i=m.view.wt.wtTable.THEAD.querySelector("tr:nth-child("+parseInt(r+1,10)+")"),s=m.view.wt.wtSettings.settings.rowHeaders().length,o=s;s+e>o;o++)i.childNodes[o].hasAttribute("colspan")&&(n+=parseInt(i.childNodes[o].getAttribute("colspan"),10)-1);return n},this.getHeaderColspan=function(e,t){var n=m.view.wt.wtTable.THEAD.childNodes.length-t-1,o=m.view.wt.wtSettings.settings.rowHeaders().length,r=m.view.wt.wtTable.THEAD.querySelector("tr:nth-child("+parseInt(n+1,10)+")"),i=o+e-m.view.wt.wtViewport.columnsRenderCalculator.startColumn;return r.childNodes[i].hasAttribute("colspan")?parseInt(r.childNodes[i].getAttribute("colspan"),10):0},this.rowOffset=function(){return m.view.wt.wtTable.getFirstRenderedRow()},this.colOffset=function(){return m.view.wt.wtTable.getFirstRenderedColumn()},this.countRenderedRows=function(){return m.view.wt.drawn?m.view.wt.wtTable.getRenderedRowsCount():-1},this.countVisibleRows=function(){return m.view.wt.drawn?m.view.wt.wtTable.getVisibleRowsCount():-1},this.countRenderedCols=function(){return m.view.wt.drawn?m.view.wt.wtTable.getRenderedColumnsCount():-1},this.countVisibleCols=function(){return m.view.wt.drawn?m.view.wt.wtTable.getVisibleColumnsCount():-1},this.countEmptyRows=function(e){for(var t,n=m.countRows()-1,o=0;n>=0;){if(t=Handsontable.hooks.run(this,"modifyRow",n),m.isEmptyRow(t))o++;else if(e)break;n--}return o},this.countEmptyCols=function(e){if(m.countRows()<1)return 0;for(var t=m.countCols()-1,n=0;t>=0;){if(m.isEmptyCol(t))n++;else if(e)break;t--}return n},this.isEmptyRow=function(e){return c.settings.isEmptyRow.call(m,e)},this.isEmptyCol=function(e){return c.settings.isEmptyCol.call(m,e)},this.selectCell=function(e,t,n,o,r,i){var s;if(i="undefined"==typeof i||i===!0,"number"!=typeof e||0>e||e>=m.countRows())return!1;if("number"!=typeof t||0>t||t>=m.countCols())return!1;if("undefined"!=typeof n){if("number"!=typeof n||0>n||n>=m.countRows())return!1;if("number"!=typeof o||0>o||o>=m.countCols())return!1}return s=new Y(e,t),c.selRange=new X(s,s,s),i&&m.listen(),"undefined"==typeof n?g.setRangeEnd(c.selRange.from,r):g.setRangeEnd(new Y(n,o),r),m.selection.finish(),!0},this.selectCellByProp=function(e,t,n,o,r){return arguments[1]=d.propToCol(arguments[1]),"undefined"!=typeof arguments[3]&&(arguments[3]=d.propToCol(arguments[3])),m.selectCell.apply(m,arguments)},this.deselectCell=function(){g.deselect()},this.destroy=function(){m._clearTimeouts(),m.view&&m.view.destroy(),h&&h.destroy(),h=null,T(m.rootElement),v.destroy(),Handsontable.hooks.run(m,"afterDestroy"),Handsontable.hooks.destroy(m);for(var e in m)m.hasOwnProperty(e)&&("function"==typeof m[e]?m[e]=u:"guid"!==e&&(m[e]=null));c=null,d=null,f=null,g=null,p=null,m=null,w=null},this.getActiveEditor=function(){return p.getActiveEditor()},this.getPlugin=function(e){return I(this,e)},this.getInstance=function(){return m},this.addHook=function(e,t){Handsontable.hooks.add(e,t,m)},this.hasHook=function(e){return Handsontable.hooks.has(e,m)},this.addHookOnce=function(e,t){Handsontable.hooks.once(e,t,m)},this.removeHook=function(e,t){Handsontable.hooks.remove(e,t,m)},this.runHooks=function(e,t,n,o,r,i,s){return Handsontable.hooks.run(m,e,t,n,o,r,i,s)},this.timeouts=[],this._registerTimeout=function(e){this.timeouts.push(e)},this._clearTimeouts=function(){for(var e=0,t=this.timeouts.length;t>e;e++)clearTimeout(this.timeouts[e])},this.version=Handsontable.version,Handsontable.hooks.run(m,"construct")};var Q=function(){};Q.prototype={data:void 0,dataSchema:void 0,width:void 0,height:void 0,startRows:5,startCols:5,rowHeaders:null,colHeaders:null,colWidths:void 0,rowHeights:void 0,columns:void 0,cells:void 0,cell:[],comments:!1,customBorders:!1,minRows:0,minCols:0,maxRows:1/0,maxCols:1/0,minSpareRows:0,minSpareCols:0,allowInsertRow:!0,allowInsertColumn:!0,allowRemoveRow:!0,allowRemoveColumn:!0,multiSelect:!0,fillHandle:!0,fixedRowsTop:0,fixedRowsBottom:0,fixedColumnsLeft:0,outsideClickDeselects:!0,enterBeginsEditing:!0,enterMoves:{row:1,col:0},tabMoves:{row:0,col:1},autoWrapRow:!1,autoWrapCol:!1,copyRowsLimit:1e3,copyColsLimit:1e3,pasteMode:"overwrite",persistentState:!1,currentRowClassName:void 0,currentColClassName:void 0,className:void 0,tableClassName:void 0,stretchH:"none",isEmptyRow:function(e){var t,n,o,r;for(t=0,n=this.countCols();n>t;t++)if(o=this.getDataAtCell(e,t),""!==o&&null!==o&&"undefined"!=typeof o)return"object"==typeof o?(r=this.getCellMeta(e,t),N(this.getSchema()[r.prop],o)):!1;return!0},isEmptyCol:function(e){var t,n,o;for(t=0,n=this.countRows();n>t;t++)if(o=this.getDataAtCell(t,e),""!==o&&null!==o&&"undefined"!=typeof o)return!1;return!0},observeDOMVisibility:!0,allowInvalid:!0,invalidCellClassName:"htInvalid",placeholder:!1,placeholderCellClassName:"htPlaceholder",readOnlyCellClassName:"htDimmed",renderer:void 0,commentedCellClassName:"htCommentCell",fragmentSelection:!1,readOnly:!1,skipColumnOnPaste:!1,search:!1,type:"text",copyable:!0,editor:void 0,autoComplete:void 0,visibleRows:10,trimDropdown:!0,debug:!1,wordWrap:!0,noWordWrapClassName:"htNoWrap",contextMenu:void 0,contextMenuCopyPaste:void 0,copyPaste:void 0,undo:void 0,columnSorting:void 0,manualColumnMove:void 0,manualColumnResize:void 0,manualRowMove:void 0,manualRowResize:void 0,mergeCells:!1,viewportRowRenderingOffset:"auto",viewportColumnRenderingOffset:"auto",validator:void 0,disableVisualSelection:!1,sortIndicator:!1,manualColumnFreeze:void 0,trimWhitespace:!0,settings:void 0,source:void 0,title:void 0,checkedTemplate:void 0,uncheckedTemplate:void 0,label:void 0,format:void 0,language:void 0,selectOptions:void 0,autoColumnSize:void 0,autoRowSize:void 0,dateFormat:void 0,correctFormat:!1,defaultDate:void 0,strict:void 0,renderAllRows:void 0},Handsontable.DefaultSettings=Q},{"3rdparty/walkontable/src/calculator/viewportColumns":3,"3rdparty/walkontable/src/cell/coords":5,"3rdparty/walkontable/src/cell/range":6,"3rdparty/walkontable/src/selection":18,dataMap:26,dataSource:27,editorManager:28,eventManager:41,"helpers/array":42,"helpers/data":44,"helpers/dom/element":45,"helpers/number":49,"helpers/object":50,"helpers/setting":51,"helpers/string":52,numeral:"numeral",plugins:57,renderers:88,tableView:97}],26:[function(e,t,n){"use strict";function o(e,t,n){this.instance=e,this.priv=t,this.GridSettings=n,this.dataSource=this.instance.getSettings().data,this.dataSource[0]?this.duckSchema=this.recursiveDuckSchema(this.dataSource[0]):this.duckSchema={},this.createMap()}Object.defineProperties(n,{DataMap:{get:function(){return o}},__esModule:{value:!0}});var r,i,s,l,a,u,c,d=(r=e("SheetClip"),r&&r.__esModule&&r||{"default":r})["default"],h=(i=e("helpers/data"),i&&i.__esModule&&i||{"default":i}).cellMethodLookupFactory,f=(s=e("helpers/setting"),s&&s.__esModule&&s||{"default":s}).columnFactory,g=(l=e("helpers/object"),l&&l.__esModule&&l||{"default":l}),p=g.duckSchema,m=g.deepExtend,w=(a=e("helpers/array"),a&&a.__esModule&&a||{"default":a}),v=w.extendArray,b=w.to2dArray,C=(u=e("helpers/number"),u&&u.__esModule&&u||{"default":u}).rangeEach,y=(c=e("multiMap"),c&&c.__esModule&&c||{"default":c}).MultiMap;o.prototype.DESTINATION_RENDERER=1,o.prototype.DESTINATION_CLIPBOARD_GENERATOR=2,o.prototype.recursiveDuckSchema=function(e){return p(e)},o.prototype.recursiveDuckColumns=function(e,t,n){var o,r;if("undefined"==typeof t&&(t=0,n=""),"object"==typeof e&&!Array.isArray(e))for(r in e)e.hasOwnProperty(r)&&(null===e[r]?(o=n+r,this.colToPropCache.push(o),this.propToColCache.set(o,t),t++):t=this.recursiveDuckColumns(e[r],t,r+"."));return t},o.prototype.createMap=function(){var e,t,n=this.getSchema();if("undefined"==typeof n)throw new Error("trying to create `columns` definition but you didnt' provide `schema` nor `data`");this.colToPropCache=[],this.propToColCache=new y;var o=this.instance.getSettings().columns;if(o)for(e=0,t=o.length;t>e;e++)"undefined"!=typeof o[e].data&&(this.colToPropCache[e]=o[e].data,this.propToColCache.set(o[e].data,e));else this.recursiveDuckColumns(n)},o.prototype.colToProp=function(e){return e=Handsontable.hooks.run(this.instance,"modifyCol",e),this.colToPropCache&&"undefined"!=typeof this.colToPropCache[e]?this.colToPropCache[e]:e},o.prototype.propToCol=function(e){var t;return t="undefined"==typeof this.propToColCache.get(e)?e:this.propToColCache.get(e),t=Handsontable.hooks.run(this.instance,"modifyCol",t)},o.prototype.getSchema=function(){var e=this.instance.getSettings().dataSchema;return e?"function"==typeof e?e():e:this.duckSchema},o.prototype.createRow=function(e,t,n){var o,r,i=this.instance.countCols(),s=0;t||(t=1),("number"!=typeof e||e>=this.instance.countSourceRows())&&(e=this.instance.countSourceRows()),r=e;for(var l=this.instance.getSettings().maxRows;t>s&&this.instance.countSourceRows()a;a++)o.push(null)}else"function"===this.instance.dataType?o=this.instance.getSettings().dataSchema(e):(o={}, +m(o,this.getSchema()));e===this.instance.countSourceRows()?this.dataSource.push(o):this.dataSource.splice(e,0,o),s++,r++}return Handsontable.hooks.run(this.instance,"afterCreateRow",e,s,n),this.instance.forceFullRender=!0,s},o.prototype.createCol=function(e,t,n){if(!this.instance.isColumnModificationAllowed())throw new Error("Cannot create new column. When data source in an object, you can only have as much columns as defined in first data row, data schema or in the 'columns' setting.If you want to be able to add new columns, you have to use array datasource.");var o,r,i=this.instance.countSourceRows(),s=this.dataSource,l=0;t||(t=1),r=e;for(var a=this.instance.getSettings().maxCols;t>l&&this.instance.countCols()=this.instance.countCols()){for(var u=0;i>u;u++)"undefined"==typeof s[u]&&(s[u]=[]),s[u].push(null);this.priv.columnSettings.push(o)}else{for(var u=0;i>u;u++)s[u].splice(r,0,null);this.priv.columnSettings.splice(r,0,o)}l++,r++}return Handsontable.hooks.run(this.instance,"afterCreateCol",e,l,n),this.instance.forceFullRender=!0,l},o.prototype.removeRow=function(e,t){t||(t=1),"number"!=typeof e&&(e=-t),e=(this.instance.countSourceRows()+e)%this.instance.countSourceRows();var n=this.physicalRowsToLogical(e,t),o=Handsontable.hooks.run(this.instance,"beforeRemoveRow",e,t,n);if(o!==!1){var r=this.dataSource,i=r.filter(function(e,t){return-1==n.indexOf(t)});r.length=0,Array.prototype.push.apply(r,i),Handsontable.hooks.run(this.instance,"afterRemoveRow",e,t,n),this.instance.forceFullRender=!0}},o.prototype.removeCol=function(e,t){if("object"===this.instance.dataType||this.instance.getSettings().columns)throw new Error("cannot remove column with object data source or columns option specified");t||(t=1),"number"!=typeof e&&(e=-t),e=(this.instance.countCols()+e)%this.instance.countCols();var n=Handsontable.hooks.run(this.instance,"beforeRemoveCol",e,t);if(n!==!1){for(var o=this.dataSource,r=0,i=this.instance.countSourceRows();i>r;r++)o[r].splice(e,t);this.priv.columnSettings.splice(e,t),Handsontable.hooks.run(this.instance,"afterRemoveCol",e,t),this.instance.forceFullRender=!0}},o.prototype.spliceCol=function(e,t,n){var o=4<=arguments.length?[].slice.call(arguments,3):[],r=this.instance.getDataAtCol(e),i=r.slice(t,t+n),s=r.slice(t+n);v(o,s);for(var l=0;n>l;)o.push(null),l++;return b(o),this.instance.populateFromArray(t,e,o,null,null,"spliceCol"),i},o.prototype.spliceRow=function(e,t,n){var o=4<=arguments.length?[].slice.call(arguments,3):[],r=this.instance.getSourceDataAtRow(e),i=r.slice(t,t+n),s=r.slice(t+n);v(o,s);for(var l=0;n>l;)o.push(null),l++;return this.instance.populateFromArray(e,t,[o],null,null,"spliceRow"),i},o.prototype.get=function(e,t){if(e=Handsontable.hooks.run(this.instance,"modifyRow",e),"string"==typeof t&&t.indexOf(".")>-1){var n=t.split("."),o=this.dataSource[e];if(!o)return null;for(var r=0,i=n.length;i>r;r++)if(o=o[n[r]],"undefined"==typeof o)return null;return o}return"function"==typeof t?t(this.dataSource.slice(e,e+1)[0]):this.dataSource[e]&&this.dataSource[e].hasOwnProperty&&this.dataSource[e].hasOwnProperty(t)?this.dataSource[e][t]:null};var R=h("copyable",!1);o.prototype.getCopyable=function(e,t){return R.call(this.instance,e,this.propToCol(t))?this.get(e,t):""},o.prototype.set=function(e,t,n,o){if(e=Handsontable.hooks.run(this.instance,"modifyRow",e,o||"datamapGet"),"string"==typeof t&&t.indexOf(".")>-1){for(var r=t.split("."),i=this.dataSource[e],s=0,l=r.length-1;l>s;s++)"undefined"==typeof i[r[s]]&&(i[r[s]]={}),i=i[r[s]];i[r[s]]=n}else"function"==typeof t?t(this.dataSource.slice(e,e+1)[0],n):this.dataSource[e][t]=n},o.prototype.physicalRowsToLogical=function(e,t){for(var n,o=this.instance.countSourceRows(),r=(o+e)%o,i=[],s=t;o>r&&s;)n=Handsontable.hooks.run(this.instance,"modifyRow",r),i.push(n),s--,r++;return i},o.prototype.clear=function(){for(var e=0;e=o;o++){l=[];var c=Handsontable.hooks.run(this.instance,"modifyRow",o);for(i=Math.min(e.col,t.col);s>=i;i++){if(null===c)break;l.push(u.call(this,o,this.colToProp(i)))}null!==c&&a.push(l)}return a},o.prototype.getText=function(e,t){return d.stringify(this.getRange(e,t,this.DESTINATION_RENDERER))},o.prototype.getCopyableText=function(e,t){return d.stringify(this.getRange(e,t,this.DESTINATION_CLIPBOARD_GENERATOR))},Handsontable.DataMap=o},{SheetClip:"SheetClip","helpers/array":42,"helpers/data":44,"helpers/number":49,"helpers/object":50,"helpers/setting":51,multiMap:55}],27:[function(e,t,n){"use strict";Object.defineProperties(n,{DataSource:{get:function(){return f}},__esModule:{value:!0}});var o,r,i,s,l,a=((o=e("helpers/data"),o&&o.__esModule&&o||{"default":o}).cellMethodLookupFactory,(r=e("helpers/setting"),r&&r.__esModule&&r||{"default":r}).columnFactory,i=e("helpers/object"),i&&i.__esModule&&i||{"default":i}),u=(a.duckSchema,a.deepExtend,a.getProperty),c=(s=e("helpers/array"),s&&s.__esModule&&s||{"default":s}),d=(c.extendArray,c.arrayEach),h=(l=e("helpers/number"),l&&l.__esModule&&l||{"default":l}).rangeEach,f=function(e,t){this.hot=e,this.data=t,this.dataType="array",this.colToProp=function(){},this.propToCol=function(){}};$traceurRuntime.createClass(f,{getData:function(){return this.data},getAtColumn:function(e){var t=this,n=[];return d(this.data,function(o){var r=t.colToProp(e);o="string"==typeof r?u(o,r):o[r],n.push(o)}),n},getAtRow:function(e){return this.data[e]},getAtCell:function(e,t){return this.data[e][this.colToProp(t)]},getByRange:function(e,t){var n=this,o=Math.min(e.row,t.row),r=Math.min(e.col,t.col),i=Math.max(e.row,t.row),s=Math.max(e.col,t.col),l=[];return h(o,i,function(e){var t,o=n.getAtRow(e);"array"===n.dataType?t=o.slice(r,s):"object"===n.dataType&&(t={},h(r,s,function(e){var r=n.colToProp(e);t[r]=o[r]})),l.push(t)}),l},destroy:function(){this.data=null,this.hot=null}},{})},{"helpers/array":42,"helpers/data":44,"helpers/number":49,"helpers/object":50,"helpers/setting":51}],28:[function(e,t,n){"use strict";function o(e,t,n){function o(e){var o="function"==typeof t.settings.enterMoves?t.settings.enterMoves(event):t.settings.enterMoves;e?n.transformStart(-o.row,-o.col):n.transformStart(o.row,o.col,!0)}function r(e){e?n.transformEnd(-1,0):n.transformStart(-1,0)}function i(e){e?n.transformEnd(1,0):n.transformStart(1,0)}function s(e){e?n.transformEnd(0,1):n.transformStart(0,1)}function l(e){e?n.transformEnd(0,-1):n.transformStart(0,-1)}function a(a){var c,g;if(e.isListening()&&(Handsontable.hooks.run(e,"beforeKeyDown",a),!y&&!w(a)&&(t.lastKeyCode=a.keyCode,n.isSelected()))){if(c=(a.ctrlKey||a.metaKey)&&!a.altKey,b&&!b.isWaiting()&&!(h(a.keyCode)||f(a.keyCode)||c||C.isEditorOpened()))return void C.openEditor("",a);switch(g=a.shiftKey?n.setRangeEnd:n.setRangeStart,a.keyCode){case d.A:!C.isEditorOpened()&&c&&(n.selectAll(),a.preventDefault(),p(a));break;case d.ARROW_UP:C.isEditorOpened()&&!b.isWaiting()&&C.closeEditorAndSaveChanges(c),r(a.shiftKey),a.preventDefault(),p(a);break;case d.ARROW_DOWN:C.isEditorOpened()&&!b.isWaiting()&&C.closeEditorAndSaveChanges(c),i(a.shiftKey),a.preventDefault(),p(a);break;case d.ARROW_RIGHT:C.isEditorOpened()&&!b.isWaiting()&&C.closeEditorAndSaveChanges(c),s(a.shiftKey),a.preventDefault(),p(a);break;case d.ARROW_LEFT:C.isEditorOpened()&&!b.isWaiting()&&C.closeEditorAndSaveChanges(c),l(a.shiftKey),a.preventDefault(),p(a);break;case d.TAB:var v="function"==typeof t.settings.tabMoves?t.settings.tabMoves(a):t.settings.tabMoves;a.shiftKey?n.transformStart(-v.row,-v.col):n.transformStart(v.row,v.col,!0),a.preventDefault(),p(a);break;case d.BACKSPACE:case d.DELETE:n.empty(a),C.prepareEditor(),a.preventDefault();break;case d.F2:C.openEditor(null,a),b&&b.enableFullEditMode(),a.preventDefault();break;case d.ENTER:C.isEditorOpened()?(b&&b.state!==Handsontable.EditorState.WAITING&&C.closeEditorAndSaveChanges(c),o(a.shiftKey)):e.getSettings().enterBeginsEditing?(C.openEditor(null,a),b&&b.enableFullEditMode()):o(a.shiftKey),a.preventDefault(),m(a);break;case d.ESCAPE:C.isEditorOpened()&&C.closeEditorAndRestoreOriginalValue(c),a.preventDefault();break;case d.HOME:g(a.ctrlKey||a.metaKey?new u(0,t.selRange.from.col):new u(t.selRange.from.row,0)),a.preventDefault(),p(a);break;case d.END:g(a.ctrlKey||a.metaKey?new u(e.countRows()-1,t.selRange.from.col):new u(t.selRange.from.row,e.countCols()-1)),a.preventDefault(),p(a);break;case d.PAGE_UP:n.transformStart(-e.countVisibleRows(),0),a.preventDefault(),p(a);break;case d.PAGE_DOWN:n.transformStart(e.countVisibleRows(),0),a.preventDefault(),p(a)}}}function c(){function t(e,t,n){"TD"==n.nodeName&&(C.openEditor(),b&&b.enableFullEditMode())}e.addHook("afterDocumentKeyDown",a),g.addEventListener(document.documentElement,"keydown",function(t){e.runHooks("afterDocumentKeyDown",t)}),e.view.wt.update("onCellDblClick",t),e.addHook("afterDestroy",function(){y=!0})}var g,b,C=this,y=!1;g=v(e),this.destroyEditor=function(e){this.closeEditor(e)},this.getActiveEditor=function(){return b},this.prepareEditor=function(){var n,o,r,i,s,l,a;return b&&b.isWaiting()?void this.closeEditor(!1,!1,function(e){e&&C.prepareEditor()}):(n=t.selRange.highlight.row,o=t.selRange.highlight.col,r=e.colToProp(o),i=e.getCell(n,o),s=e.getDataAtCell(n,o),l=e.getCellMeta(n,o),a=e.getCellEditor(l),void(a?(b=Handsontable.editors.getEditor(a,e),b.prepare(n,o,r,i,s,l)):b=void 0))},this.isEditorOpened=function(){return b&&b.isOpened()},this.openEditor=function(e,t){b&&!b.cellProperties.readOnly?b.beginEditing(e,t):b&&b.cellProperties.readOnly&&t&&t.keyCode===d.ENTER&&o()},this.closeEditor=function(e,t,n){b?b.finishEditing(e,t,n):n&&n(!1)},this.closeEditorAndSaveChanges=function(e){return this.closeEditor(!1,e)},this.closeEditorAndRestoreOriginalValue=function(e){return this.closeEditor(!0,e)},c()}Object.defineProperties(n,{EditorManager:{get:function(){return o}},__esModule:{value:!0}});var r,i,s,l,a,u=(r=e("3rdparty/walkontable/src/cell/coords"),r&&r.__esModule&&r||{"default":r}).WalkontableCellCoords,c=(i=e("helpers/unicode"),i&&i.__esModule&&i||{"default":i}),d=c.KEY_CODES,h=c.isMetaKey,f=c.isCtrlKey,g=(s=e("helpers/dom/event"),s&&s.__esModule&&s||{"default":s}),p=g.stopPropagation,m=g.stopImmediatePropagation,w=g.isImmediatePropagationStopped,v=((l=e("editors"),l&&l.__esModule&&l||{"default":l}).getEditor,(a=e("eventManager"),a&&a.__esModule&&a||{"default":a}).eventManager);Handsontable.EditorManager=o},{"3rdparty/walkontable/src/cell/coords":5,editors:29,eventManager:41,"helpers/dom/event":46,"helpers/unicode":53}],29:[function(e,t,n){"use strict";function o(e){var t,n;n={},t=e,this.getConstructor=function(){return e},this.getInstance=function(e){return e.guid in n||(n[e.guid]=new t(e)),n[e.guid]}}function r(e,t){var n=new o(t);"string"==typeof e&&(c[e]=n,Handsontable.editors[u(e)+"Editor"]=t),d.set(t,n)}function i(e,t){var n;if("function"==typeof e)d.get(e)||r(null,e),n=d.get(e);else{if("string"!=typeof e)throw Error('Only strings and functions can be passed as "editor" parameter ');n=c[e]}if(!n)throw Error('No editor registered under name "'+e+'"');return n.getInstance(t)}function s(e){var t;if("string"!=typeof e)throw Error('Only strings and functions can be passed as "editor" parameter ');if(t=c[e],!t)throw Error('No editor registered under name "'+e+'"');return t.getConstructor()}function l(e){return c[e]?!0:!1}Object.defineProperties(n,{registerEditor:{get:function(){return r}},getEditor:{get:function(){return i}},hasEditor:{get:function(){return l}},getEditorConstructor:{get:function(){return s}},__esModule:{value:!0}});var a,u=(a=e("helpers/string"),a&&a.__esModule&&a||{"default":a}).toUpperCaseFirst,c={},d=new WeakMap;Handsontable.editors=Handsontable.editors||{},Handsontable.editors.registerEditor=r,Handsontable.editors.getEditor=i},{"helpers/string":52}],30:[function(e,t,n){"use strict";function o(e){this.instance=e,this.state=Handsontable.EditorState.VIRGIN,this._opened=!1,this._fullEditMode=!1,this._closeCallback=null,this.init()}Object.defineProperties(n,{BaseEditor:{get:function(){return o}},__esModule:{value:!0}});var r,i,s=(r=e("helpers/mixed"),r&&r.__esModule&&r||{"default":r}).stringify,l=(i=e("3rdparty/walkontable/src/cell/coords"),i&&i.__esModule&&i||{"default":i}).WalkontableCellCoords;Handsontable.editors=Handsontable.editors||{},Handsontable.editors.BaseEditor=o,Handsontable.EditorState={VIRGIN:"STATE_VIRGIN",EDITING:"STATE_EDITING",WAITING:"STATE_WAITING",FINISHED:"STATE_FINISHED"},o.prototype._fireCallbacks=function(e){this._closeCallback&&(this._closeCallback(e),this._closeCallback=null)},o.prototype.init=function(){},o.prototype.getValue=function(){throw Error("Editor getValue() method unimplemented")},o.prototype.setValue=function(e){throw Error("Editor setValue() method unimplemented")},o.prototype.open=function(){throw Error("Editor open() method unimplemented")},o.prototype.close=function(){throw Error("Editor close() method unimplemented")},o.prototype.prepare=function(e,t,n,o,r,i){this.TD=o,this.row=e,this.col=t,this.prop=n,this.originalValue=r,this.cellProperties=i,this.instance.view.isMouseDown()&&document.activeElement&&document.activeElement!==document.body?document.activeElement.blur():document.activeElement||document.body.focus(),this.state=Handsontable.EditorState.VIRGIN},o.prototype.extend=function(){function e(){n.apply(this,arguments)}function t(e,t){function n(){}return n.prototype=t.prototype,e.prototype=new n,e.prototype.constructor=e,e}var n=this.constructor;return t(e,n)},o.prototype.saveValue=function(e,t){var n,o;t?(n=this.instance.getSelected(),n[0]>n[2]&&(o=n[0],n[0]=n[2],n[2]=o),n[1]>n[3]&&(o=n[1],n[1]=n[3],n[3]=o),this.instance.populateFromArray(n[0],n[1],e,n[2],n[3],"edit")):this.instance.populateFromArray(this.row,this.col,e,null,null,"edit")},o.prototype.beginEditing=function(e,t){this.state==Handsontable.EditorState.VIRGIN&&(this.instance.view.scrollViewport(new l(this.row,this.col)),this.instance.view.render(),this.state=Handsontable.EditorState.EDITING,e="string"==typeof e?e:this.originalValue,this.setValue(s(e)),this.open(t),this._opened=!0,this.focus(),this.instance.view.render())},o.prototype.finishEditing=function(e,t,n){var o,r=this;if(n){var i=this._closeCallback;this._closeCallback=function(e){i&&i(e),n(e)}}if(!this.isWaiting()){if(this.state==Handsontable.EditorState.VIRGIN)return void this.instance._registerTimeout(setTimeout(function(){r._fireCallbacks(!0)},0));if(this.state==Handsontable.EditorState.EDITING){if(e)return this.cancelChanges(),void this.instance.view.render();o=this.instance.getSettings().trimWhitespace?[["string"==typeof this.getValue()?String.prototype.trim.call(this.getValue()||""):this.getValue()]]:[[this.getValue()]],this.state=Handsontable.EditorState.WAITING,this.saveValue(o,t),this.instance.getCellValidator(this.cellProperties)?this.instance.addHookOnce("postAfterValidate",function(e){r.state=Handsontable.EditorState.FINISHED,r.discardEditor(e)}):(this.state=Handsontable.EditorState.FINISHED,this.discardEditor(!0))}}},o.prototype.cancelChanges=function(){this.state=Handsontable.EditorState.FINISHED,this.discardEditor()},o.prototype.discardEditor=function(e){this.state===Handsontable.EditorState.FINISHED&&(e===!1&&this.cellProperties.allowInvalid!==!0?(this.instance.selectCell(this.row,this.col),this.focus(),this.state=Handsontable.EditorState.EDITING,this._fireCallbacks(!1)):(this.close(),this._opened=!1,this._fullEditMode=!1,this.state=Handsontable.EditorState.VIRGIN,this._fireCallbacks(!0)))},o.prototype.enableFullEditMode=function(){this._fullEditMode=!0},o.prototype.isInFullEditMode=function(){return this._fullEditMode},o.prototype.isOpened=function(){return this._opened},o.prototype.isWaiting=function(){return this.state===Handsontable.EditorState.WAITING},o.prototype.checkEditorSection=function(){var e=this.instance.countRows(),t="";return this.row=e-this.instance.getSettings().fixedRowsBottom?t=this.col"+l+"")))},autoColumnSize:!0,modifyColWidth:function(e,t){var o=this.getPlugin("autoColumnSize").widths;return o[t]&&(e=o[t]),n?e:e+15}}),this.htEditor.view.wt.wtTable.holder.parentNode.style["padding-right"]=v()+2+"px",O&&(O=!1),t.instance._registerTimeout(setTimeout(function(){t.queryChoices(t.TEXTAREA.value)},0))},T.prototype.close=function(){S.prototype.close.apply(this,arguments)},T.prototype.queryChoices=function(e){if(this.query=e,"function"==typeof this.cellProperties.source){var t=this;this.cellProperties.source(e,function(e){t.updateChoicesList(e)})}else if(Array.isArray(this.cellProperties.source)){var n;if(e&&this.cellProperties.filter!==!1){var o=this.cellProperties.filteringCaseSensitive===!0,r=e.toLowerCase();n=this.cellProperties.source.filter(function(t){return o?-1!=t.indexOf(e):-1!=t.toLowerCase().indexOf(r)})}else n=this.cellProperties.source;this.updateChoicesList(n)}else this.updateChoicesList([])},T.prototype.updateChoicesList=function(e){var t,n=w(this.TEXTAREA),o=b(this.TEXTAREA),r=T.sortByRelevance(this.getValue(),e,this.cellProperties.filteringCaseSensitive);if(0==this.cellProperties.filter)t=r[0];else{for(var i=[],s=0,l=r.length;l>s;s++)i.push(e[r[s]]);t=0,e=i}this.choices=e,this.htEditor.loadData(g([e])),this.updateDropdownHeight(),this.cellProperties.strict===!0&&this.highlightBestMatchingChoice(t),this.instance.listen(),this.TEXTAREA.focus(),y(this.TEXTAREA,n,n==o?void 0:o)},T.prototype.updateDropdownHeight=function(){var e=this.htEditor.getColWidth(0)+v()+2,t=void 0===this.cellProperties.trimDropdown?!0:this.cellProperties.trimDropdown;this.htEditor.updateSettings({height:this.getDropdownHeight(),width:t?void 0:e}),this.htEditor.view.wt.wtTable.alignOverlaysWithTrimmingContainer()},T.prototype.finishEditing=function(e){e||this.instance.removeHook("beforeKeyDown",o),S.prototype.finishEditing.apply(this,arguments)},T.prototype.highlightBestMatchingChoice=function(e){"number"==typeof e?this.htEditor.selectCell(e,0):this.htEditor.deselectCell()},T.sortByRelevance=function(e,t,n){var o,r,i,s,l,a=[],u=e.length,c=[];if(0===u){for(s=0,l=t.length;l>s;s++)c.push(s);return c}for(s=0,l=t.length;l>s;s++)o=f(t[s]),r=n?o.indexOf(e):o.toLowerCase().indexOf(e.toLowerCase()),-1!=r&&(i=o.length-r-u,a.push({baseIndex:s,index:r,charsLeft:i,value:o}));for(a.sort(function(e,t){return-1===t.index?-1:-1===e.index?1:e.indext.charsLeft?1:0:void 0}),s=0,l=a.length;l>s;s++)c.push(a[s].baseIndex);return c},T.prototype.getDropdownHeight=function(){var e=this.htEditor.getInstance().getRowHeight(0)||23,t=this.cellProperties.visibleRows;return this.choices.length>=t?t*e:this.choices.length*e+8},T.prototype.allowKeyEventPropagation=function(e){var t={row:this.htEditor.getSelectedRange()?this.htEditor.getSelectedRange().from.row:-1},n=!1;return e===d.ARROW_DOWN&&t.row-1&&(n=!0),n},E("autocomplete",T)},{editors:29,handsontableEditor:35,"helpers/array":42,"helpers/dom/element":45,"helpers/mixed":48,"helpers/unicode":53}],32:[function(e,t,n){"use strict";Object.defineProperties(n,{CheckboxEditor:{get:function(){return u}},__esModule:{value:!0}});var o,r,i,s=(o=e("editors"),o&&o.__esModule&&o||{"default":o}).registerEditor,l=(r=e("_baseEditor"),r&&r.__esModule&&r||{"default":r}).BaseEditor,a=(i=e("helpers/dom/element"),i&&i.__esModule&&i||{"default":i}).hasClass,u=function(){$traceurRuntime.superConstructor(c).apply(this,arguments)},c=u;$traceurRuntime.createClass(u,{beginEditing:function(){var e=this.TD.querySelector('input[type="checkbox"]');a(e,"htBadValue")||e.click()},finishEditing:function(){},init:function(){},open:function(){},close:function(){},getValue:function(){},setValue:function(){},focus:function(){}},{},l),s("checkbox",u)},{_baseEditor:30,editors:29,"helpers/dom/element":45}],33:[function(e,t,n){"use strict";Object.defineProperties(n,{DateEditor:{get:function(){return S}},__esModule:{value:!0}});var o,r,i,s,l,a,u,c,d,h=(o=e("helpers/dom/element"),o&&o.__esModule&&o||{"default":o}),f=h.addClass,g=h.outerHeight,p=(r=e("helpers/object"),r&&r.__esModule&&r||{"default":r}).deepExtend,m=(i=e("eventManager"),i&&i.__esModule&&i||{"default":i}).EventManager,w=(s=e("editors"),s&&s.__esModule&&s||{"default":s}),v=(w.getEditor,w.registerEditor),b=(l=e("helpers/unicode"),l&&l.__esModule&&l||{"default":l}).isMetaKey,C=(a=e("helpers/dom/event"),a&&a.__esModule&&a||{"default":a}).stopPropagation,y=(u=e("textEditor"),u&&u.__esModule&&u||{"default":u}).TextEditor,R=(c=e("moment"),c&&c.__esModule&&c||{"default":c})["default"],E=(d=e("pikaday"),d&&d.__esModule&&d||{"default":d})["default"];Handsontable.editors=Handsontable.editors||{},Handsontable.editors.DateEditor=S;var S=function(e){this.$datePicker=null,this.datePicker=null,this.datePickerStyle=null,this.defaultDateFormat="DD/MM/YYYY",this.isCellEdited=!1,this.parentDestroyed=!1,$traceurRuntime.superConstructor(T).call(this,e)},T=S;$traceurRuntime.createClass(S,{init:function(){var e=this;if("function"!=typeof R)throw new Error("You need to include moment.js to your project.");if("function"!=typeof E)throw new Error("You need to include Pikaday to your project.");$traceurRuntime.superGet(this,T.prototype,"init").call(this),this.instance.addHook("afterDestroy",function(){e.parentDestroyed=!0,e.destroyElements()})},createElements:function(){$traceurRuntime.superGet(this,T.prototype,"createElements").call(this),this.datePicker=document.createElement("DIV"),this.datePickerStyle=this.datePicker.style,this.datePickerStyle.position="absolute",this.datePickerStyle.top=0,this.datePickerStyle.left=0,this.datePickerStyle.zIndex=9999,f(this.datePicker,"htDatepickerHolder"),document.body.appendChild(this.datePicker),this.$datePicker=new E(this.getDatePickerConfig());var e=new m(this);e.addEventListener(this.datePicker,"mousedown",function(e){return C(e)}),this.hideDatepicker()},destroyElements:function(){this.$datePicker.destroy()},prepare:function(e,t,n,o,r,i){this._opened=!1,$traceurRuntime.superGet(this,T.prototype,"prepare").call(this,e,t,n,o,r,i)},open:function(){var e=void 0!==arguments[0]?arguments[0]:null;$traceurRuntime.superGet(this,T.prototype,"open").call(this),this.showDatepicker(e)},close:function(){var e=this;this._opened=!1,this.instance._registerTimeout(setTimeout(function(){e.instance.selection.refreshBorders()},0)),$traceurRuntime.superGet(this,T.prototype,"close").call(this)},finishEditing:function(){var e=void 0!==arguments[0]?arguments[0]:!1,t=void 0!==arguments[1]?arguments[1]:!1;if(e){var n=this.originalValue;void 0!==n&&this.setValue(n)}this.hideDatepicker(),$traceurRuntime.superGet(this,T.prototype,"finishEditing").call(this,e,t)},showDatepicker:function(e){this.$datePicker.config(this.getDatePickerConfig());var t,n=this.TD.getBoundingClientRect(),o=this.cellProperties.dateFormat||this.defaultDateFormat,r=this.$datePicker.config(),i=this.instance.view.isMouseDown(),s=e?b(e.keyCode):!1;this.datePickerStyle.top=window.pageYOffset+n.top+g(this.TD)+"px",this.datePickerStyle.left=window.pageXOffset+n.left+"px",this.$datePicker._onInputFocus=function(){},r.format=o,this.originalValue?(t=this.originalValue,R(t,o,!0).isValid()&&this.$datePicker.setMoment(R(t,o),!0),s||i||this.setValue("")):this.cellProperties.defaultDate?(t=this.cellProperties.defaultDate,r.defaultDate=t,R(t,o,!0).isValid()&&this.$datePicker.setMoment(R(t,o),!0),s||i||this.setValue("")):this.$datePicker.gotoToday(),this.datePickerStyle.display="block",this.$datePicker.show()},hideDatepicker:function(){this.datePickerStyle.display="none",this.$datePicker.hide()},getDatePickerConfig:function(){var e=this,t=this.TEXTAREA,n={};this.cellProperties&&this.cellProperties.datePickerConfig&&p(n,this.cellProperties.datePickerConfig);var o=n.onSelect,r=n.onClose;return n.field=t,n.trigger=t,n.container=this.datePicker,n.bound=!1,n.format=n.format||this.defaultDateFormat,n.reposition=n.reposition||!1,n.onSelect=function(t){isNaN(t.getTime())||(t=R(t).format(e.cellProperties.dateFormat||e.defaultDateFormat)),e.setValue(t),e.hideDatepicker(),o&&o()},n.onClose=function(){e.parentDestroyed||e.finishEditing(!1),r&&r()},n}},{},y),v("date",S)},{editors:29,eventManager:41,"helpers/dom/element":45,"helpers/dom/event":46,"helpers/object":50,"helpers/unicode":53,moment:void 0,pikaday:void 0,textEditor:40}],34:[function(e,t,n){"use strict";Object.defineProperties(n,{DropdownEditor:{get:function(){return a}},__esModule:{value:!0}});var o,r,i=(o=e("editors"),o&&o.__esModule&&o||{"default":o}),s=(i.getEditor,i.registerEditor),l=(r=e("autocompleteEditor"),r&&r.__esModule&&r||{"default":r}).AutocompleteEditor,a=function(){$traceurRuntime.superConstructor(u).apply(this,arguments)},u=a;$traceurRuntime.createClass(a,{prepare:function(e,t,n,o,r,i){$traceurRuntime.superGet(this,u.prototype,"prepare").call(this,e,t,n,o,r,i),this.cellProperties.filter=!1,this.cellProperties.strict=!0}},{},l),Handsontable.hooks.add("beforeValidate",function(e,t,n,o){var r=this.getCellMeta(t,n);r.editor===Handsontable.editors.DropdownEditor&&void 0===r.strict&&(r.filter=!1,r.strict=!0)}),s("dropdown",a)},{autocompleteEditor:31,editors:29}],35:[function(e,t,n){"use strict";Object.defineProperties(n,{HandsontableEditor:{get:function(){return v}},__esModule:{value:!0}});var o,r,i,s,l,a,u=(o=e("helpers/unicode"),o&&o.__esModule&&o||{"default":o}).KEY_CODES,c=(r=e("helpers/object"),r&&r.__esModule&&r||{"default":r}).extend,d=(i=e("helpers/dom/element"),i&&i.__esModule&&i||{"default":i}).setCaretPosition,h=(s=e("helpers/dom/event"),s&&s.__esModule&&s||{"default":s}),f=h.stopImmediatePropagation,g=h.isImmediatePropagationStopped,p=(l=e("editors"),l&&l.__esModule&&l||{"default":l}),m=(p.getEditor,p.registerEditor),w=(a=e("textEditor"),a&&a.__esModule&&a||{"default":a}).TextEditor,v=w.prototype.extend();v.prototype.createElements=function(){w.prototype.createElements.apply(this,arguments);var e=document.createElement("DIV");e.className="handsontableEditor",this.TEXTAREA_PARENT.appendChild(e),this.htContainer=e,this.assignHooks()},v.prototype.prepare=function(e,t,n,o,r,i){w.prototype.prepare.apply(this,arguments);var s=this,l={startRows:0,startCols:0,minRows:0,minCols:0,className:"listbox",copyPaste:!1,autoColumnSize:!1,autoRowSize:!1,readOnly:!0,fillHandle:!1,afterOnCellMouseDown:function(){var e=this.getValue();void 0!==e&&s.setValue(e),s.instance.destroyEditor()}};this.cellProperties.handsontable&&c(l,i.handsontable),this.htOptions=l};var b=function(e){if(!g(e)){var t,n=this.getActiveEditor(),o=n.htEditor.getInstance();if(e.keyCode==u.ARROW_DOWN)if(o.getSelected()){var r=o.getSelected()[0],i=o.countRows()-1;t=Math.min(i,r+1)}else t=0;else if(e.keyCode==u.ARROW_UP&&o.getSelected()){var r=o.getSelected()[0];t=r-1}void 0!==t&&(0>t?o.deselectCell():o.selectCell(t,0),o.getData().length&&(e.preventDefault(),f(e),n.instance.listen(),n.TEXTAREA.focus()))}};v.prototype.open=function(){this.instance.addHook("beforeKeyDown",b),w.prototype.open.apply(this,arguments),this.htEditor&&this.htEditor.destroy(),this.htEditor=new Handsontable(this.htContainer,this.htOptions),this.cellProperties.strict?(this.htEditor.selectCell(0,0),this.TEXTAREA.style.visibility="hidden"):(this.htEditor.deselectCell(),this.TEXTAREA.style.visibility="visible"),d(this.TEXTAREA,0,this.TEXTAREA.value.length)},v.prototype.close=function(){this.instance.removeHook("beforeKeyDown",b),this.instance.listen(),w.prototype.close.apply(this,arguments)},v.prototype.focus=function(){this.instance.listen(),w.prototype.focus.apply(this,arguments)},v.prototype.beginEditing=function(e){var t=this.instance.getSettings().onBeginEditing;t&&t()===!1||w.prototype.beginEditing.apply(this,arguments)},v.prototype.finishEditing=function(e,t){if(this.htEditor&&this.htEditor.isListening()&&this.instance.listen(),this.htEditor&&this.htEditor.getSelected()){var n=this.htEditor.getInstance().getValue();void 0!==n&&this.setValue(n)}return w.prototype.finishEditing.apply(this,arguments)},v.prototype.assignHooks=function(){var e=this;this.instance.addHook("afterDestroy",function(){e.htEditor&&e.htEditor.destroy()})},m("handsontable",v)},{editors:29,"helpers/dom/element":45,"helpers/dom/event":46,"helpers/object":50,"helpers/unicode":53,textEditor:40}],36:[function(e,t,n){"use strict";Object.defineProperties(n,{MobileTextEditor:{get:function(){return M}},__esModule:{value:!0}});var o,r,i,s,l,a,u=(o=e("helpers/unicode"),o&&o.__esModule&&o||{"default":o}).KEY_CODES,c=(r=e("helpers/dom/event"),r&&r.__esModule&&r||{"default":r}),d=c.stopImmediatePropagation,h=c.isImmediatePropagationStopped,f=(i=e("helpers/dom/element"),i&&i.__esModule&&i||{ +"default":i}),g=f.addClass,p=f.getScrollLeft,m=f.getScrollTop,w=f.hasClass,v=f.isChildOf,b=f.offset,C=f.outerHeight,y=f.outerWidth,R=f.removeClass,E=f.setCaretPosition,S=(s=e("editors"),s&&s.__esModule&&s||{"default":s}),T=(S.getEditor,S.registerEditor),O=(l=e("_baseEditor"),l&&l.__esModule&&l||{"default":l}).BaseEditor,_=(a=e("eventManager"),a&&a.__esModule&&a||{"default":a}).eventManager,M=O.prototype.extend(),H={},k=function(){this.controls={},this.controls.leftButton=document.createElement("DIV"),this.controls.leftButton.className="leftButton",this.controls.rightButton=document.createElement("DIV"),this.controls.rightButton.className="rightButton",this.controls.upButton=document.createElement("DIV"),this.controls.upButton.className="upButton",this.controls.downButton=document.createElement("DIV"),this.controls.downButton.className="downButton";for(var e in this.controls)this.controls.hasOwnProperty(e)&&this.positionControls.appendChild(this.controls[e])};M.prototype.valueChanged=function(){return this.initValue!=this.getValue()},M.prototype.init=function(){var e=this;this.eventManager=_(this.instance),this.createElements(),this.bindEvents(),this.instance.addHook("afterDestroy",function(){e.destroy()})},M.prototype.getValue=function(){return this.TEXTAREA.value},M.prototype.setValue=function(e){this.initValue=e,this.TEXTAREA.value=e},M.prototype.createElements=function(){this.editorContainer=document.createElement("DIV"),this.editorContainer.className="htMobileEditorContainer",this.cellPointer=document.createElement("DIV"),this.cellPointer.className="cellPointer",this.moveHandle=document.createElement("DIV"),this.moveHandle.className="moveHandle",this.inputPane=document.createElement("DIV"),this.inputPane.className="inputs",this.positionControls=document.createElement("DIV"),this.positionControls.className="positionControls",this.TEXTAREA=document.createElement("TEXTAREA"),g(this.TEXTAREA,"handsontableInput"),this.inputPane.appendChild(this.TEXTAREA),this.editorContainer.appendChild(this.cellPointer),this.editorContainer.appendChild(this.moveHandle),this.editorContainer.appendChild(this.inputPane),this.editorContainer.appendChild(this.positionControls),k.call(this),document.body.appendChild(this.editorContainer)},M.prototype.onBeforeKeyDown=function(e){var t=this,n=t.getActiveEditor();if(e.target===n.TEXTAREA&&!h(e))switch(e.keyCode){case u.ENTER:n.close(),e.preventDefault();break;case u.BACKSPACE:d(e)}},M.prototype.open=function(){this.instance.addHook("beforeKeyDown",this.onBeforeKeyDown),g(this.editorContainer,"active"),R(this.cellPointer,"hidden"),this.updateEditorPosition()},M.prototype.focus=function(){this.TEXTAREA.focus(),E(this.TEXTAREA,this.TEXTAREA.value.length)},M.prototype.close=function(){this.TEXTAREA.blur(),this.instance.removeHook("beforeKeyDown",this.onBeforeKeyDown),R(this.editorContainer,"active")},M.prototype.scrollToView=function(){var e=this.instance.getSelectedRange().highlight;this.instance.view.scrollViewport(e)},M.prototype.hideCellPointer=function(){w(this.cellPointer,"hidden")||g(this.cellPointer,"hidden")},M.prototype.updateEditorPosition=function(e,t){if(e&&t)e=parseInt(e,10),t=parseInt(t,10),this.editorContainer.style.top=t+"px",this.editorContainer.style.left=e+"px";else{var n=this.instance.getSelected(),o=this.instance.getCell(n[0],n[1]);if(H.cellPointer||(H.cellPointer={height:C(this.cellPointer),width:y(this.cellPointer)}),H.editorContainer||(H.editorContainer={width:y(this.editorContainer)}),void 0!==o){var r=this.instance.view.wt.wtOverlays.leftOverlay.trimmingContainer==window?0:p(this.instance.view.wt.wtOverlays.leftOverlay.holder),i=this.instance.view.wt.wtOverlays.topOverlay.trimmingContainer==window?0:m(this.instance.view.wt.wtOverlays.topOverlay.holder),s=b(o),l=y(o),a={x:r,y:i};this.editorContainer.style.top=parseInt(s.top+C(o)-a.y+H.cellPointer.height,10)+"px",this.editorContainer.style.left=parseInt(window.innerWidth/2-H.editorContainer.width/2,10)+"px",s.left+l/2>parseInt(this.editorContainer.style.left,10)+H.editorContainer.width?this.editorContainer.style.left=window.innerWidth-H.editorContainer.width+"px":s.left+l/2n;n++)t[e[n]]=e[n];else"object"==typeof e&&(t=e);return t},S.prototype.getValue=function(){return this.select.value},S.prototype.setValue=function(e){this.select.value=e};var T=function(e){var t=this,n=t.getActiveEditor();switch(e.keyCode){case C.ARROW_UP:var o=n.select.selectedIndex-1;o>=0&&(n.select[o].selected=!0),b(e),e.preventDefault();break;case C.ARROW_DOWN:var r=n.select.selectedIndex+1;r<=n.select.length-1&&(n.select[r].selected=!0),b(e),e.preventDefault()}};S.prototype.open=function(){this._opened=!0,this.refreshDimensions(),this.select.style.display="",this.instance.addHook("beforeKeyDown",T)},S.prototype.close=function(){this._opened=!1,this.select.style.display="none",this.instance.removeHook("beforeKeyDown",T)},S.prototype.focus=function(){this.select.focus()},S.prototype.refreshDimensions=function(){if(this.state===Handsontable.EditorState.EDITING){if(this.TD=this.getEditedCell(),!this.TD)return void this.close();var e,t=w(this.TD)+1,n=m(this.TD)+1,o=p(this.TD),r=p(this.instance.rootElement),i=g(this.TD),s=o.top-r.top-1-(i.scrollTop||0),l=o.left-r.left-1-(i.scrollLeft||0),a=this.checkEditorSection(),u=this.instance.getSettings();u.rowHeaders?1:0,u.colHeaders?1:0;switch(a){case"top":e=f(this.instance.view.wt.wtOverlays.topOverlay.clone.wtTable.holder.parentNode);break;case"left":e=f(this.instance.view.wt.wtOverlays.leftOverlay.clone.wtTable.holder.parentNode);break;case"top-left-corner":e=f(this.instance.view.wt.wtOverlays.topLeftCornerOverlay.clone.wtTable.holder.parentNode);break;case"bottom-left-corner":e=f(this.instance.view.wt.wtOverlays.bottomLeftCornerOverlay.clone.wtTable.holder.parentNode);break;case"bottom":e=f(this.instance.view.wt.wtOverlays.bottomOverlay.clone.wtTable.holder.parentNode)}0===this.instance.getSelected()[0]&&(s+=1),0===this.instance.getSelected()[1]&&(l+=1);var c=this.select.style;e&&-1!=e?c[e[0]]=e[1]:v(this.select);var d=h(this.TD);parseInt(d.borderTopWidth,10)>0&&(n-=1),parseInt(d.borderLeftWidth,10)>0&&(t-=1),c.height=n+"px",c.minWidth=t+"px",c.top=s+"px",c.left=l+"px",c.margin="0px"}},S.prototype.getEditedCell=function(){var e,t=this.checkEditorSection();switch(t){case"top":e=this.instance.view.wt.wtOverlays.topOverlay.clone.wtTable.getCell({row:this.row,col:this.col}),this.select.style.zIndex=101;break;case"corner":e=this.instance.view.wt.wtOverlays.topLeftCornerOverlay.clone.wtTable.getCell({row:this.row,col:this.col}),this.select.style.zIndex=103;break;case"left":e=this.instance.view.wt.wtOverlays.leftOverlay.clone.wtTable.getCell({row:this.row,col:this.col}),this.select.style.zIndex=102;break;default:e=this.instance.getCell(this.row,this.col),this.select.style.zIndex=""}return-1!=e&&-2!=e?e:void 0},R("select",S)},{_baseEditor:30,editors:29,"helpers/dom/element":45,"helpers/dom/event":46,"helpers/unicode":53}],40:[function(e,t,n){"use strict";Object.defineProperties(n,{TextEditor:{get:function(){return k}},__esModule:{value:!0}});var o,r,i,s,l,a,u,c=(o=e("helpers/dom/element"),o&&o.__esModule&&o||{"default":o}),d=c.addClass,h=c.getCaretPosition,f=c.getComputedStyle,g=c.getCssTransform,p=c.getScrollableElement,m=c.innerWidth,w=c.offset,v=c.resetCssTransform,b=c.setCaretPosition,C=(r=e("autoResize"),r&&r.__esModule&&r||{"default":r})["default"],y=(i=e("_baseEditor"),i&&i.__esModule&&i||{"default":i}).BaseEditor,R=(s=e("eventManager"),s&&s.__esModule&&s||{"default":s}).eventManager,E=(l=e("editors"),l&&l.__esModule&&l||{"default":l}),S=(E.getEditor,E.registerEditor),T=(a=e("helpers/unicode"),a&&a.__esModule&&a||{"default":a}).KEY_CODES,O=(u=e("helpers/dom/event"),u&&u.__esModule&&u||{"default":u}),_=O.stopPropagation,M=O.stopImmediatePropagation,H=O.isImmediatePropagationStopped,k=y.prototype.extend();k.prototype.init=function(){var e=this;this.createElements(),this.eventManager=R(this),this.bindEvents(),this.autoResize=C(),this.instance.addHook("afterDestroy",function(){e.destroy()})},k.prototype.getValue=function(){return this.TEXTAREA.value},k.prototype.setValue=function(e){this.TEXTAREA.value=e};var A=function(e){var t,n=this,o=n.getActiveEditor();if(t=(e.ctrlKey||e.metaKey)&&!e.altKey,e.target===o.TEXTAREA&&!H(e)){if(17===e.keyCode||224===e.keyCode||91===e.keyCode||93===e.keyCode)return void M(e);switch(e.keyCode){case T.ARROW_RIGHT:o.isInFullEditMode()&&(!o.isWaiting()&&!o.allowKeyEventPropagation||!o.isWaiting()&&o.allowKeyEventPropagation&&!o.allowKeyEventPropagation(e.keyCode))&&M(e);break;case T.ARROW_LEFT:o.isInFullEditMode()&&(!o.isWaiting()&&!o.allowKeyEventPropagation||!o.isWaiting()&&o.allowKeyEventPropagation&&!o.allowKeyEventPropagation(e.keyCode))&&M(e);break;case T.ARROW_UP:case T.ARROW_DOWN:o.isInFullEditMode()&&(!o.isWaiting()&&!o.allowKeyEventPropagation||!o.isWaiting()&&o.allowKeyEventPropagation&&!o.allowKeyEventPropagation(e.keyCode))&&M(e);break;case T.ENTER:var r=o.instance.getSelected(),i=!(r[0]===r[2]&&r[1]===r[3]);if(t&&!i||e.altKey){if(o.isOpened()){var s=h(o.TEXTAREA),l=o.getValue(),a=l.slice(0,s)+"\n"+l.slice(s);o.setValue(a),b(o.TEXTAREA,s+1)}else o.beginEditing(o.originalValue+"\n");M(e)}e.preventDefault();break;case T.A:case T.X:case T.C:case T.V:t&&M(e);break;case T.BACKSPACE:case T.DELETE:case T.HOME:case T.END:M(e)}-1===[T.ARROW_UP,T.ARROW_RIGHT,T.ARROW_DOWN,T.ARROW_LEFT].indexOf(e.keyCode)&&o.autoResize.resize(String.fromCharCode(e.keyCode))}};k.prototype.open=function(){this.refreshDimensions(),this.instance.addHook("beforeKeyDown",A)},k.prototype.close=function(e){this.textareaParentStyle.display="none",this.autoResize.unObserve(),document.activeElement===this.TEXTAREA&&this.instance.listen(),this.instance.removeHook("beforeKeyDown",A)},k.prototype.focus=function(){this.TEXTAREA.focus(),b(this.TEXTAREA,this.TEXTAREA.value.length)},k.prototype.createElements=function(){this.TEXTAREA=document.createElement("TEXTAREA"),d(this.TEXTAREA,"handsontableInput"),this.textareaStyle=this.TEXTAREA.style,this.textareaStyle.width=0,this.textareaStyle.height=0,this.TEXTAREA_PARENT=document.createElement("DIV"),d(this.TEXTAREA_PARENT,"handsontableInputHolder"),this.textareaParentStyle=this.TEXTAREA_PARENT.style,this.textareaParentStyle.top=0,this.textareaParentStyle.left=0,this.textareaParentStyle.display="none",this.TEXTAREA_PARENT.appendChild(this.TEXTAREA),this.instance.rootElement.appendChild(this.TEXTAREA_PARENT);var e=this;this.instance._registerTimeout(setTimeout(function(){e.refreshDimensions()},0))},k.prototype.getEditedCell=function(){var e,t=this.checkEditorSection();switch(t){case"top":e=this.instance.view.wt.wtOverlays.topOverlay.clone.wtTable.getCell({row:this.row,col:this.col}),this.textareaParentStyle.zIndex=101;break;case"top-left-corner":e=this.instance.view.wt.wtOverlays.topLeftCornerOverlay.clone.wtTable.getCell({row:this.row,col:this.col}),this.textareaParentStyle.zIndex=103;break;case"bottom-left-corner":e=this.instance.view.wt.wtOverlays.bottomLeftCornerOverlay.clone.wtTable.getCell({row:this.row,col:this.col}),this.textareaParentStyle.zIndex=103;break;case"left":e=this.instance.view.wt.wtOverlays.leftOverlay.clone.wtTable.getCell({row:this.row,col:this.col}),this.textareaParentStyle.zIndex=102;break;case"bottom":e=this.instance.view.wt.wtOverlays.bottomOverlay.clone.wtTable.getCell({row:this.row,col:this.col}),this.textareaParentStyle.zIndex=102;break;default:e=this.instance.getCell(this.row,this.col),this.textareaParentStyle.zIndex=""}return-1!=e&&-2!=e?e:void 0},k.prototype.refreshDimensions=function(){if(this.state===Handsontable.EditorState.EDITING){if(this.TD=this.getEditedCell(),!this.TD)return void this.close(!0);var e,t=w(this.TD),n=w(this.instance.rootElement),o=p(this.TD),r=this.instance.countRows(),i=t.top-n.top-1-(o.scrollTop||0),s=t.left-n.left-1-(o.scrollLeft||0),l=this.instance.getSettings(),a=(l.rowHeaders?1:0,l.colHeaders?1:0),u=this.checkEditorSection(),c=this.TD.style.backgroundColor;switch(u){case"top":e=g(this.instance.view.wt.wtOverlays.topOverlay.clone.wtTable.holder.parentNode);break;case"left":e=g(this.instance.view.wt.wtOverlays.leftOverlay.clone.wtTable.holder.parentNode);break;case"top-left-corner":e=g(this.instance.view.wt.wtOverlays.topLeftCornerOverlay.clone.wtTable.holder.parentNode);break;case"bottom-left-corner":e=g(this.instance.view.wt.wtOverlays.bottomLeftCornerOverlay.clone.wtTable.holder.parentNode);break;case"bottom":e=g(this.instance.view.wt.wtOverlays.bottomOverlay.clone.wtTable.holder.parentNode)}(a&&0===this.instance.getSelected()[0]||l.fixedRowsBottom&&this.instance.getSelected()[0]===r-l.fixedRowsBottom)&&(i+=1),0===this.instance.getSelected()[1]&&(s+=1),e&&-1!=e?this.textareaParentStyle[e[0]]=e[1]:v(this.textareaParentStyle),this.textareaParentStyle.top=i+"px",this.textareaParentStyle.left=s+"px";var d=this.TD.offsetTop-this.instance.view.wt.wtOverlays.topOverlay.getScrollPosition(),h=this.TD.offsetLeft-this.instance.view.wt.wtOverlays.leftOverlay.getScrollPosition(),b=m(this.TD)-8,C=this.instance.view.maximumVisibleElementWidth(h)-9,y=this.TD.scrollHeight+1,R=Math.max(this.instance.view.maximumVisibleElementHeight(d)-2,23),E=f(this.TD);this.TEXTAREA.style.fontSize=E.fontSize,this.TEXTAREA.style.fontFamily=E.fontFamily,this.TEXTAREA.style.backgroundColor="",this.TEXTAREA.style.backgroundColor=c?c:f(this.TEXTAREA).backgroundColor,this.autoResize.init(this.TEXTAREA,{minHeight:Math.min(y,R),maxHeight:R,minWidth:Math.min(b,C),maxWidth:C},!0),this.textareaParentStyle.display="block"}},k.prototype.bindEvents=function(){var e=this;this.eventManager.addEventListener(this.TEXTAREA,"cut",function(e){_(e)}),this.eventManager.addEventListener(this.TEXTAREA,"paste",function(e){_(e)}),this.instance.addHook("afterScrollHorizontally",function(){e.refreshDimensions()}),this.instance.addHook("afterScrollVertically",function(){e.refreshDimensions()}),this.instance.addHook("afterColumnResize",function(){e.refreshDimensions(),e.focus()}),this.instance.addHook("afterRowResize",function(){e.refreshDimensions(),e.focus()}),this.instance.addHook("afterDestroy",function(){e.eventManager.destroy()})},k.prototype.destroy=function(){this.eventManager.destroy()},S("text",k)},{_baseEditor:30,autoResize:"autoResize",editors:29,eventManager:41,"helpers/dom/element":45,"helpers/dom/event":46,"helpers/unicode":53}],41:[function(e,t,n){"use strict";function o(e,t){var n,o,r,i,s,l="HOT-TABLE";if(t.isTargetWebComponent=!1,t.realTarget=t.target,!Handsontable.eventManager.isHotTableEnv)return t;for(t=a(t),s=t.path?t.path.length:0;s--;){if(t.path[s].nodeName===l)n=!0;else if(n&&t.path[s].shadowRoot){i=t.path[s];break}0!==s||i||(i=t.path[s])}return i||(i=t.target),t.isTargetWebComponent=!0,c()?t.realTarget=t.srcElement||t.toElement:(e instanceof Handsontable.Core||e instanceof Walkontable)&&(e instanceof Handsontable.Core?o=e.view?e.view.wt.wtTable.TABLE:null:e instanceof Walkontable&&(o=e.wtTable.TABLE.parentNode.parentNode),r=u(t.target,[l],o),r?t.realTarget=o.querySelector(l)||t.target:t.realTarget=t.target),Object.defineProperty(t,"target",{get:function(){return a(i)},enumerable:!0,configurable:!0}),t}function r(e){return new d(e)}Object.defineProperties(n,{EventManager:{get:function(){return d}},eventManager:{get:function(){return r}},__esModule:{value:!0}});var i,s,l=(i=e("helpers/dom/element"),i&&i.__esModule&&i||{"default":i}),a=l.polymerWrap,u=l.closest,c=(s=e("helpers/browser"),s&&s.__esModule&&s||{"default":s}).isWebComponentSupportedNatively,d=function(){var e=void 0!==arguments[0]?arguments[0]:null;this.context=e||this,this.context.eventListeners||(this.context.eventListeners=[])};$traceurRuntime.createClass(d,{addEventListener:function(e,t,n){function r(e){void 0==e.target&&void 0!=e.srcElement&&(e.definePoperty?e.definePoperty("target",{value:e.srcElement}):e.target=e.srcElement),void 0==e.preventDefault&&(e.definePoperty?e.definePoperty("preventDefault",{value:function(){this.returnValue=!1}}):e.preventDefault=function(){this.returnValue=!1}),e=o(s,e),n.call(this,e)}var i=this,s=this.context;return this.context.eventListeners.push({element:e,event:t,callback:n,callbackProxy:r}),window.addEventListener?e.addEventListener(t,r,!1):e.attachEvent("on"+t,r),Handsontable.countEventManagerListeners++,function(){i.removeEventListener(e,t,n)}},removeEventListener:function(e,t,n){for(var o,r=this.context.eventListeners.length;r--;)if(o=this.context.eventListeners[r],o.event==t&&o.element==e){if(n&&n!=o.callback)continue;this.context.eventListeners.splice(r,1),o.element.removeEventListener?o.element.removeEventListener(o.event,o.callbackProxy,!1):o.element.detachEvent("on"+o.event,o.callbackProxy),Handsontable.countEventManagerListeners--}},clearEvents:function(){if(this.context)for(var e=this.context.eventListeners.length;e--;){var t=this.context.eventListeners[e];t&&this.removeEventListener(t.element,t.event,t.callback)}},clear:function(){this.clearEvents()},destroy:function(){this.clearEvents(),this.context=null},fireEvent:function(e,t){var n,o={bubbles:!0,cancelable:"mousemove"!==t,view:window,detail:0,screenX:0,screenY:0,clientX:1,clientY:1,ctrlKey:!1,altKey:!1,shiftKey:!1,metaKey:!1,button:0,relatedTarget:void 0};document.createEvent?(n=document.createEvent("MouseEvents"),n.initMouseEvent(t,o.bubbles,o.cancelable,o.view,o.detail,o.screenX,o.screenY,o.clientX,o.clientY,o.ctrlKey,o.altKey,o.shiftKey,o.metaKey,o.button,o.relatedTarget||document.body.parentNode)):n=document.createEventObject(),e.dispatchEvent?e.dispatchEvent(n):e.fireEvent("on"+t,n)}},{}),window.Handsontable=window.Handsontable||{},Handsontable.countEventManagerListeners=0,Handsontable.eventManager=r},{"helpers/browser":43,"helpers/dom/element":45}],42:[function(e,t,n){"use strict";function o(e){for(var t=0,n=e.length;n>t;)e[t]=[e[t]],t++}function r(e,t){for(var n=0,o=t.length;o>n;)e.push(t[n]),n++}function i(e){var t=[];if(!e||0===e.length||!e[0]||0===e[0].length)return t;for(var n=e.length,o=e[0].length,r=0;n>r;r++)for(var i=0;o>i;i++)t[i]||(t[i]=[]),t[i][r]=e[r][i];return t}function s(e,t,n,o){var r=-1,i=e.length;for(o&&i&&(n=e[++r]);++rt?e:t},Array.isArray(e)?e[0]:void 0)}function h(e){return s(e,function(e,t){return t>e?e:t},Array.isArray(e)?e[0]:void 0)}function f(e){return e.length?c(e)/e.length:0}function g(e){return s(e,function(e,t){return e.concat(Array.isArray(t)?g(t):t)},[])}function p(e){var t=[];return u(e,function(e){-1===t.indexOf(e)&&t.push(e)}),t}Object.defineProperties(n,{to2dArray:{get:function(){return o}},extendArray:{get:function(){return r}},pivot:{get:function(){return i}},arrayReduce:{get:function(){return s}},arrayFilter:{get:function(){return l}},arrayMap:{get:function(){return a}},arrayEach:{get:function(){return u}},arraySum:{get:function(){return c}},arrayMax:{get:function(){return d}},arrayMin:{get:function(){return h}},arrayAvg:{get:function(){return f}},arrayFlatten:{get:function(){return g}},arrayUnique:{get:function(){return p}},__esModule:{value:!0}})},{}],43:[function(e,t,n){"use strict";function o(){return f}function r(){return g}function i(){return p}function s(){return m}function l(e){return e||(e=navigator.userAgent),/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(e)}function a(){return"ontouchstart"in window}function u(){var e=document.createElement("div");return e.createShadowRoot&&e.createShadowRoot.toString().match(/\[native code\]/)?!0:!1}function c(){var e=document.createElement("TABLE");e.style.borderSpacing=0,e.style.borderWidth=0,e.style.padding=0;var t=document.createElement("TBODY");e.appendChild(t),t.appendChild(document.createElement("TR")),t.firstChild.appendChild(document.createElement("TD")),t.firstChild.firstChild.innerHTML="t
t";var n=document.createElement("CAPTION");n.innerHTML="c
c
c
c",n.style.padding=0,n.style.margin=0,e.insertBefore(n,t),document.body.appendChild(e),h=e.offsetHeight<2*e.lastChild.offsetHeight,document.body.removeChild(e)}function d(){return void 0===h&&c(),h}Object.defineProperties(n,{isIE8:{get:function(){return o}},isIE9:{get:function(){return r}},isSafari:{get:function(){return i}},isChrome:{get:function(){return s}},isMobileBrowser:{get:function(){return l}},isTouchSupported:{get:function(){return a}},isWebComponentSupportedNatively:{get:function(){return u}},hasCaptionProblem:{get:function(){return d}},__esModule:{value:!0}});var h,f=!document.createTextNode("test").textContent,g=!!document.documentMode,p=/Safari/.test(navigator.userAgent)&&/Apple Computer/.test(navigator.vendor),m=/Chrome/.test(navigator.userAgent)&&/Google/.test(navigator.vendor)},{}],44:[function(e,t,n){"use strict";function o(e){for(var t,n=e+1,o="";n>0;)t=(n-1)%26,o=String.fromCharCode(65+t)+o,n=parseInt((n-t)/26,10);return o}function r(e,t){e="number"==typeof e?e:100,t="number"==typeof t?t:4;var n,r,i=[];for(n=0;e>n;n++){var s=[];for(r=0;t>r;r++)s.push(o(r)+(n+1));i.push(s)}return i}function i(e,t){e="number"==typeof e?e:100,t="number"==typeof t?t:4;var n,r,i=[];for(n=0;e>n;n++){var s={};for(r=0;t>r;r++)s["prop"+r]=o(r)+(n+1);i.push(s)}return i}function s(e,t){for(var n,o=[],r=0;e>r;r++){n=[];for(var i=0;t>i;i++)n.push("");o.push(n)}return o}function l(e){var t,n,o,r,i=[],s=0;for(t=0,n=e.length;n>t;t++)for(o=0,r=e[t].length;r>o;o++)o==s&&(i.push([]),s++),i[o].push(e[t][o]);return i}function a(e,t){function n(e){var t=Handsontable.cellTypes[e];if("undefined"==typeof t)throw new Error('You declared cell type "'+e+'" as a string that is not mapped to a known object. Cell type must be an object or a string mapped to an object in Handsontable.cellTypes');return t}return t="undefined"==typeof t?!0:t,function(o,r){return function i(o){if(o){if(o.hasOwnProperty(e)&&void 0!==o[e])return o[e];if(o.hasOwnProperty("type")&&o.type){var r;if("string"!=typeof o.type)throw new Error("Cell type must be a string ");if(r=n(o.type),r.hasOwnProperty(e))return r[e];if(t)return}return i(c(o))}}("number"==typeof o?this.getCellMeta(o,r):o)}}Object.defineProperties(n,{spreadsheetColumnLabel:{get:function(){return o}},createSpreadsheetData:{get:function(){return r}},createSpreadsheetObjectData:{get:function(){return i}},createEmptySpreadsheetData:{get:function(){return s}},translateRowsToColumns:{get:function(){return l}},cellMethodLookupFactory:{get:function(){return a}},__esModule:{value:!0}});var u,c=(u=e("object"),u&&u.__esModule&&u||{"default":u}).getPrototypeOf},{object:50}],45:[function(e,t,n){"use strict";function o(e,t,n){for(;null!=e&&e!==n;){if(e.nodeType===Node.ELEMENT_NODE&&(t.indexOf(e.nodeName)>-1||t.indexOf(e)>-1))return e;e=e.host&&e.nodeType===Node.DOCUMENT_FRAGMENT_NODE?e.host:e.parentNode}return null}function r(e,t){var n=e.parentNode,o=[];for("string"==typeof t?o=Array.prototype.slice.call(document.querySelectorAll(t),0):o.push(t);null!=n;){if(o.indexOf(n)>-1)return!0;n=n.parentNode}return!1}function i(e){function t(e){return e.nodeType===Node.ELEMENT_NODE&&e.nodeName===o.toUpperCase()}var n,o="hot-table",r=!1;for(n=s(e);null!=n;){if(t(n)){r=!0;break}if(n.host&&n.nodeType===Node.DOCUMENT_FRAGMENT_NODE){if(r=t(n.host))break;n=n.host}n=n.parentNode}return r}function s(e){return"undefined"!=typeof Polymer&&"function"==typeof wrap?wrap(e):e}function l(e){return"undefined"!=typeof Polymer&&"function"==typeof unwrap?unwrap(e):e}function a(e){var t=0;if(e.previousSibling)for(;e=e.previousSibling;)++t;return t}function u(e,t){var n=document.querySelector(".ht_clone_"+e);return n?n.contains(t):null}function c(e){var t=0,n=[];if(!e||!e.length)return n;for(;e[t];)n.push(e[t]),t++;return n}function d(e,t){return Y(e,t)}function h(e,t){return X(e,t)}function f(e,t){return q(e,t)}function g(e,t){if(3===e.nodeType)t.removeChild(e);else if(["TABLE","THEAD","TBODY","TFOOT","TR"].indexOf(e.nodeName)>-1)for(var n=e.childNodes,o=n.length-1;o>=0;o--)g(n[o],e)}function p(e){for(var t;t=e.lastChild;)e.removeChild(t)}function m(e,t){se.test(t)?e.innerHTML=t:w(e,t)}function w(e,t){var n=e.firstChild;n&&3===n.nodeType&&null===n.nextSibling?le?n.textContent=t:n.data=t:(p(e),e.appendChild(document.createTextNode(t)))}function v(e){for(var t=e;l(t)!==document.documentElement;){if(null===t)return!1;if(t.nodeType===Node.DOCUMENT_FRAGMENT_NODE){if(t.host){if(t.host.impl)return v(t.host.impl);if(t.host)return v(t.host);throw new Error("Lost in Web Components world")}return!1}if("none"===t.style.display)return!1;t=t.parentNode}return!0}function b(e){var t,n,o,r,i;if(r=document.documentElement,te()&&e.firstChild&&"CAPTION"===e.firstChild.nodeName)return i=e.getBoundingClientRect(),{top:i.top+(window.pageYOffset||r.scrollTop)-(r.clientTop||0),left:i.left+(window.pageXOffset||r.scrollLeft)-(r.clientLeft||0)};for(t=e.offsetLeft,n=e.offsetTop,o=e;(e=e.offsetParent)&&e!==document.body;)t+=e.offsetLeft,n+=e.offsetTop,o=e;return o&&"fixed"===o.style.position&&(t+=window.pageXOffset||r.scrollLeft,n+=window.pageYOffset||r.scrollTop),{left:t,top:n}}function C(){var e=window.scrollY;return void 0===e&&(e=document.documentElement.scrollTop),e}function y(){var e=window.scrollX;return void 0===e&&(e=document.documentElement.scrollLeft),e}function R(e){return e===window?C():e.scrollTop}function E(e){return e===window?y():e.scrollLeft}function S(e){for(var t,n,o,r=e.parentNode,i=["auto","scroll"],s="",l="",a="",u="";r&&r.style&&document.body!==r;){if(t=r.style.overflow,n=r.style.overflowX,o=r.style.overflowY,"scroll"==t||"scroll"==n||"scroll"==o)return r;if(window.getComputedStyle&&(s=window.getComputedStyle(r), +l=s.getPropertyValue("overflow"),a=s.getPropertyValue("overflow-y"),u=s.getPropertyValue("overflow-x"),"scroll"===l||"scroll"===u||"scroll"===a))return r;if(r.clientHeight<=r.scrollHeight&&(-1!==i.indexOf(o)||-1!==i.indexOf(t)||-1!==i.indexOf(l)||-1!==i.indexOf(a)))return r;if(r.clientWidth<=r.scrollWidth&&(-1!==i.indexOf(n)||-1!==i.indexOf(t)||-1!==i.indexOf(l)||-1!==i.indexOf(u)))return r;r=r.parentNode}return window}function T(e){for(var t=e.parentNode;t&&t.style&&document.body!==t;){if("visible"!==t.style.overflow&&""!==t.style.overflow)return t;if(window.getComputedStyle){var n=window.getComputedStyle(t);if("visible"!==n.getPropertyValue("overflow")&&""!==n.getPropertyValue("overflow"))return t}t=t.parentNode}return window}function O(e,t){if(e){if(e!==window){var n,o=e.style[t];return""!==o&&void 0!==o?o:(n=_(e),""!==n[t]&&void 0!==n[t]?n[t]:void 0)}if("width"===t)return window.innerWidth+"px";if("height"===t)return window.innerHeight+"px"}}function _(e){return e.currentStyle||document.defaultView.getComputedStyle(e)}function M(e){return e.offsetWidth}function H(e){return te()&&e.firstChild&&"CAPTION"===e.firstChild.nodeName?e.offsetHeight+e.firstChild.offsetHeight:e.offsetHeight}function k(e){return e.clientHeight||e.innerHeight}function A(e){return e.clientWidth||e.innerWidth}function P(e,t,n){window.addEventListener?e.addEventListener(t,n,!1):e.attachEvent("on"+t,n)}function x(e,t,n){window.removeEventListener?e.removeEventListener(t,n,!1):e.detachEvent("on"+t,n)}function D(e){if(e.selectionStart)return e.selectionStart;if(document.selection){e.focus();var t=document.selection.createRange();if(null==t)return 0;var n=e.createTextRange(),o=n.duplicate();return n.moveToBookmark(t.getBookmark()),o.setEndPoint("EndToStart",n),o.text.length}return 0}function N(e){if(e.selectionEnd)return e.selectionEnd;if(document.selection){var t=document.selection.createRange();if(null==t)return 0;var n=e.createTextRange();return n.text.indexOf(t.text)+t.text.length}}function L(){var e="";return window.getSelection?e=window.getSelection().toString():document.selection&&"Control"!==document.selection.type&&(e=document.selection.createRange().text),e}function W(e,t,n){if(void 0===n&&(n=t),e.setSelectionRange){e.focus();try{e.setSelectionRange(t,n)}catch(o){var r=e.parentNode,i=r.style.display;r.style.display="block",e.setSelectionRange(t,n),r.style.display=i}}else if(e.createTextRange){var s=e.createTextRange();s.collapse(!0),s.moveEnd("character",n),s.moveStart("character",t),s.select()}}function I(){var e=document.createElement("p");e.style.width="100%",e.style.height="200px";var t=document.createElement("div");t.style.position="absolute",t.style.top="0px",t.style.left="0px",t.style.visibility="hidden",t.style.width="200px",t.style.height="150px",t.style.overflow="hidden",t.appendChild(e),(document.body||document.documentElement).appendChild(t);var n=e.offsetWidth;t.style.overflow="scroll";var o=e.offsetWidth;return n==o&&(o=t.clientWidth),(document.body||document.documentElement).removeChild(t),n-o}function j(){return void 0===ie&&(ie=I()),ie}function B(e,t,n){J()||Z()?(e.style.top=n,e.style.left=t):ee()?e.style["-webkit-transform"]="translate3d("+t+","+n+",0)":e.style.transform="translate3d("+t+","+n+",0)"}function V(e){var t;return e.style.transform&&""!==(t=e.style.transform)?["transform",t]:e.style["-webkit-transform"]&&""!==(t=e.style["-webkit-transform"])?["-webkit-transform",t]:-1}function F(e){e.transform&&""!==e.transform?e.transform="":e["-webkit-transform"]&&""!==e["-webkit-transform"]&&(e["-webkit-transform"]="")}function z(e){var t=["INPUT","SELECT","TEXTAREA"];return t.indexOf(e.nodeName)>-1||"true"===e.contentEditable}function U(e){return z(e)&&-1==e.className.indexOf("handsontableInput")&&-1==e.className.indexOf("copyPaste")}function G(e){return ce.call(window,e)}function $(e){de.call(window,e)}Object.defineProperties(n,{closest:{get:function(){return o}},isChildOf:{get:function(){return r}},isChildOfWebComponentTable:{get:function(){return i}},polymerWrap:{get:function(){return s}},polymerUnwrap:{get:function(){return l}},index:{get:function(){return a}},overlayContainsElement:{get:function(){return u}},hasClass:{get:function(){return d}},addClass:{get:function(){return h}},removeClass:{get:function(){return f}},removeTextNodes:{get:function(){return g}},empty:{get:function(){return p}},HTML_CHARACTERS:{get:function(){return se}},fastInnerHTML:{get:function(){return m}},fastInnerText:{get:function(){return w}},isVisible:{get:function(){return v}},offset:{get:function(){return b}},getWindowScrollTop:{get:function(){return C}},getWindowScrollLeft:{get:function(){return y}},getScrollTop:{get:function(){return R}},getScrollLeft:{get:function(){return E}},getScrollableElement:{get:function(){return S}},getTrimmingContainer:{get:function(){return T}},getStyle:{get:function(){return O}},getComputedStyle:{get:function(){return _}},outerWidth:{get:function(){return M}},outerHeight:{get:function(){return H}},innerHeight:{get:function(){return k}},innerWidth:{get:function(){return A}},addEvent:{get:function(){return P}},removeEvent:{get:function(){return x}},getCaretPosition:{get:function(){return D}},getSelectionEndPosition:{get:function(){return N}},getSelectionText:{get:function(){return L}},setCaretPosition:{get:function(){return W}},getScrollbarWidth:{get:function(){return j}},setOverlayPosition:{get:function(){return B}},getCssTransform:{get:function(){return V}},resetCssTransform:{get:function(){return F}},isInput:{get:function(){return z}},isOutsideInput:{get:function(){return U}},requestAnimationFrame:{get:function(){return G}},cancelAnimationFrame:{get:function(){return $}},__esModule:{value:!0}});var K,Y,X,q,Q=(K=e("../browser"),K&&K.__esModule&&K||{"default":K}),J=Q.isIE8,Z=Q.isIE9,ee=Q.isSafari,te=Q.hasCaptionProblem,ne=document.documentElement.classList?!0:!1;if(ne){var oe=function(){var e=document.createElement("div");return e.classList.add("test","test2"),e.classList.contains("test2")}();Y=function(e,t){return""===t?!1:e.classList.contains(t)},X=function(e,t){var n=0;if("string"==typeof t&&(t=t.split(" ")),t=c(t),oe)e.classList.add.apply(e.classList,t);else for(;t&&t[n];)e.classList.add(t[n]),n++},q=function(e,t){var n=0;if("string"==typeof t&&(t=t.split(" ")),t=c(t),oe)e.classList.remove.apply(e.classList,t);else for(;t&&t[n];)e.classList.remove(t[n]),n++}}else{var re=function(e){return new RegExp("(\\s|^)"+e+"(\\s|$)")};Y=function(e,t){return e.className.match(re(t))?!0:!1},X=function(e,t){var n=0,o=e.className;if("string"==typeof t&&(t=t.split(" ")),""===o)o=t.join(" ");else for(;t&&t[n];)re(t[n]).test(o)||(o+=" "+t[n]),n++;e.className=o},q=function(e,t){var n=0,o=e.className;for("string"==typeof t&&(t=t.split(" "));t&&t[n];)o=o.replace(re(t[n])," ").trim(),n++;e.className!==o&&(e.className=o)}}for(var ie,se=/(<(.*)>|&(.*);)/,le=document.createTextNode("test").textContent?!0:!1,ae=0,ue=["ms","moz","webkit","o"],ce=window.requestAnimationFrame,de=window.cancelAnimationFrame,he=0;he=t&&n(o)!==!1;);}function s(e,t){return t=parseInt(t.toString().replace("%",""),10),t=parseInt(e*t/100)}Object.defineProperties(n,{isNumeric:{get:function(){return o}},rangeEach:{get:function(){return r}},rangeEachReverse:{get:function(){return i}},valueAccordingPercent:{get:function(){return s}},__esModule:{value:!0}})},{}],50:[function(e,t,n){"use strict";function o(e){var t;return Array.isArray(e)?t=[]:(t={},g(e,function(e,n){e&&"object"==typeof e&&!Array.isArray(e)?t[n]=o(e):Array.isArray(e)?e.length&&"object"==typeof e[0]&&!Array.isArray(e[0])?t[n]=[o(e[0])]:t[n]=[]:t[n]=null})),t}function r(e,t){return t.prototype.constructor=t,e.prototype=new t,e.prototype.constructor=e,e}function i(e,t){return g(t,function(t,n){e[n]=t}),e}function s(e,t){g(t,function(n,o){t[o]&&"object"==typeof t[o]?(e[o]||(Array.isArray(t[o])?e[o]=[]:e[o]={}),s(e[o],t[o])):e[o]=t[o]})}function l(e){return"object"==typeof e?JSON.parse(JSON.stringify(e)):e}function a(e){var t={};return g(e,function(e,n){t[n]=e}),t}function u(e){for(var t=[],n=1;no;o++)n.prototype[t[o]]=void 0;return n}Object.defineProperties(n,{columnFactory:{get:function(){return o}},__esModule:{value:!0}});var r,i=(r=e("object"),r&&r.__esModule&&r||{"default":r}).inherit},{object:50}],52:[function(e,t,n){"use strict";function o(e){return e[0].toUpperCase()+e.substr(1)}function r(e,t){var n=!0;return g(t.length-1,function(o){return e.charAt(o)!==t.charAt(o)?(n=!1,!1):void 0}),n}function i(e,t){var n=!0,o=t.length-1,r=e.length-1;return g(o,function(i){var s=r-i,l=o-i;return e.charAt(s)!==t.charAt(l)?(n=!1,!1):void 0}),n}function s(){for(var e=[],t=0;t=t)return e;n=String(n);var o=n.length;o||(n=" ");var r=t-e.length,i=Math.ceil(r/n.length),s="";return g(i,function(e){s+=n}),s=s.slice(0,r),s+e}Object.defineProperties(n,{toUpperCaseFirst:{get:function(){return o}},startsWith:{get:function(){return r}},endsWith:{get:function(){return i}},equalsIgnoreCase:{get:function(){return s}},randomString:{get:function(){return l}},isPercentValue:{get:function(){return a}},substitute:{get:function(){return u}},padStart:{get:function(){return c}},__esModule:{value:!0}});var d,h,f=(d=e("mixed"),d&&d.__esModule&&d||{"default":d}).stringify,g=(h=e("number"),h&&h.__esModule&&h||{"default":h}).rangeEach},{mixed:48,number:49}],53:[function(e,t,n){"use strict";function o(e){return 32==e||e>=48&&57>=e||e>=96&&111>=e||e>=186&&192>=e||e>=219&&222>=e||e>=226||e>=65&&90>=e}function r(e){var t=[u.ARROW_DOWN,u.ARROW_UP,u.ARROW_LEFT,u.ARROW_RIGHT,u.HOME,u.END,u.DELETE,u.BACKSPACE,u.F1,u.F2,u.F3,u.F4,u.F5,u.F6,u.F7,u.F8,u.F9,u.F10,u.F11,u.F12,u.TAB,u.PAGE_DOWN,u.PAGE_UP,u.ENTER,u.ESCAPE,u.SHIFT,u.CAPS_LOCK,u.ALT];return-1!==t.indexOf(e)}function i(e){return-1!==[u.CONTROL_LEFT,224,u.COMMAND_LEFT,u.COMMAND_RIGHT].indexOf(e)}function s(e,t){var n=t.split("|"),o=!1;return a(n,function(t){return e===u[t]?(o=!0,!1):void 0}),o}Object.defineProperties(n,{KEY_CODES:{get:function(){return u}},isPrintableChar:{get:function(){return o}},isMetaKey:{get:function(){return r}},isCtrlKey:{get:function(){return i}},isKey:{get:function(){return s}},__esModule:{value:!0}});var l,a=(l=e("array"),l&&l.__esModule&&l||{"default":l}).arrayEach,u={MOUSE_LEFT:1,MOUSE_RIGHT:3,MOUSE_MIDDLE:2,BACKSPACE:8,COMMA:188,INSERT:45,DELETE:46,END:35,ENTER:13,ESCAPE:27,CONTROL_LEFT:91,COMMAND_LEFT:17,COMMAND_RIGHT:93,ALT:18,HOME:36,PAGE_DOWN:34,PAGE_UP:33,PERIOD:190,SPACE:32,SHIFT:16,CAPS_LOCK:20,TAB:9,ARROW_RIGHT:39,ARROW_LEFT:37,ARROW_UP:38,ARROW_DOWN:40,F1:112,F2:113,F3:114,F4:115,F5:116,F6:117,F7:118,F8:119,F9:120,F10:121,F11:122,F12:123,A:65,X:88,C:67,V:86}},{array:42}],54:[function(e,t,n){"use strict";Object.defineProperties(n,{localHooks:{get:function(){return a}},__esModule:{value:!0}});var o,r,i=(o=e("helpers/array"),o&&o.__esModule&&o||{"default":o}).arrayEach,s=(r=e("helpers/object"),r&&r.__esModule&&r||{"default":r}).defineGetter,l="localHooks",a={_localHooks:Object.create(null),addLocalHook:function(e,t){this._localHooks[e]||(this._localHooks[e]=[]),this._localHooks[e].push(t)},runLocalHooks:function(e){for(var t=[],n=1;n=0?(t.skip=!0,!0):!1},has:function(e){var t=void 0!==arguments[1]?arguments[1]:null,n=this.getBucket(t);return void 0!==n[e]&&n[e].length?!0:!1},run:function(e,t,n,o,r,i,s,l){var a=this.globalBucket[t],u=-1,c=a?a.length:0;if(c)for(;++u=0},getRegistered:function(){return i}},{}),Handsontable.utils=Handsontable.utils||{},Handsontable.utils.Hooks=a},{"helpers/array":42,"helpers/object":50}],57:[function(e,t,n){"use strict";function o(e,t){e=c(e),Handsontable.plugins[e]=t,Handsontable.hooks.add("construct",function(){var n;d.has(this)||d.set(this,{}),n=d.get(this),n[e]||(n[e]=new t(this))}),Handsontable.hooks.add("afterDestroy",function(){if(d.has(this)){var e=d.get(this);u(e,function(e){return e.destroy()}),d["delete"](this)}})}function r(e,t){if("string"!=typeof t)throw Error('Only strings can be passed as "plugin" parameter');var n=c(t);if(d.has(e)&&d.get(e)[n])return d.get(e)[n]}function i(e){return d.has(e)?Object.keys(d.get(e)):[]}function s(e,t){var n=null;return d.has(e)&&u(d.get(e),function(e,o){e===t&&(n=o)}),n}Object.defineProperties(n,{registerPlugin:{get:function(){return o}},getPlugin:{get:function(){return r}},getRegistredPluginNames:{get:function(){return i}},getPluginName:{get:function(){return s}},__esModule:{value:!0}});var l,a,u=(l=e("helpers/object"),l&&l.__esModule&&l||{"default":l}).objectEach,c=(a=e("helpers/string"),a&&a.__esModule&&a||{"default":a}).toUpperCaseFirst,d=new WeakMap;Handsontable.plugins=Handsontable.plugins||{},Handsontable.plugins.utils=Handsontable.plugins.utils||{},Handsontable.plugins.registerPlugin=o},{"helpers/object":50,"helpers/string":52}],58:[function(e,t,n){"use strict";Object.defineProperties(n,{"default":{get:function(){return m}},__esModule:{value:!0}});var o,r,i,s=(o=e("helpers/object"),o&&o.__esModule&&o||{"default":o}),l=s.defineGetter,a=s.objectEach,u=(r=e("helpers/array"),r&&r.__esModule&&r||{"default":r}).arrayEach,c=(i=e("plugins"),i&&i.__esModule&&i||{"default":i}),d=c.getRegistredPluginNames,h=c.getPluginName,f=new WeakMap,g=null,p=function(e){var t=this;l(this,"hot",e,{writable:!1}),f.set(this,{hooks:{}}),g=null,this.pluginName=null,this.pluginsInitializedCallbacks=[],this.isPluginsReady=!1,this.enabled=!1,this.initialized=!1,this.hot.addHook("afterPluginsInitialized",function(){return t.onAfterPluginsInitialized()}),this.hot.addHook("afterUpdateSettings",function(){return t.onUpdateSettings()}),this.hot.addHook("beforeInit",function(){return t.init()})};$traceurRuntime.createClass(p,{init:function(){this.pluginName=h(this.hot,this),this.isEnabled&&this.isEnabled()&&this.enablePlugin(),g||(g=d(this.hot)),g.indexOf(this.pluginName)>=0&&g.splice(g.indexOf(this.pluginName),1),g.length||this.hot.runHooks("afterPluginsInitialized"),this.initialized=!0},enablePlugin:function(){this.enabled=!0},disablePlugin:function(){this.eventManager&&this.eventManager.clear(),this.clearHooks(),this.enabled=!1},addHook:function(e,t){var n=f.get(this).hooks[e]=f.get(this).hooks[e]||[];this.hot.addHook(e,t),n.push(t),f.get(this).hooks[e]=n},removeHooks:function(e){var t=this;u(f.get(this).hooks[e]||[],function(n){t.hot.removeHook(e,n)})},clearHooks:function(){var e=this,t=f.get(this).hooks;a(t,function(t,n){return e.removeHooks(n)}),t.length=0},callOnPluginsReady:function(e){this.isPluginsReady?e():this.pluginsInitializedCallbacks.push(e)},onAfterPluginsInitialized:function(){u(this.pluginsInitializedCallbacks,function(e){return e()}),this.pluginsInitializedCallbacks.length=0,this.isPluginsReady=!0},onUpdateSettings:function(){this.isEnabled&&(this.enabled&&!this.isEnabled()&&this.disablePlugin(),!this.enabled&&this.isEnabled()&&this.enablePlugin(),this.enabled&&this.isEnabled()&&this.updatePlugin())},updatePlugin:function(){},destroy:function(){var e=this;this.eventManager&&this.eventManager.destroy(),this.clearHooks(),a(this,function(t,n){"hot"!==n&&(e[n]=null)}),delete this.hot}},{});var m=p;Handsontable.plugins.BasePlugin=p},{"helpers/array":42,"helpers/object":50,plugins:57}],59:[function(e,t,n){"use strict";Object.defineProperties(n,{AutoColumnSize:{get:function(){return A}},__esModule:{value:!0}});var o,r,i,s,l,a,u,c,d,h,f=(o=e("_base"),o&&o.__esModule&&o||{"default":o})["default"],g=(r=e("helpers/array"),r&&r.__esModule&&r||{"default":r}),p=g.arrayEach,m=g.arrayFilter,w=(i=e("helpers/dom/element"),i&&i.__esModule&&i||{"default":i}),v=w.cancelAnimationFrame,b=w.requestAnimationFrame,C=w.isVisible,y=(s=e("utils/ghostTable"),s&&s.__esModule&&s||{"default":s}).GhostTable,R=(l=e("helpers/object"),l&&l.__esModule&&l||{"default":l}),E=R.isObject,S=(R.objectEach,a=e("helpers/number"),a&&a.__esModule&&a||{"default":a}),T=S.valueAccordingPercent,O=S.rangeEach,_=(u=e("plugins"),u&&u.__esModule&&u||{"default":u}).registerPlugin,M=(c=e("utils/samplesGenerator"),c&&c.__esModule&&c||{"default":c}).SamplesGenerator,H=(d=e("helpers/string"),d&&d.__esModule&&d||{"default":d}).isPercentValue,k=(h=e("3rdparty/walkontable/src/calculator/viewportColumns"),h&&h.__esModule&&h||{"default":h}).WalkontableViewportColumnsCalculator,A=function(e){var t=this;$traceurRuntime.superConstructor(P).call(this,e),this.widths=[],this.ghostTable=new y(this.hot),this.samplesGenerator=new M(function(e,n){return t.hot.getDataAtCell(e,n)}),this.firstCalculation=!0,this.inProgress=!1,this.addHook("beforeColumnResize",function(e,n,o){return t.onBeforeColumnResize(e,n,o)})},P=A;$traceurRuntime.createClass(A,{isEnabled:function(){return this.hot.getSettings().autoColumnSize!==!1&&!this.hot.getSettings().colWidths},enablePlugin:function(){var e=this;this.enabled||(this.addHook("afterLoadData",function(){return e.onAfterLoadData()}),this.addHook("beforeChange",function(t){return e.onBeforeChange(t)}),this.addHook("beforeRender",function(t){return e.onBeforeRender(t)}),this.addHook("modifyColWidth",function(t,n){return e.getColumnWidth(n,t)}),$traceurRuntime.superGet(this,P.prototype,"enablePlugin").call(this))},disablePlugin:function(){$traceurRuntime.superGet(this,P.prototype,"disablePlugin").call(this)},calculateColumnsWidth:function(){var e=void 0!==arguments[0]?arguments[0]:{from:0,to:this.hot.countCols()-1},t=void 0!==arguments[1]?arguments[1]:{from:0,to:this.hot.countRows()-1},n=void 0!==arguments[2]?arguments[2]:!1,o=this;"number"==typeof e&&(e={from:e,to:e}),"number"==typeof t&&(t={from:t,to:t}),O(e.from,e.to,function(e){if(n||void 0===o.widths[e]&&!o.hot._getColWidthFromSettings(e)){var r=o.samplesGenerator.generateColumnSamples(e,t);r.forEach(function(e,t){return o.ghostTable.addColumn(t,e)})}}),this.ghostTable.columns.length&&(this.ghostTable.getWidths(function(e,t){return o.widths[e]=t}),this.ghostTable.clean())},calculateAllColumnsWidth:function(){var e=void 0!==arguments[0]?arguments[0]:{from:0,to:this.hot.countRows()-1},t=this,n=0,o=this.hot.countCols()-1,r=null;this.inProgress=!0;var i=function(){return t.hot?(t.calculateColumnsWidth({from:n,to:Math.min(n+P.CALCULATION_STEP,o)},e),n=n+P.CALCULATION_STEP+1,void(o>n?r=b(i):(v(r),t.inProgress=!1,t.hot.view.wt.wtOverlays.adjustElementsSize(!0),t.hot.view.wt.wtOverlays.leftOverlay.needFullRender&&t.hot.view.wt.wtOverlays.leftOverlay.clone.draw()))):(v(r),void(t.inProgress=!1))};this.firstCalculation&&this.getSyncCalculationLimit()&&(this.calculateColumnsWidth({from:0,to:this.getSyncCalculationLimit()},e),this.firstCalculation=!1,n=this.getSyncCalculationLimit()+1),o>n?i():this.inProgress=!1},recalculateAllColumnsWidth:function(){this.hot.view&&C(this.hot.view.wt.wtTable.TABLE)&&(this.clearCache(),this.calculateAllColumnsWidth())},getSyncCalculationLimit:function(){var e=P.SYNC_CALCULATION_LIMIT,t=this.hot.countCols()-1;return E(this.hot.getSettings().autoColumnSize)&&(e=this.hot.getSettings().autoColumnSize.syncLimit,H(e)?e=T(t,e):e>>=0),Math.min(e,t)},getColumnWidth:function(e){var t=arguments[1],n=void 0!==arguments[2]?arguments[2]:!0,o=t;return void 0===o&&(o=this.widths[e],n&&"number"==typeof o&&(o=Math.max(o,k.DEFAULT_WIDTH))),o},getFirstVisibleColumn:function(){var e=this.hot.view.wt;return e.wtViewport.columnsVisibleCalculator?e.wtTable.getFirstVisibleColumn():e.wtViewport.columnsRenderCalculator?e.wtTable.getFirstRenderedColumn():-1},getLastVisibleColumn:function(){var e=this.hot.view.wt;return e.wtViewport.columnsVisibleCalculator?e.wtTable.getLastVisibleColumn():e.wtViewport.columnsRenderCalculator?e.wtTable.getLastRenderedColumn():-1},clearCache:function(){this.widths.length=0},isNeedRecalculate:function(){return m(this.widths,function(e){return void 0===e}).length?!0:!1},onBeforeRender:function(){var e=this.hot.renderCall;this.calculateColumnsWidth({from:this.getFirstVisibleColumn(),to:this.getLastVisibleColumn()},void 0,e),this.isNeedRecalculate()&&!this.inProgress&&this.calculateAllColumnsWidth()},onAfterLoadData:function(){var e=this;this.hot.view?this.recalculateAllColumnsWidth():setTimeout(function(){e.hot&&e.recalculateAllColumnsWidth()},0)},onBeforeChange:function(e){var t=this;p(e,function(e){return t.widths[e[1]]=void 0})},onBeforeColumnResize:function(e,t,n){return n&&(this.calculateColumnsWidth(e,void 0,!0),t=this.getColumnWidth(e,void 0,!1)),t},destroy:function(){this.ghostTable.clean(),$traceurRuntime.superGet(this,P.prototype,"destroy").call(this)}},{get CALCULATION_STEP(){return 50},get SYNC_CALCULATION_LIMIT(){return 50}},f),_("autoColumnSize",A)},{"3rdparty/walkontable/src/calculator/viewportColumns":3,_base:58,"helpers/array":42,"helpers/dom/element":45,"helpers/number":49,"helpers/object":50,"helpers/string":52,plugins:57,"utils/ghostTable":98,"utils/samplesGenerator":99}],60:[function(e,t,n){"use strict";Object.defineProperties(n,{AutoRowSize:{get:function(){return M}},__esModule:{value:!0}});var o,r,i,s,l,a,u,c,d,h=(o=e("_base"),o&&o.__esModule&&o||{"default":o})["default"],f=(r=e("helpers/array"),r&&r.__esModule&&r||{"default":r}),g=(f.arrayEach,f.arrayFilter),p=(i=e("helpers/dom/element"),i&&i.__esModule&&i||{"default":i}),m=p.cancelAnimationFrame,w=p.requestAnimationFrame,v=p.isVisible,b=(s=e("utils/ghostTable"),s&&s.__esModule&&s||{"default":s}).GhostTable,C=(l=e("helpers/object"),l&&l.__esModule&&l||{"default":l}),y=C.isObject,R=(C.objectEach,a=e("helpers/number"),a&&a.__esModule&&a||{"default":a}),E=R.valueAccordingPercent,S=R.rangeEach,T=(u=e("plugins"),u&&u.__esModule&&u||{"default":u}).registerPlugin,O=(c=e("utils/samplesGenerator"),c&&c.__esModule&&c||{"default":c}).SamplesGenerator,_=(d=e("helpers/string"),d&&d.__esModule&&d||{"default":d}).isPercentValue,M=function(e){var t=this;$traceurRuntime.superConstructor(H).call(this,e),this.heights=[],this.ghostTable=new b(this.hot),this.samplesGenerator=new O(function(e,n){return t.hot.getDataAtCell(e,n)}),this.firstCalculation=!0,this.inProgress=!1,this.addHook("beforeRowResize",function(e,n,o){return t.onBeforeRowResize(e,n,o)})},H=M;$traceurRuntime.createClass(M,{isEnabled:function(){return this.hot.getSettings().autoRowSize===!0||y(this.hot.getSettings().autoRowSize)},enablePlugin:function(){var e=this;this.enabled||(this.addHook("afterLoadData",function(){return e.onAfterLoadData()}),this.addHook("beforeChange",function(t){return e.onBeforeChange(t)}),this.addHook("beforeColumnMove",function(){return e.recalculateAllRowsHeight()}),this.addHook("beforeColumnResize",function(){return e.recalculateAllRowsHeight()}),this.addHook("beforeColumnSort",function(){return e.clearCache()}),this.addHook("beforeRender",function(t){return e.onBeforeRender(t)}),this.addHook("beforeRowMove",function(t,n){ +return e.onBeforeRowMove(t,n)}),this.addHook("modifyRowHeight",function(t,n){return e.getRowHeight(n,t)}),$traceurRuntime.superGet(this,H.prototype,"enablePlugin").call(this))},disablePlugin:function(){$traceurRuntime.superGet(this,H.prototype,"disablePlugin").call(this)},calculateRowsHeight:function(){var e=void 0!==arguments[0]?arguments[0]:{from:0,to:this.hot.countRows()-1},t=void 0!==arguments[1]?arguments[1]:{from:0,to:this.hot.countCols()-1},n=void 0!==arguments[2]?arguments[2]:!1,o=this;"number"==typeof e&&(e={from:e,to:e}),"number"==typeof t&&(t={from:t,to:t}),S(e.from,e.to,function(e){if(n||void 0===o.heights[e]){var r=o.samplesGenerator.generateRowSamples(e,t);r.forEach(function(e,t){return o.ghostTable.addRow(t,e)})}}),this.ghostTable.rows.length&&(this.ghostTable.getHeights(function(e,t){return o.heights[e]=t}),this.ghostTable.clean())},calculateAllRowsHeight:function(){var e=void 0!==arguments[0]?arguments[0]:{from:0,to:this.hot.countCols()-1},t=this,n=0,o=this.hot.countRows()-1,r=null;this.inProgress=!0;var i=function(){return t.hot?(t.calculateRowsHeight({from:n,to:Math.min(n+H.CALCULATION_STEP,o)},e),n=n+H.CALCULATION_STEP+1,void(o>n?r=w(i):(m(r),t.inProgress=!1,t.hot.view.wt.wtOverlays.adjustElementsSize(!0),t.hot.view.wt.wtOverlays.leftOverlay.needFullRender&&t.hot.view.wt.wtOverlays.leftOverlay.clone.draw()))):(m(r),void(t.inProgress=!1))};this.firstCalculation&&this.getSyncCalculationLimit()&&(this.calculateRowsHeight({from:0,to:this.getSyncCalculationLimit()},e),this.firstCalculation=!1,n=this.getSyncCalculationLimit()+1),o>n?i():this.inProgress=!1},recalculateAllRowsHeight:function(){v(this.hot.view.wt.wtTable.TABLE)&&(this.clearCache(),this.calculateAllRowsHeight())},getSyncCalculationLimit:function(){var e=H.SYNC_CALCULATION_LIMIT,t=this.hot.countRows()-1;return y(this.hot.getSettings().autoRowSize)&&(e=this.hot.getSettings().autoRowSize.syncLimit,_(e)?e=E(t,e):e>>=0),Math.min(e,t)},getRowHeight:function(e){var t=arguments[1],n=t;return void 0!==this.heights[e]&&this.heights[e]>(t||0)&&(n=this.heights[e]),n},getFirstVisibleRow:function(){var e=this.hot.view.wt;return e.wtViewport.rowsVisibleCalculator?e.wtTable.getFirstVisibleRow():e.wtViewport.rowsRenderCalculator?e.wtTable.getFirstRenderedRow():-1},getLastVisibleRow:function(){var e=this.hot.view.wt;return e.wtViewport.rowsVisibleCalculator?e.wtTable.getLastVisibleRow():e.wtViewport.rowsRenderCalculator?e.wtTable.getLastRenderedRow():-1},clearCache:function(){this.heights.length=0},clearCacheByRange:function(e){var t=this;"number"==typeof e&&(e={from:e,to:e}),S(Math.min(e.from,e.to),Math.max(e.from,e.to),function(e){return t.heights[e]=void 0})},isNeedRecalculate:function(){return g(this.heights,function(e){return void 0===e}).length?!0:!1},onBeforeRender:function(){var e=this.hot.renderCall;this.calculateRowsHeight({from:this.getFirstVisibleRow(),to:this.getLastVisibleRow()},void 0,e),this.isNeedRecalculate()&&!this.inProgress&&this.calculateAllRowsHeight()},onBeforeRowMove:function(e,t){this.clearCacheByRange({from:e,to:t}),this.calculateAllRowsHeight()},onBeforeRowResize:function(e,t,n){return n&&(this.calculateRowsHeight(e,void 0,!0),t=this.getRowHeight(e)),t},onAfterLoadData:function(){var e=this;this.hot.view?this.recalculateAllRowsHeight():setTimeout(function(){e.hot&&e.recalculateAllRowsHeight()},0)},onBeforeChange:function(e){var t=null;1===e.length?t=e[0][0]:e.length>1&&(t={from:e[0][0],to:e[e.length-1][0]}),null!==t&&this.clearCacheByRange(t)},destroy:function(){this.ghostTable.clean(),$traceurRuntime.superGet(this,H.prototype,"destroy").call(this)}},{get CALCULATION_STEP(){return 50},get SYNC_CALCULATION_LIMIT(){return 500}},h),T("autoRowSize",M)},{_base:58,"helpers/array":42,"helpers/dom/element":45,"helpers/number":49,"helpers/object":50,"helpers/string":52,plugins:57,"utils/ghostTable":98,"utils/samplesGenerator":99}],61:[function(e,t,n){"use strict";function o(e,t,n,o){var r,i,s,l,a,u=n.length,c=n?n[0].length:0,d=[],h=[];if(r=t.row-e.row,i=t.col-e.col,-1!==["down","up"].indexOf(o)){for(var f=0;i>=f;f++)s=parseInt(n[0][f],10),l=parseInt(n[u-1][f],10),a=("down"===o?l-s:s-l)/(u-1)||0,h.push(a);d.push(h)}if(-1!==["right","left"].indexOf(o))for(var g=0;r>=g;g++)s=parseInt(n[g][0],10),l=parseInt(n[g][c-1],10),a=("right"===o?l-s:s-l)/(c-1)||0,h=[],h.push(a),d.push(h);return d}function r(e){function t(t){return e.autofill?void(e.autofill.handle&&e.autofill.handle.isDragged&&(e.autofill.handle.isDragged>1&&e.autofill.apply(),e.autofill.handle.isDragged=0,l=!1)):!0}function n(e){var t,n;return s.instance.autofill?(t=c(s.instance.table).top-(window.pageYOffset||document.documentElement.scrollTop)+d(s.instance.table),n=c(s.instance.table).left-(window.pageXOffset||document.documentElement.scrollLeft)+h(s.instance.table),s.addingStarted===!1&&s.instance.autofill.handle.isDragged>0&&e.clientY>t&&e.clientX<=n?(s.instance.mouseDragOutside=!0,s.addingStarted=!0):s.instance.mouseDragOutside=!1,void(s.instance.mouseDragOutside&&setTimeout(function(){s.addingStarted=!1,s.instance.alter("insert_row")},200))):!1}var o,r,i,s=this,l=!1;this.instance=e,this.addingStarted=!1,i=f(e),i.addEventListener(document,"mouseup",t),i.addEventListener(document,"mousemove",n),o=this.instance.view.wt.wtSettings.settings.onCellCornerMouseDown,this.instance.view.wt.wtSettings.settings.onCellCornerMouseDown=function(t){e.autofill.handle.isDragged=1,l=!0,o(t)},r=this.instance.view.wt.wtSettings.settings.onCellMouseOver,this.instance.view.wt.wtSettings.settings.onCellMouseOver=function(t,n,o,i){e.autofill&&l&&!e.view.isMouseDown()&&e.autofill.handle&&e.autofill.handle.isDragged&&(e.autofill.handle.isDragged++,e.autofill.showBorder(n),e.autofill.checkIfNewRowNeeded()),r(t,n,o,i)},this.instance.view.wt.wtSettings.settings.onCellCornerDblClick=function(){e.autofill.selectAdjacent()}}Object.defineProperties(n,{Autofill:{get:function(){return r}},__esModule:{value:!0}});var i,s,l,a,u=(i=e("helpers/dom/element"),i&&i.__esModule&&i||{"default":i}),c=u.offset,d=u.outerHeight,h=u.outerWidth,f=(s=e("eventManager"),s&&s.__esModule&&s||{"default":s}).eventManager,g=((l=e("plugins"),l&&l.__esModule&&l||{"default":l}).registerPlugin,(a=e("3rdparty/walkontable/src/cell/coords"),a&&a.__esModule&&a||{"default":a}).WalkontableCellCoords);r.prototype.init=function(){this.handle={}},r.prototype.disable=function(){this.handle.disabled=!0},r.prototype.selectAdjacent=function(){var e,t,n,o,r;e=this.instance.selection.isMultiple()?this.instance.view.wt.selections.area.getCorners():this.instance.view.wt.selections.current.getCorners(),t=this.instance.getData();e:for(n=e[2]+1;nt[3]?(s="right",n=new g(e[0],t[3]+1),r=new g(e[2],e[3])):e[0]t[2]&&e[1]===t[1]&&(s="down",n=new g(t[2]+1,e[1]),r=new g(e[2],e[3])),n&&n.row>-1&&n.col>-1?(a={from:this.instance.getSelectedRange().from,to:this.instance.getSelectedRange().to},i=this.instance.getData(a.from.row,a.from.col,a.to.row,a.to.col),l=o(n,r,i,s),Handsontable.hooks.run(this.instance,"beforeAutofill",n,r,i),this.instance.populateFromArray(n.row,n.col,i,r.row,r.col,"autofill",null,s,l),this.instance.selection.setRangeStart(new g(e[0],e[1])),this.instance.selection.setRangeEnd(new g(e[2],e[3]))):this.instance.selection.refreshBorders())},r.prototype.showBorder=function(e){var t=this.instance.getSelectedRange().getTopLeftCorner(),n=this.instance.getSelectedRange().getBottomRightCorner();if("horizontal"!==this.instance.getSettings().fillHandle&&(n.rowe.row))e=new g(e.row,n.col);else{if("vertical"===this.instance.getSettings().fillHandle)return;e=new g(n.row,e.col)}this.instance.view.wt.selections.fill.clear(),this.instance.view.wt.selections.fill.add(this.instance.getSelectedRange().from),this.instance.view.wt.selections.fill.add(this.instance.getSelectedRange().to),this.instance.view.wt.selections.fill.add(e),this.instance.view.render()},r.prototype.checkIfNewRowNeeded=function(){var e,t,n=this.instance.countRows(),o=this;this.instance.view.wt.selections.fill.cellRange&&this.addingStarted===!1&&(t=this.instance.getSelected(),e=this.instance.view.wt.selections.fill.getCorners(),t[2]n[1]?e?1:-1:0}},dateSort:function(e){return function(t,n){if(t[1]===n[1])return 0;if(null===t[1]||""===t[1])return 1;if(null===n[1]||""===n[1])return-1;var o=new Date(t[1]),r=new Date(n[1]);return r>o?e?-1:1:o>r?e?1:-1:0}},sort:function(){if("undefined"==typeof this.hot.sortOrder)return void(this.hot.sortIndex.length=0);var e,t;this.hot.sortingEnabled=!1,this.hot.sortIndex.length=0;for(var n=this.hot.colOffset(),o=0,r=this.hot.countRows()-this.hot.getSettings().minSpareRows;r>o;o++)this.hot.sortIndex.push([o,this.hot.getDataAtCell(o,this.hot.sortColumn+n)]);switch(e=this.hot.getCellMeta(0,this.hot.sortColumn),this.sortIndicators[this.hot.sortColumn]=e.sortIndicator,e.type){case"date":t=this.dateSort;break;default:t=this.defaultSort}this.hot.sortIndex.sort(t(this.hot.sortOrder));for(var o=this.hot.sortIndex.length;o=0&&-1===r&&u(n,"columnSorting"),f(n,"descending"),f(n,"ascending"),this.sortIndicators[e]&&e===this.hot.sortColumn&&("ascending"===this.sortOrderClass?u(n,"ascending"):"descending"===this.sortOrderClass&&u(n,"descending")))},isSorted:function(){return"undefined"!=typeof this.hot.sortColumn},afterCreateRow:function(e,t){if(this.isSorted()){for(var n=0;n=e&&(this.hot.sortIndex[n][0]+=t);for(var n=0;t>n;n++)this.hot.sortIndex.splice(e+n,0,[e+n,this.hot.getSourceData()[e+n][this.hot.sortColumn+this.hot.colOffset()]]);this.saveSortingState()}},afterRemoveRow:function(e,t){function n(e){return m(o,function(t,n){return e>n&&t++,t},0)}if(this.isSorted()){var o=this.hot.sortIndex.splice(e,t);o=p(o,function(e){return e[0]}),this.hot.sortIndex=p(this.hot.sortIndex,function(e,t){var o=n(e[0]);return o&&(e[0]-=o),e}),this.saveSortingState()}}},{},v),b("columnSorting",C)},{_base:58,eventManager:41,"helpers/array":42,"helpers/dom/element":45,plugins:57}],63:[function(e,t,n){"use strict";Object.defineProperties(n,{CommentEditor:{get:function(){return i}},__esModule:{value:!0}});var o,r=(o=e("helpers/dom/element"),o&&o.__esModule&&o||{"default":o}).addClass,i=function(){this.editor=this.createEditor(),this.editorStyle=this.editor.style,this.editorStyle.position="absolute",this.editorStyle.zIndex=100,this.hide()},s=i;$traceurRuntime.createClass(i,{setPosition:function(e,t){this.editorStyle.left=e+"px",this.editorStyle.top=t+"px"},show:function(){this.editorStyle.display="block"},hide:function(){this.editorStyle.display="none"},isVisible:function(){return"block"===this.editorStyle.display},setValue:function(){var e=void 0!==arguments[0]?arguments[0]:"";e=e||"",this.getInputElement().value=e},getValue:function(){return this.getInputElement().value},isFocused:function(){return document.activeElement===this.getInputElement()},focus:function(){this.getInputElement().focus()},createEditor:function(){var e,t,n=document.querySelector("."+s.CLASS_EDITOR_CONTAINER);return n||(n=document.createElement("div"),r(n,s.CLASS_EDITOR_CONTAINER),document.body.appendChild(n)),e=document.createElement("div"),r(e,s.CLASS_EDITOR),t=document.createElement("textarea"),r(t,s.CLASS_INPUT),e.appendChild(t),n.appendChild(e),e},getInputElement:function(){return this.editor.querySelector("."+s.CLASS_INPUT)},destroy:function(){this.editor.parentNode.removeChild(this.editor),this.editor=null,this.editorStyle=null}},{get CLASS_EDITOR_CONTAINER(){return"htCommentsContainer"},get CLASS_EDITOR(){return"htComments"},get CLASS_INPUT(){return"htCommentTextArea"},get CLASS_CELL(){return"htCommentCell"}})},{"helpers/dom/element":45}],64:[function(e,t,n){"use strict";Object.defineProperties(n,{Comments:{get:function(){return R}},__esModule:{value:!0}});var o,r,i,s,l,a,u=(o=e("helpers/dom/element"),o&&o.__esModule&&o||{"default":o}),c=u.addClass,d=u.closest,h=u.getWindowScrollLeft,f=u.getWindowScrollTop,g=u.hasClass,p=u.offset,m=(r=e("eventManager"),r&&r.__esModule&&r||{"default":r}).EventManager,w=(i=e("3rdparty/walkontable/src/cell/coords"),i&&i.__esModule&&i||{"default":i}).WalkontableCellCoords,v=(s=e("plugins"),s&&s.__esModule&&s||{"default":s}),b=v.registerPlugin,C=(v.getPlugin,(l=e("_base"),l&&l.__esModule&&l||{"default":l})["default"]),y=(a=e("commentEditor"),a&&a.__esModule&&a||{"default":a}).CommentEditor,R=function(e){$traceurRuntime.superConstructor(E).call(this,e),this.editor=null,this.eventManager=null,this.range={},this.mouseDown=!1,this.contextMenuEvent=!1,this.timer=null},E=R;$traceurRuntime.createClass(R,{isEnabled:function(){return this.hot.getSettings().comments},enablePlugin:function(){var e=this;this.enabled||(this.editor||(this.editor=new y),this.eventManager||(this.eventManager=new m(this)),this.addHook("afterContextMenuDefaultOptions",function(t){return e.addToContextMenu(t)}),this.addHook("afterRenderer",function(t,n,o,r,i,s){return e.onAfterRenderer(t,s)}),this.addHook("afterScrollHorizontally",function(){return e.refreshEditorPosition()}),this.addHook("afterScrollVertically",function(){return e.refreshEditorPosition()}),this.addHook("afterColumnResize",function(){return e.refreshEditorPosition()}),this.addHook("afterRowResize",function(){return e.refreshEditorPosition()}),this.registerListeners(),$traceurRuntime.superGet(this,E.prototype,"enablePlugin").call(this))},disablePlugin:function(){$traceurRuntime.superGet(this,E.prototype,"disablePlugin").call(this)},registerListeners:function(){var e=this;this.eventManager.addEventListener(document,"mouseover",function(t){return e.onMouseOver(t)}),this.eventManager.addEventListener(document,"mousedown",function(t){return e.onMouseDown(t)}),this.eventManager.addEventListener(document,"mousemove",function(t){return e.onMouseMove(t)}),this.eventManager.addEventListener(document,"mouseup",function(t){return e.onMouseUp(t)}),this.eventManager.addEventListener(this.editor.getInputElement(),"blur",function(t){return e.onEditorBlur(t)})},setRange:function(e){this.range=e},clearRange:function(){this.range={}},targetIsCellWithComment:function(e){return g(e.target,"htCommentCell")&&d(e.target,[this.hot.rootElement])?!0:!1},targetIsCommentTextArea:function(e){return this.editor.getInputElement()===e.target},saveComment:function(){if(!this.range.from)throw new Error('Before using this method, first set cell range (hot.getPlugin("comment").setRange())');var e=this.editor.getValue(),t=this.range.from.row,n=this.range.from.col;this.hot.setCellMeta(t,n,"comment",e),this.hot.render()},saveCommentAtCell:function(e,t){this.setRange({from:new w(e,t)}),this.saveComment()},removeComment:function(){if(!this.range.from)throw new Error('Before using this method, first set cell range (hot.getPlugin("comment").setRange())');this.hot.removeCellMeta(this.range.from.row,this.range.from.col,"comment"),this.hot.render(),this.hide()},removeCommentAtCell:function(e,t){this.setRange({from:new w(e,t)}),this.removeComment()},show:function(){if(!this.range.from)throw new Error('Before using this method, first set cell range (hot.getPlugin("comment").setRange())');var e=this.hot.getCellMeta(this.range.from.row,this.range.from.col);return this.refreshEditorPosition(!0),this.editor.setValue(e.comment||""),this.editor.show(),!0},showAtCell:function(e,t){return this.setRange({from:new w(e,t)}),this.show()},hide:function(){this.editor.hide()},refreshEditorPosition:function(){var e=void 0!==arguments[0]?arguments[0]:!1;if(e||this.range.from&&this.editor.isVisible()){var t=this.hot.view.wt.wtTable.getCell(this.range.from),n=p(t),o=this.hot.getColWidth(this.range.from.col),r=n.top,i=n.left,s=0,l=0;this.hot.view.wt.wtViewport.hasVerticalScroll()&&(r-=this.hot.view.wt.wtOverlays.topOverlay.getScrollPosition(),s=20),this.hot.view.wt.wtViewport.hasHorizontalScroll()&&(i-=this.hot.view.wt.wtOverlays.leftOverlay.getScrollPosition(),l=20);var a=i+o,u=r,c=this.hot.view.wt.wtTable.holder.getBoundingClientRect(),d={left:c.left+h()+l,right:c.right+h()-15,top:c.top+f()+s,bottom:c.bottom+f()};a<=d.left||a>d.right||u<=d.top||u>d.bottom?this.hide():this.editor.setPosition(a,u)}},onMouseDown:function(e){this.mouseDown=!0,this.hot.view&&this.hot.view.wt&&(this.contextMenuEvent||this.targetIsCommentTextArea(e)||this.targetIsCellWithComment(e)||this.hide(),this.contextMenuEvent=!1)},onMouseOver:function(e){if(!this.mouseDown&&!this.editor.isFocused())if(this.targetIsCellWithComment(e)){var t=this.hot.view.wt.wtTable.getCoords(e.target),n={from:new w(t.row,t.col)};this.setRange(n),this.show()}else this.targetIsCommentTextArea(e)||this.editor.isFocused()||this.hide()},onMouseMove:function(e){var t=this;this.targetIsCommentTextArea(e)&&(this.mouseDown=!0,clearTimeout(this.timer),this.timer=setTimeout(function(){t.mouseDown=!1},200))},onMouseUp:function(e){this.mouseDown=!1},onAfterRenderer:function(e,t){t.comment&&c(e,t.commentedCellClassName)},onEditorBlur:function(e){this.saveComment()},checkSelectionCommentsConsistency:function(){var e=this.hot.getSelectedRange();if(!e)return!1;var t=!1,n=e.from;return this.hot.getCellMeta(n.row,n.col).comment&&(t=!0),t},onContextMenuAddComment:function(){var e=this,t=this.hot.getSelectedRange();this.contextMenuEvent=!0,this.setRange({from:t.from}),this.show(),setTimeout(function(){e.hot&&(e.hot.deselectCell(),e.editor.focus())},10)},onContextMenuRemoveComment:function(e,t){this.contextMenuEvent=!0,this.removeCommentAtCell(t.start.row,t.start.col)},addToContextMenu:function(e){var t=this;e.items.push(Handsontable.plugins.ContextMenu.SEPARATOR,{key:"commentsAddEdit",name:function(){return t.checkSelectionCommentsConsistency()?"Edit Comment":"Add Comment"},callback:function(){return t.onContextMenuAddComment()},disabled:function(){return this.getSelected()?!1:!0}},{key:"commentsRemove",name:function(){return"Delete Comment"},callback:function(e,n){return t.onContextMenuRemoveComment(e,n)},disabled:function(){return!t.checkSelectionCommentsConsistency()}})},destroy:function(){this.editor&&this.editor.destroy(),$traceurRuntime.superGet(this,E.prototype,"destroy").call(this)}},{},C),b("comments",R)},{"3rdparty/walkontable/src/cell/coords":5,_base:58,commentEditor:63,eventManager:41,"helpers/dom/element":45,plugins:57}],65:[function(e,t,n){"use strict";function o(e,t){var n;return i(t,function(t){var o=t.key?t.key.split(":"):null;return Array.isArray(o)&&o[1]===e?(n=t,!1):void 0}),n}Object.defineProperties(n,{CommandExecutor:{get:function(){return s}},__esModule:{value:!0}});var r,i=(r=e("helpers/array"),r&&r.__esModule&&r||{"default":r}).arrayEach,s=function(e){this.hot=e,this.commands={},this.commonCallback=null};$traceurRuntime.createClass(s,{registerCommand:function(e,t){this.commands[e]=t},setCommonCallback:function(e){this.commonCallback=e},execute:function(e){for(var t=[],n=1;n0;if(s)return}}else if(!(t(i)||v(i,"current")&&v(i,"wtBorder")))return;this.open(e)},onMenuAfterOpen:function(){this.hot.runHooks("afterContextMenuShow",this)},onMenuAfterClose:function(){this.hot.listen(),this.hot.runHooks("afterContextMenuHide",this)},destroy:function(){this.close(),this.menu&&this.menu.destroy(),$traceurRuntime.superGet(this,W.prototype,"destroy").call(this)}},{get DEFAULT_ITEMS(){return[T,O,N,_,M,N,H,k,N,A,P,N,x,N,D]}},g),L.SEPARATOR={name:N},Handsontable.hooks.register("afterContextMenuDefaultOptions"),Handsontable.hooks.register("afterContextMenuShow"),Handsontable.hooks.register("afterContextMenuHide"),Handsontable.hooks.register("afterContextMenuExecute"),R("contextMenu",L)},{_base:58,commandExecutor:65,eventManager:41,"helpers/array":42,"helpers/dom/element":45,"helpers/dom/event":46,"helpers/object":50,itemsFactory:68,menu:69,plugins:57,predefinedItems:70}],67:[function(e,t,n){"use strict";Object.defineProperties(n,{Cursor:{get:function(){return d}},__esModule:{value:!0}});var o,r,i=(o=e("helpers/dom/element"),o&&o.__esModule&&o||{"default":o}),s=i.getWindowScrollLeft,l=i.getWindowScrollTop,a=(r=e("helpers/dom/event"),r&&r.__esModule&&r||{"default":r}),u=a.pageX,c=a.pageY,d=function(e){var t,n,o,r,i,a,d,h,f=l(),g=s();this.type=this.getSourceType(e),"literal"===this.type?(t=parseInt(e.top,10),o=parseInt(e.left,10),d=e.height,h=e.width):"event"===this.type&&(t=parseInt(c(e),10),o=parseInt(u(e),10),d=e.target.clientHeight,h=e.target.clientWidth),n=t-f,r=o-g,i=f,a=g,this.top=t,this.topRelative=n,this.left=o,this.leftRelative=r,this.scrollTop=i,this.scrollLeft=a,this.cellHeight=d,this.cellWidth=h};$traceurRuntime.createClass(d,{getSourceType:function(e){var t="literal";return e instanceof Event&&(t="event"),t},fitsAbove:function(e){return this.topRelative>=e.offsetHeight},fitsBelow:function(e){var t=void 0!==arguments[1]?arguments[1]:window.innerHeight;return this.topRelative+e.offsetHeight<=t},fitsOnRight:function(e){var t=void 0!==arguments[1]?arguments[1]:window.innerWidth;return this.leftRelative+this.cellWidth+e.offsetWidth<=t},fitsOnLeft:function(e){return this.leftRelative>=e.offsetWidth}},{}),Handsontable.plugins.utils=Handsontable.plugins.utils||{},Handsontable.plugins.utils.Cursor=d},{"helpers/dom/element":45,"helpers/dom/event":46}],68:[function(e,t,n){"use strict";function o(){var e=void 0!==arguments[0]?arguments[0]:null,t=void 0!==arguments[1]?arguments[1]:[],n=void 0!==arguments[2]?arguments[2]:{},o=[];return e&&e.items?e=e.items:Array.isArray(e)||(e=t),u(e)?a(e,function(e,t){var r=n["string"==typeof e?e:t];r||(r=e),u(e)?c(r,e):"string"==typeof r&&(r={name:r}),void 0===r.key&&(r.key=t), +o.push(r)}):d(e,function(e,t){var r=n[e];!r&&g.indexOf(e)>=0||(r||(r={name:e,key:t+""}),u(e)&&c(r,e),void 0===r.key&&(r.key=t),o.push(r))}),o[0].name===f&&o.shift(),o}Object.defineProperties(n,{ItemsFactory:{get:function(){return m}},__esModule:{value:!0}});var r,i,s,l=(r=e("helpers/object"),r&&r.__esModule&&r||{"default":r}),a=l.objectEach,u=l.isObject,c=l.extend,d=(i=e("helpers/array"),i&&i.__esModule&&i||{"default":i}).arrayEach,h=(s=e("predefinedItems"),s&&s.__esModule&&s||{"default":s}),f=h.SEPARATOR,g=h.ITEMS,p=h.predefinedItems,m=function(e){var t=void 0!==arguments[1]?arguments[1]:null;this.hot=e,this.predefinedItems=p(),this.defaultOrderPattern=t};$traceurRuntime.createClass(m,{setPredefinedItems:function(e){var t=this,n={};this.defaultOrderPattern.length=0,a(e,function(e,o){var r="";e.name===f?(n[f]=e,r=f):isNaN(parseInt(o,10))?(e.key=void 0===e.key?o:e.key,n[o]=e,r=e.key):(n[e.key]=e,r=e.key),t.defaultOrderPattern.push(r)}),this.predefinedItems=n},getVisibleItems:function(){var e=void 0!==arguments[0]?arguments[0]:null,t=this,n={};return a(this.predefinedItems,function(e,o){(!e.hidden||e.hidden&&!e.hidden.apply(t.hot))&&(n[o]=e)}),o(e,this.defaultOrderPattern,n)},getItems:function(){var e=void 0!==arguments[0]?arguments[0]:null;return o(e,this.defaultOrderPattern,this.predefinedItems)}},{})},{"helpers/array":42,"helpers/object":50,predefinedItems:70}],69:[function(e,t,n){"use strict";Object.defineProperties(n,{Menu:{get:function(){return W}},__esModule:{value:!0}});var o,r,i,s,l,a,u,c,d,h,f=(o=e("helpers/dom/element"),o&&o.__esModule&&o||{"default":o}),g=f.addClass,p=f.empty,m=f.fastInnerHTML,w=(f.getComputedStyle,f.getScrollbarWidth),v=(f.getWindowScrollLeft,f.getWindowScrollTop,f.hasClass,f.isChildOf),b=f.removeClass,C=(r=e("helpers/array"),r&&r.__esModule&&r||{"default":r}).arrayEach,y=(i=e("cursor"),i&&i.__esModule&&i||{"default":i}).Cursor,R=(s=e("eventManager"),s&&s.__esModule&&s||{"default":s}).EventManager,E=(l=e("helpers/object"),l&&l.__esModule&&l||{"default":l}),S=(E.extend,E.isObject,E.objectEach,E.mixin),T=(a=e("utils"),a&&a.__esModule&&a||{"default":a}),O=T.isSeparator,_=T.isDisabled,M=T.isSelectionDisabled,H=T.hasSubMenu,k=T.normalizeSelection,A=(u=e("helpers/unicode"),u&&u.__esModule&&u||{"default":u}).KEY_CODES,P=(c=e("mixins/localHooks"),c&&c.__esModule&&c||{"default":c}).localHooks,x=(d=e("predefinedItems"),d&&d.__esModule&&d||{"default":d}),D=x.SEPARATOR,N=(x.predefinedItems,h=e("helpers/dom/event"),h&&h.__esModule&&h||{"default":h}),L=(N.stopPropagation,N.stopImmediatePropagation),W=(N.pageX,N.pageY,function(e){var t=void 0!==arguments[1]?arguments[1]:{parent:null,name:null,className:"",keepInViewport:!0};this.hot=e,this.options=t,this.eventManager=new R(this),this.container=this.createContainer(this.options.name),this.hotMenu=null,this.hotSubMenus={},this.parentMenu=this.options.parent||null,this.menuItems=null,this.origOutsideClickDeselects=null,this._afterScrollCallback=null,this.registerEvents()}),I=W;$traceurRuntime.createClass(W,{registerEvents:function(){var e=this;this.eventManager.addEventListener(document.documentElement,"mousedown",function(t){return e.onDocumentMouseDown(t)})},setMenuItems:function(e){this.menuItems=e},isSubMenu:function(){return null!==this.parentMenu},open:function(){var e=this;this.container.removeAttribute("style"),this.container.style.display="block";var t={data:this.menuItems,colHeaders:!1,colWidths:[200],autoRowSize:!1,readOnly:!0,copyPaste:!1,columns:[{data:"name",renderer:function(t,n,o,r,i,s){return e.menuItemRenderer(t,n,o,r,i,s)}}],renderAllRows:!0,fragmentSelection:"cell",beforeKeyDown:function(t){return e.onBeforeKeyDown(t)},afterOnCellMouseOver:function(t,n,o){return e.openSubMenu(n.row)}};this.origOutsideClickDeselects=this.hot.getSettings().outsideClickDeselects,this.hot.getSettings().outsideClickDeselects=!1,this.hotMenu=new Handsontable.Core(this.container,t),this.hotMenu.addHook("afterInit",function(){return e.onAfterInit()}),this.hotMenu.init(),this.hotMenu.listen(),this.blockMainTableCallbacks(),this.runLocalHooks("afterOpen")},close:function(){var e=void 0!==arguments[0]?arguments[0]:!1;this.isOpened()&&(e&&this.parentMenu?this.parentMenu.close():(this.closeAllSubMenus(),this.container.style.display="none",this.releaseMainTableCallbacks(),this.hotMenu.destroy(),this.hotMenu=null,this.hot.getSettings().outsideClickDeselects=this.origOutsideClickDeselects,this.runLocalHooks("afterClose")))},openSubMenu:function(e){var t=this.hotMenu.getCell(e,0);if(this.closeAllSubMenus(),!t||!H(t))return!1;var n=this.hotMenu.getSourceDataAtRow(e),o=new I(this.hot,{parent:this,name:n.name,className:this.options.className});return o.setMenuItems(n.submenu.items),o.open(),o.setPosition(t.getBoundingClientRect()),this.hotSubMenus[n.key]=o,o},closeSubMenu:function(e){var t=this.hotMenu.getSourceDataAtRow(e),n=this.hotSubMenus[t.key];n&&(n.destroy(),delete this.hotSubMenus[t.key])},closeAllSubMenus:function(){var e=this;C(this.hotMenu.getData(),function(t,n){return e.closeSubMenu(n)})},isAllSubMenusClosed:function(){return 0===Object.keys(this.hotSubMenus).length},destroy:function(){this.clearLocalHooks(),this.close(),this.parentMenu=null,this.eventManager.destroy()},isOpened:function(){return null!==this.hotMenu},executeCommand:function(e){if(this.isOpened()&&this.hotMenu.getSelected()){var t=this.hotMenu.getSourceDataAtRow(this.hotMenu.getSelected()[0]);if(this.runLocalHooks("select",t,e),t.isCommand!==!1){var n=this.hot.getSelectedRange(),o=n?k(n):{};this.runLocalHooks("executeCommand",t.key,o,e),this.isSubMenu()&&this.parentMenu.runLocalHooks("executeCommand",t.key,o,e),this.close(!0)}}},setPosition:function(e){var t=new y(e);this.options.keepInViewport?(t.fitsBelow(this.container)?this.setPositionBelowCursor(t):t.fitsAbove(this.container)?this.setPositionAboveCursor(t):this.setPositionBelowCursor(t),t.fitsOnRight(this.container)?this.setPositionOnRightOfCursor(t):this.setPositionOnLeftOfCursor(t)):(this.setPositionBelowCursor(t),this.setPositionOnRightOfCursor(t))},setPositionAboveCursor:function(e){var t=e.top-this.container.offsetHeight;this.isSubMenu()&&(t=window.scrollY+e.top+e.cellHeight-this.container.offsetHeight+3),this.container.style.top=t+"px"},setPositionBelowCursor:function(e){var t=e.top-1;this.isSubMenu()&&(t=e.top+window.scrollY-1),this.container.style.top=t+"px"},setPositionOnRightOfCursor:function(e){var t;t=this.isSubMenu()?window.scrollX+1+e.left+e.cellWidth:1+e.left,this.container.style.left=t+"px"},setPositionOnLeftOfCursor:function(e){this.container.style.left=e.left-this.container.offsetWidth+w()+4+"px"},selectFirstCell:function(){var e=this.hotMenu.getCell(0,0);O(e)||_(e)||M(e)?this.selectNextCell(0,0):this.hotMenu.selectCell(0,0)},selectLastCell:function(){var e=this.hotMenu.countRows()-1,t=this.hotMenu.getCell(e,0);O(t)||_(t)||M(t)?this.selectPrevCell(e,0):this.hotMenu.selectCell(e,0)},selectNextCell:function(e,t){var n=e+1,o=n=0?this.hotMenu.getCell(n,t):null;o&&(O(o)||_(o)||M(o)?this.selectPrevCell(n,t):this.hotMenu.selectCell(n,t))},menuItemRenderer:function(e,t,n,o,r,i){var s=this,l=e.getSourceDataAtRow(n),a=document.createElement("div"),u=function(e){return e.hasOwnProperty("submenu")},c=function(e){return new RegExp(D,"i").test(e.name)},d=function(e){return e.disabled===!0||"function"==typeof e.disabled&&e.disabled.call(s.hot)===!0},h=function(e){return"function"==typeof e.hidden&&e.hidden.call(s.hot)===!0},f=function(e){return e.disableSelection},w=h(l);"function"==typeof i&&(i=i.call(this.hot)),p(t),g(a,"htItemWrapper"),t.appendChild(a),c(l)?g(t,"htSeparator"):w||"function"!=typeof l.renderer?m(a,i):(g(t,"htCustomMenuRenderer"),t.appendChild(l.renderer(e,a,n,o,r,i))),w?t.parentNode&&g(t.parentNode,"htHidden"):d(l)?(g(t,"htDisabled"),this.eventManager.addEventListener(a,"mouseenter",function(){return e.deselectCell()})):f(l)?(g(t,"htSelectionDisabled"),this.eventManager.addEventListener(a,"mouseenter",function(){return e.deselectCell()})):u(l)?(g(t,"htSubmenu"),f(l)?this.eventManager.addEventListener(a,"mouseenter",function(){return e.deselectCell()}):this.eventManager.addEventListener(a,"mouseenter",function(){return e.selectCell(n,o,void 0,void 0,void 0,!1)})):(b(t,"htSubmenu"),b(t,"htDisabled"),f(l)?this.eventManager.addEventListener(a,"mouseenter",function(){return e.deselectCell()}):this.eventManager.addEventListener(a,"mouseenter",function(){return e.selectCell(n,o,void 0,void 0,void 0,!1)}))},createContainer:function(){var e=void 0!==arguments[0]?arguments[0]:null;e&&(e=e.replace(/ /g,"_"),e=this.options.className+"Sub_"+e);var t;return t=e?document.querySelector("."+this.options.className+"."+e):document.querySelector("."+this.options.className),t||(t=document.createElement("div"),g(t,"htMenu "+this.options.className),e&&g(t,e),document.getElementsByTagName("body")[0].appendChild(t)),t},blockMainTableCallbacks:function(){this._afterScrollCallback=function(){},this.hot.addHook("afterScrollVertically",this._afterScrollCallback),this.hot.addHook("afterScrollHorizontally",this._afterScrollCallback)},releaseMainTableCallbacks:function(){this._afterScrollCallback&&(this.hot.removeHook("afterScrollVertically",this._afterScrollCallback),this.hot.removeHook("afterScrollHorizontally",this._afterScrollCallback),this._afterScrollCallback=null)},onBeforeKeyDown:function(e){var t=this.hotMenu.getSelected(),n=!1;switch(e.keyCode){case A.ESCAPE:this.close(),n=!0;break;case A.ENTER:t&&(this.hotMenu.getSourceDataAtRow(t[0]).submenu?n=!0:(this.executeCommand(e),this.close(!0)));break;case A.ARROW_DOWN:t?this.selectNextCell(t[0],t[1]):this.selectFirstCell(),n=!0;break;case A.ARROW_UP:t?this.selectPrevCell(t[0],t[1]):this.selectLastCell(),n=!0;break;case A.ARROW_RIGHT:if(t){var o=this.openSubMenu(t[0]);o&&o.selectFirstCell()}n=!0;break;case A.ARROW_LEFT:t&&this.isSubMenu()&&(this.close(),this.parentMenu&&this.parentMenu.hotMenu.listen(),n=!0)}n&&(e.preventDefault(),L(e))},onAfterInit:function(){var e=this.hotMenu.getSettings().data,t=this.hotMenu.view.wt.wtTable.hider.style,n=this.hotMenu.view.wt.wtTable.holder.style,o=parseInt(t.width,10),r=0;C(e,function(e){return r+=e.name===D?1:26}),n.width=o+22+"px",n.height=r+4+"px"},onDocumentMouseDown:function(e){this.isOpened()&&(this.container&&v(e.target,this.container)&&this.executeCommand(e),(this.isAllSubMenusClosed()||this.isSubMenu())&&!v(e.target,".htMenu")&&v(e.target,document)&&this.close(!0))}},{}),S(W,P)},{cursor:67,eventManager:41,"helpers/array":42,"helpers/dom/element":45,"helpers/dom/event":46,"helpers/object":50,"helpers/unicode":53,"mixins/localHooks":54,predefinedItems:70,utils:71}],70:[function(e,t,n){"use strict";function o(){var e={};return c(A,function(t,n){return e[n]=d(t)}),e}function r(e,t){-1===k.indexOf(e)&&(A[e]=t)}var i;Object.defineProperties(n,{ROW_ABOVE:{get:function(){return v}},ROW_BELOW:{get:function(){return b}},COLUMN_LEFT:{get:function(){return C}},COLUMN_RIGHT:{get:function(){return y}},CLEAR_COLUMN:{get:function(){return R}},REMOVE_ROW:{get:function(){return E}},REMOVE_COLUMN:{get:function(){return S}},UNDO:{get:function(){return T}},REDO:{get:function(){return O}},READ_ONLY:{get:function(){return _}},ALIGNMENT:{get:function(){return M}},SEPARATOR:{get:function(){return H}},ITEMS:{get:function(){return k}},predefinedItems:{get:function(){return o}},addItem:{get:function(){return r}},__esModule:{value:!0}});var s,l,a,u=(s=e("helpers/object"),s&&s.__esModule&&s||{"default":s}),c=u.objectEach,d=u.clone,h=((l=e("helpers/number"),l&&l.__esModule&&l||{"default":l}).rangeEach,a=e("utils"),a&&a.__esModule&&a||{"default":a}),f=h.align,g=h.getAlignmentClasses,p=h.getValidSelection,m=h.checkSelectionConsistency,w=h.markLabelAsSelected,v="row_above",b="row_below",C="col_left",y="col_right",R="clear_column",E="remove_row",S="remove_col",T="undo",O="redo",_="make_read_only",M="alignment",H="---------",k=[v,b,C,y,R,E,S,T,O,_,M,H],A=(i={},Object.defineProperty(i,H,{value:{name:H},configurable:!0,enumerable:!0,writable:!0}),Object.defineProperty(i,v,{value:{key:v,name:"Insert row above",callback:function(e,t){this.alter("insert_row",t.start.row)},disabled:function(){var e=p(this);if(!e)return!0;var t=this.countRows(),n=[0,e[1],t-1,e[1]];return n.join(",")===e.join(",")&&t>1},hidden:function(){return!this.getSettings().allowInsertRow}},configurable:!0,enumerable:!0,writable:!0}),Object.defineProperty(i,b,{value:{key:b,name:"Insert row below",callback:function(e,t){this.alter("insert_row",t.end.row+1)},disabled:function(){var e=p(this);if(!e)return!0;var t=this.countRows(),n=[0,e[1],t-1,e[1]];return n.join(",")===e.join(",")&&t>1},hidden:function(){return!this.getSettings().allowInsertRow}},configurable:!0,enumerable:!0,writable:!0}),Object.defineProperty(i,C,{value:{key:C,name:"Insert column on the left",callback:function(e,t){this.alter("insert_col",t.start.col)},disabled:function(){var e=p(this);if(!e)return!0;if(!this.isColumnModificationAllowed())return!0;var t=[e[0],0,e[0],this.countCols()-1],n=t.join(",")==e.join(",");return e[1]<0||this.countCols()>=this.getSettings().maxCols||n},hidden:function(){return!this.getSettings().allowInsertColumn}},configurable:!0,enumerable:!0,writable:!0}),Object.defineProperty(i,y,{value:{key:y,name:"Insert column on the right",callback:function(e,t){this.alter("insert_col",t.end.col+1)},disabled:function(){var e=p(this);if(!e)return!0;if(!this.isColumnModificationAllowed())return!0;var t=[e[0],0,e[0],this.countCols()-1],n=t.join(",")==e.join(",");return e[1]<0||this.countCols()>=this.getSettings().maxCols||n},hidden:function(){return!this.getSettings().allowInsertColumn}},configurable:!0,enumerable:!0,writable:!0}),Object.defineProperty(i,R,{value:{key:R,name:"Clear column",callback:function(e,t){var n=t.start.col;this.countRows()&&this.populateFromArray(0,n,[[null]],Math.max(t.start.row,t.end.row),n)},disabled:function(){var e=p(this);if(!e)return!0;var t=[e[0],0,e[0],this.countCols()-1],n=t.join(",")==e.join(",");return e[1]<0||this.countCols()>=this.getSettings().maxCols||n}},configurable:!0,enumerable:!0,writable:!0}),Object.defineProperty(i,E,{value:{key:E,name:"Remove row",callback:function(e,t){var n=t.end.row-t.start.row+1;this.alter("remove_row",t.start.row,n)},disabled:function(){var e=p(this);if(!e)return!0;var t=[0,e[1],this.countRows()-1,e[1]];return t.join(",")===e.join(",")},hidden:function(){return!this.getSettings().allowRemoveRow}},configurable:!0,enumerable:!0,writable:!0}),Object.defineProperty(i,S,{value:{key:S,name:"Remove column",callback:function(e,t){var n=t.end.col-t.start.col+1;this.alter("remove_col",t.start.col,n)},disabled:function(){var e=p(this);if(!e)return!0;if(!this.isColumnModificationAllowed())return!0;var t=[e[0],0,e[0],this.countCols()-1],n=t.join(",")==e.join(",");return e[1]<0||n},hidden:function(){return!this.getSettings().allowRemoveColumn}},configurable:!0,enumerable:!0,writable:!0}),Object.defineProperty(i,T,{value:{key:T,name:"Undo",callback:function(){this.undo()},disabled:function(){return this.undoRedo&&!this.undoRedo.isUndoAvailable()}},configurable:!0,enumerable:!0,writable:!0}),Object.defineProperty(i,O,{value:{key:O,name:"Redo",callback:function(){this.redo()},disabled:function(){return this.undoRedo&&!this.undoRedo.isRedoAvailable()}},configurable:!0,enumerable:!0,writable:!0}),Object.defineProperty(i,_,{value:{key:_,name:function(){var e=this,t="Read only",n=m(this.getSelectedRange(),function(t,n){return e.getCellMeta(t,n).readOnly});return n&&(t=w(t)),t},callback:function(){var e=this,t=this.getSelectedRange(),n=m(t,function(t,n){return e.getCellMeta(t,n).readOnly});t.forAll(function(t,o){e.getCellMeta(t,o).readOnly=n?!1:!0}),this.render()},disabled:function(){return this.getSelectedRange()?!1:!0}},configurable:!0,enumerable:!0,writable:!0}),Object.defineProperty(i,M,{value:{key:M,name:"Alignment",disabled:function(){return this.getSelectedRange()?!1:!0},submenu:{items:[{key:M+":left",name:function(){var e=this,t="Left",n=m(this.getSelectedRange(),function(t,n){var o=e.getCellMeta(t,n).className;return o&&-1!==o.indexOf("htLeft")?!0:void 0});return n&&(t=w(t)),t},callback:function(){var e=this,t=this.getSelectedRange(),n=g(t,function(t,n){return e.getCellMeta(t,n).className}),o="horizontal",r="htLeft";this.runHooks("beforeCellAlignment",n,t,o,r),f(t,o,r,function(t,n){return e.getCellMeta(t,n)}),this.render()},disabled:!1},{key:M+":center",name:function(){var e=this,t="Center",n=m(this.getSelectedRange(),function(t,n){var o=e.getCellMeta(t,n).className;return o&&-1!==o.indexOf("htCenter")?!0:void 0});return n&&(t=w(t)),t},callback:function(){var e=this,t=this.getSelectedRange(),n=g(t,function(t,n){return e.getCellMeta(t,n).className}),o="horizontal",r="htCenter";this.runHooks("beforeCellAlignment",n,t,o,r),f(t,o,r,function(t,n){return e.getCellMeta(t,n)}),this.render()},disabled:!1},{key:M+":right",name:function(){var e=this,t="Right",n=m(this.getSelectedRange(),function(t,n){var o=e.getCellMeta(t,n).className;return o&&-1!==o.indexOf("htRight")?!0:void 0});return n&&(t=w(t)),t},callback:function(){var e=this,t=this.getSelectedRange(),n=g(t,function(t,n){return e.getCellMeta(t,n).className}),o="horizontal",r="htRight";this.runHooks("beforeCellAlignment",n,t,o,r),f(t,o,r,function(t,n){return e.getCellMeta(t,n)}),this.render()},disabled:!1},{key:M+":justify",name:function(){var e=this,t="Justify",n=m(this.getSelectedRange(),function(t,n){var o=e.getCellMeta(t,n).className;return o&&-1!==o.indexOf("htJustify")?!0:void 0});return n&&(t=w(t)),t},callback:function(){var e=this,t=this.getSelectedRange(),n=g(t,function(t,n){return e.getCellMeta(t,n).className}),o="horizontal",r="htJustify";this.runHooks("beforeCellAlignment",n,t,o,r),f(t,o,r,function(t,n){return e.getCellMeta(t,n)}),this.render()},disabled:!1},{name:H},{key:M+":top",name:function(){var e=this,t="Top",n=m(this.getSelectedRange(),function(t,n){var o=e.getCellMeta(t,n).className;return o&&-1!==o.indexOf("htTop")?!0:void 0});return n&&(t=w(t)),t},callback:function(){var e=this,t=this.getSelectedRange(),n=g(t,function(t,n){return e.getCellMeta(t,n).className}),o="vertical",r="htTop";this.runHooks("beforeCellAlignment",n,t,o,r),f(t,o,r,function(t,n){return e.getCellMeta(t,n)}),this.render()},disabled:!1},{key:M+":middle",name:function(){var e=this,t="Middle",n=m(this.getSelectedRange(),function(t,n){var o=e.getCellMeta(t,n).className;return o&&-1!==o.indexOf("htMiddle")?!0:void 0});return n&&(t=w(t)),t},callback:function(){var e=this,t=this.getSelectedRange(),n=g(t,function(t,n){return e.getCellMeta(t,n).className}),o="vertical",r="htMiddle";this.runHooks("beforeCellAlignment",n,t,o,r),f(t,o,r,function(t,n){return e.getCellMeta(t,n)}),this.render()},disabled:!1},{key:M+":bottom",name:function(){var e=this,t="Bottom",n=m(this.getSelectedRange(),function(t,n){var o=e.getCellMeta(t,n).className;return o&&-1!==o.indexOf("htBottom")?!0:void 0});return n&&(t=w(t)),t},callback:function(){var e=this,t=this.getSelectedRange(),n=g(t,function(t,n){return e.getCellMeta(t,n).className}),o="vertical",r="htBottom";this.runHooks("beforeCellAlignment",n,t,o,r),f(t,o,r,function(t,n){return e.getCellMeta(t,n)}),this.render()},disabled:!1}]}},configurable:!0,enumerable:!0,writable:!0}),i)},{"helpers/number":49,"helpers/object":50,utils:71}],71:[function(e,t,n){"use strict";function o(e){return{start:e.getTopLeftCorner(),end:e.getBottomRightCorner()}}function r(e){return w(e,"htSeparator")}function i(e){return w(e,"htSubmenu")}function s(e){return w(e,"htDisabled")}function l(e){return w(e,"htSelectionDisabled")}function a(e){var t=e.getSelected();return t?t[0]<0?null:e.countRows()>=e.getSettings().maxRows?null:t:null}function u(e,t){return-1!=e.indexOf(t)?e:(e=e.replace("htTop","").replace("htMiddle","").replace("htBottom","").replace(" ",""),e+=" "+t)}function c(e,t){return-1!=e.indexOf(t)?e:(e=e.replace("htLeft","").replace("htCenter","").replace("htRight","").replace("htJustify","").replace(" ",""),e+=" "+t)}function d(e,t){for(var n={},o=e.from.row;o<=e.to.row;o++)for(var r=e.from.col;r<=e.to.col;r++)n[o]||(n[o]=[]),n[o][r]=t(o,r);return n}function h(e,t,n,o){if(e.from.row==e.to.row&&e.from.col==e.to.col)f(e.from.row,e.from.col,t,n,o);else for(var r=e.from.row;r<=e.to.row;r++)for(var i=e.from.col;i<=e.to.col;i++)f(r,i,t,n,o)}function f(e,t,n,o,r){var i=r(e,t),s=o;i.className&&(s="vertical"===n?u(i.className,o):c(i.className,o)),i.className=s}function g(e,t){var n=!1;return e&&e.forAll(function(e,o){return t(e,o)?(n=!0,!1):void 0}),n}function p(e){return''+String.fromCharCode(10003)+""+e}Object.defineProperties(n,{normalizeSelection:{get:function(){return o}},isSeparator:{get:function(){return r}},hasSubMenu:{get:function(){return i}},isDisabled:{get:function(){return s}},isSelectionDisabled:{get:function(){return l}},getValidSelection:{get:function(){return a}},prepareVerticalAlignClass:{get:function(){return u}},prepareHorizontalAlignClass:{get:function(){return c}},getAlignmentClasses:{get:function(){return d}},align:{get:function(){return h}},checkSelectionConsistency:{get:function(){return g}},markLabelAsSelected:{get:function(){return p}},__esModule:{value:!0}});var m,w=(m=e("helpers/dom/element"),m&&m.__esModule&&m||{"default":m}).hasClass},{"helpers/dom/element":45}],72:[function(e,t,n){"use strict";Object.defineProperties(n,{ContextMenuCopyPaste:{get:function(){return p}},__esModule:{value:!0}});var o,r,i,s,l,a,u=(o=e("helpers/dom/element"),o&&o.__esModule&&o||{"default":o}).removeClass,c=(r=e("helpers/array"),r&&r.__esModule&&r||{"default":r}).arrayEach,d=(i=e("eventManager"),i&&i.__esModule&&i||{"default":i}).EventManager,h=(s=e("plugins"),s&&s.__esModule&&s||{"default":s}).registerPlugin,f=(l=e("_base"),l&&l.__esModule&&l||{"default":l})["default"],g=(a=e("zeroclipboard"),a&&a.__esModule&&a||{"default":a})["default"],p=function(e){$traceurRuntime.superConstructor(m).call(this,e),this.eventManager=new d(this),this.swfPath=null,this.outsideClickDeselectsCache=null},m=p;$traceurRuntime.createClass(p,{isEnabled:function(){return this.hot.getSettings().contextMenuCopyPaste},enablePlugin:function(){var e=this;if(!this.enabled){"object"==typeof this.hot.getSettings().contextMenuCopyPaste&&(this.swfPath=this.hot.getSettings().contextMenuCopyPaste.swfPath),"undefined"==typeof g&&console.error("To be able to use the Copy/Paste feature from the context menu, you need to manually include ZeroClipboard.js file to your website.");try{new ActiveXObject("ShockwaveFlash.ShockwaveFlash")}catch(t){"undefined"==typeof navigator.mimeTypes["application/x-shockwave-flash"]&&console.error("To be able to use the Copy/Paste feature from the context menu, your browser needs to have Flash Plugin installed.")}this.swfPath&&g.config({swfPath:this.swfPath}),this.hot.addHook("afterContextMenuShow",function(){return e.onAfterContextMenuShow()}),this.hot.addHook("afterContextMenuDefaultOptions",function(t){return e.onAfterContextMenuDefaultOptions(t)}),this.registerEvents(),$traceurRuntime.superGet(this,m.prototype,"enablePlugin").call(this)}},disablePlugin:function(){$traceurRuntime.superGet(this,m.prototype,"disablePlugin").call(this)},registerEvents:function(){var e=this;this.eventManager.addEventListener(document,"mouseenter",function(){return e.removeCurrentClass()}),this.eventManager.addEventListener(document,"mouseleave",function(){return e.removeZeroClipboardClass()})},getCopyValue:function(){return this.hot.copyPaste.setCopyableText(),this.hot.copyPaste.copyPasteInstance.elTextarea.value},onAfterContextMenuDefaultOptions:function(e){e.items.unshift({key:"copy",name:"Copy"},{key:"paste",name:"Paste",callback:function(){this.copyPaste.triggerPaste()}},Handsontable.plugins.ContextMenu.SEPARATOR)},onAfterContextMenuShow:function(){var e=this,t=this.hot.getPlugin("contextMenu"),n=t.menu.hotMenu.getSourceData();c(n,function(n,o){if("copy"===n.key){var r=new g(t.menu.hotMenu.getCell(o,0));return r.off(),r.on("copy",function(t){var n=t.clipboardData;n.setData("text/plain",e.getCopyValue()),e.hot.getSettings().outsideClickDeselects=e.outsideClickDeselectsCache}),!1}})},removeCurrentClass:function(){var e=this.hot.getPlugin("contextMenu");if(e.menu.isOpened()){var t=e.menu.hotMenu.rootElement.querySelector("td.current");t&&u(t,"current")}this.outsideClickDeselectsCache=this.hot.getSettings().outsideClickDeselects,this.hot.getSettings().outsideClickDeselects=!1},removeZeroClipboardClass:function(){var e=this.hot.getPlugin("contextMenu");if(e.menu.isOpened()){var t=e.menu.hotMenu.rootElement.querySelector("td.zeroclipboard-is-hover");t&&u(t,"zeroclipboard-is-hover")}this.hot.getSettings().outsideClickDeselects=this.outsideClickDeselectsCache}},{},f),h("contextMenuCopyPaste",p)},{_base:58,eventManager:41,"helpers/array":42,"helpers/dom/element":45,plugins:57,zeroclipboard:void 0}],73:[function(e,t,n){"use strict";function o(e){function t(){e.isListening()&&e.selection.empty()}function n(t){var n,o,r,i,s,l,a,u,c,d;if(e.isListening()&&e.selection.isSelected()){n=t,o=w.parse(n),r=e.getSelected(),i=new M(r[0],r[1]),s=new M(r[2],r[3]),l=new H(i,i,s),a=l.getTopLeftCorner(),u=l.getBottomRightCorner(),c=a,d=new M(Math.max(u.row,o.length-1+a.row),Math.max(u.col,o[0].length-1+a.col));var h=s.row-i.row>=o.length-1,f=s.col-i.col>=o[0].length-1;e.addHookOnce("afterChange",function(t,n){var o=t?t.length:0;if(o){var r={row:0,col:0},i=-1;y(t,function(e,n){var s=o>n+1?t[n+1]:null;s&&(h||(r.row=r.row+Math.max(s[0]-e[0]-1,0)),!f&&e[1]>i&&(i=e[1],r.col=r.col+Math.max(s[1]-e[1]-1,0)))}),e.selectCell(c.row,c.col,d.row+r.row,d.col+r.col)}}),e.populateFromArray(c.row,c.col,o,d.row,d.col,"paste",e.getSettings().pasteMode)}}function o(t){if(e.getSelected()&&!(e.getActiveEditor()&&e.getActiveEditor().isOpened()||T(t))){if(C(t.keyCode)){if(e.getSettings().fragmentSelection&&O())return;return r.setCopyableText(),void S(t)}var n=(t.ctrlKey||t.metaKey)&&!t.altKey;t.keyCode==b.A&&n&&e._registerTimeout(setTimeout(_(r.setCopyableText,r),0))}}var r=this;this.copyPasteInstance=m(),this.copyPasteInstance.onCut(t),this.copyPasteInstance.onPaste(n),this.onPaste=n,e.addHook("beforeKeyDown",o),this.destroy=function(){this.copyPasteInstance&&(this.copyPasteInstance.removeCallback(t),this.copyPasteInstance.removeCallback(n),this.copyPasteInstance.destroy(),this.copyPasteInstance=null),e.removeHook("beforeKeyDown",o)},e.addHook("afterDestroy",_(this.destroy,this)),this.triggerPaste=_(this.copyPasteInstance.triggerPaste,this.copyPasteInstance),this.triggerCut=_(this.copyPasteInstance.triggerCut,this.copyPasteInstance),this.setCopyableText=function(){var t=e.getSettings(),n=t.copyRowsLimit,o=t.copyColsLimit,r=e.getSelectedRange(),i=r.getTopLeftCorner(),s=r.getBottomRightCorner(),l=i.row,a=i.col,u=s.row,c=s.col,d=Math.min(u,l+n-1),h=Math.min(c,a+o-1),f=[];f.push({startRow:l,startCol:a,endRow:d,endCol:h}),f=Handsontable.hooks.run(e,"modifyCopyableRange",f);var g=this.getRangedCopyableData(f);e.copyPaste.copyPasteInstance.copyable(g),(u!==d||c!==h)&&Handsontable.hooks.run(e,"afterCopyLimit",u-l+1,c-a+1,n,o)},this.getRangedCopyableData=function(t){var n=[],o=[],r=[];return y(t,function(e){R(e.startRow,e.endRow,function(e){-1===o.indexOf(e)&&o.push(e)}),R(e.startCol,e.endCol,function(e){-1===r.indexOf(e)&&r.push(e)})}),y(o,function(t){var o=[];y(r,function(n){o.push(e.getCopyableData(t,n))}),n.push(o)}),w.stringify(n)}}function r(){var e=this,t=e.getSettings().copyPaste!==!1;t&&!e.copyPaste?e.copyPaste=new o(e):!t&&e.copyPaste&&(e.copyPaste.destroy(),e.copyPaste=null)}Object.defineProperties(n,{CopyPastePlugin:{get:function(){return o}},__esModule:{value:!0}});var i,s,l,a,u,c,d,h,f,g,p,m=(i=e("copyPaste"),i&&i.__esModule&&i||{"default":i})["default"],w=(s=e("SheetClip"),s&&s.__esModule&&s||{"default":s})["default"],v=(l=e("helpers/unicode"),l&&l.__esModule&&l||{"default":l}),b=v.KEY_CODES,C=v.isCtrlKey,y=(a=e("helpers/array"),a&&a.__esModule&&a||{"default":a}).arrayEach,R=(u=e("helpers/number"),u&&u.__esModule&&u||{"default":u}).rangeEach,E=(c=e("helpers/dom/event"),c&&c.__esModule&&c||{"default":c}),S=E.stopImmediatePropagation,T=E.isImmediatePropagationStopped,O=(d=e("helpers/dom/element"),d&&d.__esModule&&d||{"default":d}).getSelectionText,_=(h=e("helpers/function"),h&&h.__esModule&&h||{"default":h}).proxy,M=((f=e("plugins"),f&&f.__esModule&&f||{"default":f}).registerPlugin,(g=e("3rdparty/walkontable/src/cell/coords"),g&&g.__esModule&&g||{"default":g}).WalkontableCellCoords),H=(p=e("3rdparty/walkontable/src/cell/range"),p&&p.__esModule&&p||{"default":p}).WalkontableCellRange;Handsontable.hooks.add("afterInit",r),Handsontable.hooks.add("afterUpdateSettings",r),Handsontable.hooks.register("afterCopyLimit"),Handsontable.hooks.register("modifyCopyableRange")},{"3rdparty/walkontable/src/cell/coords":5,"3rdparty/walkontable/src/cell/range":6,SheetClip:"SheetClip",copyPaste:"copyPaste","helpers/array":42,"helpers/dom/element":45,"helpers/dom/event":46,"helpers/function":47,"helpers/number":49,"helpers/unicode":53,plugins:57}],74:[function(e,t,n){"use strict";function o(){}var r,i,s,l,a=((r=e("plugins"),r&&r.__esModule&&r||{"default":r}).registerPlugin,(i=e("3rdparty/walkontable/src/cell/range"),i&&i.__esModule&&i||{"default":i}).WalkontableCellRange),u=(s=e("3rdparty/walkontable/src/selection"),s&&s.__esModule&&s||{"default":s}).WalkontableSelection,c=function(e){return"boolean"==typeof e&&e===!0?!0:"object"==typeof e&&e.length>0?!0:!1},d=function(){c(this.getSettings().customBorders)&&(this.customBorders||(l=this,this.customBorders=new o))},h=function(e){for(var t=0;t=0?l.view.wt.selections[o]=n:l.view.wt.selections.push(n)},g=function(e,t,n){var o=C(e,t);o=y(o,n),this.setCellMeta(e,t,"borders",o),f(o)},p=function(e){for(var t=e.range,n=t.from.row;n<=t.to.row;n++)for(var o=t.from.col;o<=t.to.col;o++){var r=C(n,o),i=0;n==t.from.row&&(i++,e.hasOwnProperty("top")&&(r.top=e.top)),n==t.to.row&&(i++,e.hasOwnProperty("bottom")&&(r.bottom=e.bottom)),o==t.from.col&&(i++,e.hasOwnProperty("left")&&(r.left=e.left)),o==t.to.col&&(i++,e.hasOwnProperty("right")&&(r.right=e.right)),i>0&&(this.setCellMeta(n,o,"borders",r),f(r))}},m=function(e,t){return"border_row"+e+"col"+t},w=function(){return{width:1,color:"#000"}},v=function(){return{hide:!0}},b=function(){return{width:1,color:"#000",cornerVisible:!1}},C=function(e,t){return{className:m(e,t),border:b(),row:e,col:t,top:v(),right:v(),bottom:v(),left:v()}},y=function(e,t){return t.hasOwnProperty("border")&&(e.border=t.border),t.hasOwnProperty("top")&&(e.top=t.top),t.hasOwnProperty("right")&&(e.right=t.right),t.hasOwnProperty("bottom")&&(e.bottom=t.bottom),t.hasOwnProperty("left")&&(e.left=t.left),e},R=function(e){for(var t=document.querySelectorAll("."+e),n=0;n'+String.fromCharCode(10003)+""+e},M=function(e){this.getSettings().customBorders&&(e.items.push(Handsontable.plugins.ContextMenu.SEPARATOR),e.items.push({key:"borders",name:"Borders",submenu:{items:[{key:"borders:top",name:function(){var e="Top",t=O(this,"top");return t&&(e=_(e)),e},callback:function(){var e=O(this,"top");T.call(this,this.getSelectedRange(),"top",e)},disabled:!1},{key:"borders:right",name:function(){var e="Right",t=O(this,"right");return t&&(e=_(e)),e},callback:function(){var e=O(this,"right");T.call(this,this.getSelectedRange(),"right",e)},disabled:!1},{key:"borders:bottom",name:function(){var e="Bottom",t=O(this,"bottom");return t&&(e=_(e)),e},callback:function(){var e=O(this,"bottom");T.call(this,this.getSelectedRange(),"bottom",e)},disabled:!1},{key:"borders:left",name:function(){var e="Left",t=O(this,"left");return t&&(e=_(e)),e},callback:function(){var e=O(this,"left");T.call(this,this.getSelectedRange(),"left",e)},disabled:!1},{key:"borders:no_borders",name:"Remove border(s)",callback:function(){T.call(this,this.getSelectedRange(),"noBorders")},disabled:function(){return!O(this)}}]}}))};Handsontable.hooks.add("beforeInit",d),Handsontable.hooks.add("afterContextMenuDefaultOptions",M),Handsontable.hooks.add("afterInit",function(){var e=this.getSettings().customBorders;if(e){for(var t=0;tthis.boundaries.bottom&&(o=t-this.boundaries.bottom),ethis.boundaries.right&&(n=e-this.boundaries.right),this.callback(n,o)};var l,a=function(e){e.dragToScrollListening=!1;var t=e.view.wt.wtTable.holder;l=new o,t!==window&&(l.setBoundaries(t.getBoundingClientRect()),l.setCallback(function(e,n){0>e?t.scrollLeft-=50:e>0&&(t.scrollLeft+=50),0>n?t.scrollTop-=20:n>0&&(t.scrollTop+=20)}),e.dragToScrollListening=!0)};Handsontable.hooks.add("afterInit",function(){var e=this,t=s(this);t.addEventListener(document,"mouseup",function(){e.dragToScrollListening=!1}),t.addEventListener(document,"mousemove",function(t){e.dragToScrollListening&&l.check(t.clientX,t.clientY)})}),Handsontable.hooks.add("afterDestroy",function(){s(this).clear()}),Handsontable.hooks.add("afterOnCellMouseDown",function(){a(this)}),Handsontable.hooks.add("afterOnCellCornerMouseDown",function(){a(this)}),Handsontable.plugins.DragToScroll=o},{eventManager:41,plugins:57}],76:[function(e,t,n){"use strict";Object.defineProperties(n,{ManualColumnFreeze:{get:function(){return l}},__esModule:{value:!0}});var o,r,i=(o=e("_base"),o&&o.__esModule&&o||{"default":o})["default"],s=(r=e("plugins"),r&&r.__esModule&&r||{"default":r}).registerPlugin,l=function(e){$traceurRuntime.superConstructor(a).call(this,e)},a=l;$traceurRuntime.createClass(l,{isEnabled:function(){return!!this.hot.getSettings().manualColumnFreeze},enablePlugin:function(){var e=this;this.enabled||(this.addHook("modifyCol",function(t){return e.onModifyCol(t)}),this.addHook("afterContextMenuDefaultOptions",function(t){return e.addContextMenuEntry(t)}),$traceurRuntime.superGet(this,a.prototype,"enablePlugin").call(this))},disablePlugin:function(){$traceurRuntime.superGet(this,a.prototype,"disablePlugin").call(this)},init:function(){$traceurRuntime.superGet(this,a.prototype,"init").call(this),"undefined"==typeof this.hot.manualColumnPositionsPluginUsages?this.hot.manualColumnPositionsPluginUsages=["manualColumnFreeze"]:this.hot.manualColumnPositionsPluginUsages.push("manualColumnFreeze"),this.fixedColumnsCount=this.hot.getSettings().fixedColumnsLeft},onModifyCol:function(e){return this.hot.manualColumnPositionsPluginUsages.length>1?e:this.getModifiedColumnIndex(e)},getModifiedColumnIndex:function(e){return this.hot.manualColumnPositions[e]},addContextMenuEntry:function(e){var t=this;e.items.push(Handsontable.plugins.ContextMenu.SEPARATOR,{key:"freeze_column",name:function(){var e=t.hot.getSelected()[1];return e>t.fixedColumnsCount-1?"Freeze this column":"Unfreeze this column"},disabled:function(){var e=t.hot.getSelected();return e[1]!==e[3]},callback:function(){var e=t.hot.getSelected()[1];e>t.fixedColumnsCount-1?t.freezeColumn(e):t.unfreezeColumn(e)}})},freezeColumn:function(e){if(!(e<=this.fixedColumnsCount-1)){var t=this.getModifiedColumnIndex(e)||e;this.checkPositionData(t),this.modifyColumnOrder(t,e,null,"freeze"),this.addFixedColumn(),this.hot.view.wt.wtOverlays.leftOverlay.refresh(),this.hot.view.wt.wtOverlays.adjustElementsSize()}},unfreezeColumn:function(e){if(!(e>this.fixedColumnsCount-1)){var t=this.getBestColumnReturnPosition(e),n=this.getModifiedColumnIndex(e)||e;this.checkPositionData(n),this.modifyColumnOrder(n,e,t,"unfreeze"),this.removeFixedColumn(),this.hot.view.wt.wtOverlays.leftOverlay.refresh(),this.hot.view.wt.wtOverlays.adjustElementsSize()}},addFixedColumn:function(){this.hot.updateSettings({fixedColumnsLeft:this.fixedColumnsCount+1}),this.fixedColumnsCount++},removeFixedColumn:function(){this.hot.updateSettings({fixedColumnsLeft:this.fixedColumnsCount-1}),this.fixedColumnsCount--},checkPositionData:function(e){this.hot.manualColumnPositions&&0!==this.hot.manualColumnPositions.length||this.hot.manualColumnPositions||(this.hot.manualColumnPositions=[]),e?this.hot.manualColumnPositions[e]||this.createPositionData(e+1):this.createPositionData(this.hot.countCols())},createPositionData:function(e){if(this.hot.manualColumnPositions.lengtht;t++)this.hot.manualColumnPositions[t]=t},modifyColumnOrder:function(e,t,n,o){null==n&&(n=e),"freeze"===o?this.hot.manualColumnPositions.splice(this.fixedColumnsCount,0,this.hot.manualColumnPositions.splice(t,1)[0]):"unfreeze"===o&&this.hot.manualColumnPositions.splice(n,0,this.hot.manualColumnPositions.splice(t,1)[0])},getBestColumnReturnPosition:function(e){for(var t=this.fixedColumnsCount,n=this.getModifiedColumnIndex(t),o=this.getModifiedColumnIndex(e);o>n;)t++,n=this.getModifiedColumnIndex(t);return t-1}},{},i),s("manualColumnFreeze",l)},{_base:58,plugins:57}],77:[function(e,t,n){"use strict";function o(){function e(e){p=this,m=e;var t=this.view.wt.wtTable.getCoords(e).col;if(t>=0){f=t;var n=m.getBoundingClientRect();a=n.left,w.style.top=n.top+"px",w.style.left=a+"px",p.rootElement.appendChild(w)}}function t(e,t){var n=e.getBoundingClientRect(),o=6;t>0?w.style.left=n.left+n.width-o+"px":w.style.left=n.left+"px"}function n(){var e=this;u(w,"active"),u(v,"active");var t=m.getBoundingClientRect();v.style.width=t.width+"px",v.style.height=e.view.maximumVisibleElementHeight(0)+"px",v.style.top=w.style.top,v.style.left=a+"px",e.rootElement.appendChild(v)}function o(e){v.style.left=a+e+"px"}function r(){d(w,"active"),d(v,"active")}var i,s,l,a,f,p,m,w=document.createElement("DIV"),v=document.createElement("DIV"),b=h(this);w.className="manualColumnMover",v.className="manualColumnMoverGuide";var C=function(){var e=this;Handsontable.hooks.run(e,"persistentStateSave","manualColumnPositions",e.manualColumnPositions)},y=function(){var e=this,t={};return Handsontable.hooks.run(e,"persistentStateLoad","manualColumnPositions",t),t.value},R=function(e){return"BODY"!=e.tagName?"THEAD"==e.parentNode.tagName?!0:(e=e.parentNode,R(e)):!1},E=function(e){return"TABLE"!=e.tagName?"TH"==e.tagName?e:E(e.parentNode):null},S=function(){var a,u=this;b.addEventListener(u.rootElement,"mouseover",function(n){if(R(n.target)){var o=E(n.target);if(o)if(a){var r=u.view.wt.wtTable.getCoords(o).col;r>=0&&(s=r,t(n.target,s-i))}else e.call(u,o)}}),b.addEventListener(u.rootElement,"mousedown",function(e){c(e.target,"manualColumnMover")&&(l=g(e),n.call(u),a=u,i=f,s=f)}),b.addEventListener(window,"mousemove",function(e){a&&o(g(e)-l)}),b.addEventListener(window,"mouseup",function(t){a&&(r(),a=!1,O(u.manualColumnPositions,u.countCols()),u.manualColumnPositions.splice(s,0,u.manualColumnPositions.splice(i,1)[0]),Handsontable.hooks.run(u,"beforeColumnMove",i,s),u.forceFullRender=!0,u.view.render(),C.call(u),Handsontable.hooks.run(u,"afterColumnMove",i,s),e.call(u,m))}),u.addHook("afterDestroy",T)},T=function(){b.clear()},O=function(e,t){if(e.lengthn;n++)e[n]=n};this.beforeInit=function(){this.manualColumnPositions=[]},this.init=function(e){var t=this,n=!!this.getSettings().manualColumnMove;if(n){var o=this.getSettings().manualColumnMove,r=y.call(t);"undefined"!=typeof r?this.manualColumnPositions=r:Array.isArray(o)?this.manualColumnPositions=o:this.manualColumnPositions=[],("afterInit"===e||"afterUpdateSettings"===e&&0===b.context.eventListeners.length)&&("undefined"==typeof t.manualColumnPositionsPluginUsages?t.manualColumnPositionsPluginUsages=["manualColumnMove"]:t.manualColumnPositionsPluginUsages.push("manualColumnMove"),S.call(this),this.manualColumnPositions.length>0&&(this.forceFullRender=!0,this.render()))}else{var i=t.manualColumnPositionsPluginUsages?t.manualColumnPositionsPluginUsages.indexOf("manualColumnMove"):-1;i>-1&&(T.call(this),this.manualColumnPositions=[],t.manualColumnPositionsPluginUsages[i]=void 0)}},this.modifyCol=function(e){return this.getSettings().manualColumnMove?("undefined"==typeof this.manualColumnPositions[e]&&O(this.manualColumnPositions,e+1),this.manualColumnPositions[e]):e},this.afterRemoveCol=function(e,t){if(this.getSettings().manualColumnMove){var n,o=this.manualColumnPositions;n=o.splice(e,t),o=o.map(function(e){var t,o=e;for(t=0;tn[t]&&o--;return o}),this.manualColumnPositions=o}},this.afterCreateCol=function(e,t){if(this.getSettings().manualColumnMove){var n=this.manualColumnPositions;if(n.length){for(var o=[],r=0;t>r;r++)o.push(e+r);e>=n.length?n.concat(o):(n=n.map(function(n){return n>=e?n+t:n}),n.splice.apply(n,[e,0].concat(o))),this.manualColumnPositions=n}}}}Object.defineProperties(n,{ManualColumnMove:{get:function(){return o}},__esModule:{value:!0}});var r,i,s,l,a=(r=e("helpers/dom/element"),r&&r.__esModule&&r||{"default":r}),u=a.addClass,c=a.hasClass,d=a.removeClass,h=(i=e("eventManager"),i&&i.__esModule&&i||{"default":i}).eventManager,f=(s=e("helpers/dom/event"),s&&s.__esModule&&s||{"default":s}),g=f.pageX,p=(f.pageY,(l=e("plugins"),l&&l.__esModule&&l||{"default":l}).registerPlugin,new o);Handsontable.hooks.add("beforeInit",p.beforeInit),Handsontable.hooks.add("afterInit",function(){p.init.call(this,"afterInit")}),Handsontable.hooks.add("afterUpdateSettings",function(){p.init.call(this,"afterUpdateSettings")}),Handsontable.hooks.add("modifyCol",p.modifyCol),Handsontable.hooks.add("afterRemoveCol",p.afterRemoveCol),Handsontable.hooks.add("afterCreateCol",p.afterCreateCol),Handsontable.hooks.register("beforeColumnMove"),Handsontable.hooks.register("afterColumnMove")},{eventManager:41,"helpers/dom/element":45,"helpers/dom/event":46,plugins:57}],78:[function(e,t,n){"use strict";Object.defineProperties(n,{ManualColumnResize:{get:function(){return w}},__esModule:{value:!0}});var o,r,i,s,l,a=(o=e("_base.js"),o&&o.__esModule&&o||{"default":o})["default"],u=(r=e("helpers/dom/element"),r&&r.__esModule&&r||{"default":r}),c=u.addClass,d=u.hasClass,h=u.removeClass,f=(i=e("eventManager"),i&&i.__esModule&&i||{"default":i}).eventManager,g=(s=e("helpers/dom/event"),s&&s.__esModule&&s||{"default":s}),p=g.pageX,m=(g.pageY,(l=e("plugins"),l&&l.__esModule&&l||{"default":l}).registerPlugin),w=function(e){$traceurRuntime.superConstructor(v).call(this,e),this.currentTH=null,this.currentCol=null,this.currentWidth=null,this.newSize=null,this.startY=null,this.startWidth=null,this.startOffset=null,this.handle=document.createElement("DIV"),this.guide=document.createElement("DIV"),this.eventManager=f(this),this.pressed=null,this.dblclick=0,this.autoresizeTimeout=null,this.manualColumnWidths=[],c(this.handle,"manualColumnResizer"),c(this.guide,"manualColumnResizerGuide")},v=w;$traceurRuntime.createClass(w,{isEnabled:function(){return this.hot.getSettings().manualColumnResize},enablePlugin:function(){var e=this;if(!this.enabled){this.manualColumnWidths=[];var t=this.hot.getSettings().manualColumnResize,n=this.loadManualColumnWidths();this.addHook("modifyColWidth",function(t,n){return e.onModifyColWidth(t,n)}),"undefined"!=typeof n?this.manualColumnWidths=n:Array.isArray(t)?this.manualColumnWidths=t:this.manualColumnWidths=[],Handsontable.hooks.register("beforeColumnResize"),Handsontable.hooks.register("afterColumnResize"),this.bindEvents(),$traceurRuntime.superGet(this,v.prototype,"enablePlugin").call(this)}},updatePlugin:function(){var e=this.hot.getSettings().manualColumnResize;Array.isArray(e)?this.manualColumnWidths=e:this.manualColumnWidths=[]},disablePlugin:function(){$traceurRuntime.superGet(this,v.prototype,"disablePlugin").call(this)},saveManualColumnWidths:function(){this.hot.runHooks("persistentStateSave","manualColumnWidths",this.manualColumnWidths)},loadManualColumnWidths:function(){var e={};return this.hot.runHooks("persistentStateLoad","manualColumnWidths",e),e.value},setupHandlePosition:function(e){this.currentTH=e;var t=this.hot.view.wt.wtTable.getCoords(e).col;if(t>=0){var n=this.currentTH.getBoundingClientRect();this.currentCol=t,this.startOffset=n.left-6,this.startWidth=parseInt(n.width,10),this.handle.style.top=n.top+"px",this.handle.style.left=this.startOffset+this.startWidth+"px",this.hot.rootElement.appendChild(this.handle)}},refreshHandlePosition:function(){this.handle.style.left=this.startOffset+this.currentWidth+"px"},setupGuidePosition:function(){c(this.handle,"active"),c(this.guide,"active"),this.guide.style.top=this.handle.style.top,this.guide.style.left=this.handle.style.left,this.guide.style.height=this.hot.view.maximumVisibleElementHeight(0)+"px",this.hot.rootElement.appendChild(this.guide)},refreshGuidePosition:function(){this.guide.style.left=this.handle.style.left},hideHandleAndGuide:function(){h(this.handle,"active"),h(this.guide,"active")},checkIfColumnHeader:function(e){return"BODY"!=e.tagName?"THEAD"==e.parentNode.tagName?!0:(e=e.parentNode,this.checkIfColumnHeader(e)):!1},getTHFromTargetElement:function(e){return"TABLE"!=e.tagName?"TH"==e.tagName?e:this.getTHFromTargetElement(e.parentNode):null},onMouseOver:function(e){if(this.checkIfColumnHeader(e.target)){var t=this.getTHFromTargetElement(e.target);if(!t)return;var n=t.getAttribute("colspan");!t||null!==n&&1!==n||this.pressed||this.setupHandlePosition(t)}},afterMouseDownTimeout:function(){if(this.dblclick>=2){var e=this.hot.runHooks("beforeColumnResize",this.currentCol,this.newSize,!0);void 0!==e&&(this.newSize=e),this.setManualSize(this.currentCol,this.newSize),this.hot.forceFullRender=!0,this.hot.view.render(),this.hot.view.wt.wtOverlays.adjustElementsSize(!0),this.hot.runHooks("afterColumnResize",this.currentCol,this.newSize,!0)}this.dblclick=0,this.autoresizeTimeout=null},onMouseDown:function(e){var t=this;d(e.target,"manualColumnResizer")&&(this.setupGuidePosition(),this.pressed=this.hot,null===this.autoresizeTimeout&&(this.autoresizeTimeout=setTimeout(function(){return t.afterMouseDownTimeout()},500),this.hot._registerTimeout(this.autoresizeTimeout)),this.dblclick++,this.startX=p(e),this.newSize=this.startWidth)},onMouseMove:function(e){this.pressed&&(this.currentWidth=this.startWidth+(p(e)-this.startX),this.newSize=this.setManualSize(this.currentCol,this.currentWidth),this.refreshHandlePosition(),this.refreshGuidePosition())},onMouseUp:function(e){this.pressed&&(this.hideHandleAndGuide(),this.pressed=!1,this.newSize!=this.startWidth&&(this.hot.runHooks("beforeColumnResize",this.currentCol,this.newSize),this.hot.forceFullRender=!0,this.hot.view.render(),this.hot.view.wt.wtOverlays.adjustElementsSize(!0),this.saveManualColumnWidths(),this.hot.runHooks("afterColumnResize",this.currentCol,this.newSize)),this.setupHandlePosition(this.currentTH))},bindEvents:function(){var e=this;this.eventManager.addEventListener(this.hot.rootElement,"mouseover",function(t){return e.onMouseOver(t)}),this.eventManager.addEventListener(this.hot.rootElement,"mousedown",function(t){return e.onMouseDown(t)}),this.eventManager.addEventListener(window,"mousemove",function(t){return e.onMouseMove(t)}),this.eventManager.addEventListener(window,"mouseup",function(t){return e.onMouseUp(t)})},setManualSize:function(e,t){return t=Math.max(t,20),e=this.hot.runHooks("modifyCol",e),this.manualColumnWidths[e]=t,t},onModifyColWidth:function(e,t){return this.enabled&&(t=this.hot.runHooks("modifyCol",t),this.hot.getSettings().manualColumnResize&&this.manualColumnWidths[t])?this.manualColumnWidths[t]:e}},{},a),m("manualColumnResize",w)},{"_base.js":58,eventManager:41,"helpers/dom/element":45,"helpers/dom/event":46,plugins:57}],79:[function(e,t,n){"use strict";function o(){function e(e){var t=this;p=e;var n=this.view.wt.wtTable.getCoords(e).row;if(n>=0){f=n;var o=p.getBoundingClientRect();a=o.top,m.style.top=a+"px",m.style.left=o.left+"px",t.rootElement.appendChild(m)}}function t(e,t){var n=e.getBoundingClientRect(),o=6;t>0?m.style.top=n.top+n.height-o+"px":m.style.top=n.top+"px"}function n(){var e=this;u(m,"active"),u(w,"active");var t=p.getBoundingClientRect();w.style.width=e.view.maximumVisibleElementWidth(0)+"px",w.style.height=t.height+"px",w.style.top=a+"px",w.style.left=m.style.left,e.rootElement.appendChild(w)}function o(e){w.style.top=a+e+"px"}function r(){d(m,"active"),d(w,"active")}var i,s,l,a,f,p,m=document.createElement("DIV"),w=document.createElement("DIV"),v=h(this);m.className="manualRowMover",w.className="manualRowMoverGuide";var b=function(){var e=this;Handsontable.hooks.run(e,"persistentStateSave","manualRowPositions",e.manualRowPositions)},C=function(){var e=this,t={};return Handsontable.hooks.run(e,"persistentStateLoad","manualRowPositions",t),t.value},y=function(e){return"BODY"!=e.tagName?"TBODY"==e.parentNode.tagName?!0:(e=e.parentNode,y(e)):!1},R=function(e){return"TABLE"!=e.tagName?"TH"==e.tagName?e:R(e.parentNode):null},E=function(){var a,u=this;v.addEventListener(u.rootElement,"mouseover",function(n){if(y(n.target)){var o=R(n.target);o&&(a?(s=u.view.wt.wtTable.getCoords(o).row,t(o,s-i)):e.call(u,o))}}),v.addEventListener(u.rootElement,"mousedown",function(e){c(e.target,"manualRowMover")&&(l=g(e),n.call(u),a=u,i=f,s=f)}),v.addEventListener(window,"mousemove",function(e){a&&o(g(e)-l)}),v.addEventListener(window,"mouseup",function(t){a&&(r(),a=!1,T(u.manualRowPositions,u.countRows()),u.manualRowPositions.splice(s,0,u.manualRowPositions.splice(i,1)[0]),Handsontable.hooks.run(u,"beforeRowMove",i,s),u.forceFullRender=!0,u.view.render(),b.call(u),Handsontable.hooks.run(u,"afterRowMove",i,s),e.call(u,p))}),u.addHook("afterDestroy",S)},S=function(){v.clear()},T=function(e,t){if(e.lengthn;n++)e[n]=n};this.beforeInit=function(){this.manualRowPositions=[]},this.init=function(e){var t=this,n=!!t.getSettings().manualRowMove;if(n){var o=t.getSettings().manualRowMove,r=C.call(t);"undefined"==typeof t.manualRowPositionsPluginUsages?t.manualRowPositionsPluginUsages=["manualColumnMove"]:t.manualRowPositionsPluginUsages.push("manualColumnMove"),"undefined"!=typeof r?this.manualRowPositions=r:Array.isArray(o)?this.manualRowPositions=o:this.manualRowPositions=[],("afterInit"===e||"afterUpdateSettings"===e&&0===v.context.eventListeners.length)&&(E.call(this),this.manualRowPositions.length>0&&(t.forceFullRender=!0,t.render()))}else{var i=t.manualRowPositionsPluginUsages?t.manualRowPositionsPluginUsages.indexOf("manualColumnMove"):-1;i>-1&&(S.call(this),t.manualRowPositions=[],t.manualRowPositionsPluginUsages[i]=void 0)}},this.modifyRow=function(e){var t=this;return t.getSettings().manualRowMove?("undefined"==typeof t.manualRowPositions[e]&&T(this.manualRowPositions,e+1),t.manualRowPositions[e]):e}}Object.defineProperties(n,{ManualRowMove:{get:function(){return o}},__esModule:{value:!0}});var r,i,s,l,a=(r=e("helpers/dom/element"),r&&r.__esModule&&r||{"default":r}),u=a.addClass,c=a.hasClass,d=a.removeClass,h=(i=e("eventManager"),i&&i.__esModule&&i||{"default":i}).eventManager,f=(s=e("helpers/dom/event"),s&&s.__esModule&&s||{"default":s}),g=(f.pageX,f.pageY),p=((l=e("plugins"),l&&l.__esModule&&l||{"default":l}).registerPlugin,new o);Handsontable.hooks.add("beforeInit",p.beforeInit),Handsontable.hooks.add("afterInit",function(){p.init.call(this,"afterInit")}),Handsontable.hooks.add("afterUpdateSettings",function(){p.init.call(this,"afterUpdateSettings")}),Handsontable.hooks.add("modifyRow",p.modifyRow),Handsontable.hooks.register("beforeRowMove"),Handsontable.hooks.register("afterRowMove")},{eventManager:41,"helpers/dom/element":45,"helpers/dom/event":46,plugins:57}],80:[function(e,t,n){"use strict";Object.defineProperties(n,{ManualRowResize:{get:function(){return w}},__esModule:{value:!0}});var o,r,i,s,l,a=(o=e("_base.js"),o&&o.__esModule&&o||{"default":o})["default"],u=(r=e("helpers/dom/element"),r&&r.__esModule&&r||{"default":r}),c=u.addClass,d=u.hasClass,h=u.removeClass,f=(i=e("eventManager"),i&&i.__esModule&&i||{"default":i}).eventManager,g=(s=e("helpers/dom/event"),s&&s.__esModule&&s||{"default":s}),p=(g.pageX,g.pageY),m=(l=e("plugins"),l&&l.__esModule&&l||{"default":l}).registerPlugin,w=function(e){$traceurRuntime.superConstructor(v).call(this,e),this.currentTH=null,this.currentRow=null,this.currentHeight=null,this.newSize=null,this.startY=null,this.startHeight=null,this.startOffset=null,this.handle=document.createElement("DIV"),this.guide=document.createElement("DIV"),this.eventManager=f(this),this.pressed=null,this.dblclick=0,this.autoresizeTimeout=null,this.manualRowHeights=[],c(this.handle,"manualRowResizer"),c(this.guide,"manualRowResizerGuide")},v=w;$traceurRuntime.createClass(w,{isEnabled:function(){return this.hot.getSettings().manualRowResize},enablePlugin:function(){var e=this;if(!this.enabled){this.manualRowHeights=[];var t=this.hot.getSettings().manualRowResize,n=this.loadManualRowHeights();"undefined"!=typeof n?this.manualRowHeights=n:Array.isArray(t)?this.manualRowHeights=t:this.manualRowHeights=[],this.addHook("modifyRowHeight",function(t,n){return e.onModifyRowHeight(t,n)}),Handsontable.hooks.register("beforeRowResize"),Handsontable.hooks.register("afterRowResize"),this.bindEvents(),$traceurRuntime.superGet(this,v.prototype,"enablePlugin").call(this)}},updatePlugin:function(){var e=this.hot.getSettings().manualRowResize;Array.isArray(e)?this.manualRowHeights=e:this.manualRowHeights=[]},disablePlugin:function(){$traceurRuntime.superGet(this,v.prototype,"disablePlugin").call(this)},saveManualRowHeights:function(){this.hot.runHooks("persistentStateSave","manualRowHeights",this.manualRowHeights)},loadManualRowHeights:function(){var e={};return this.hot.runHooks("persistentStateLoad","manualRowHeights",e),e.value},setupHandlePosition:function(e){this.currentTH=e;var t=this.hot.view.wt.wtTable.getCoords(e).row;if(t>=0){var n=this.currentTH.getBoundingClientRect();this.currentRow=t,this.startOffset=n.top-6,this.startHeight=parseInt(n.height,10),this.handle.style.left=n.left+"px",this.handle.style.top=this.startOffset+this.startHeight+"px",this.hot.rootElement.appendChild(this.handle)}},refreshHandlePosition:function(){this.handle.style.top=this.startOffset+this.currentHeight+"px"},setupGuidePosition:function(){c(this.handle,"active"),c(this.guide,"active"),this.guide.style.top=this.handle.style.top,this.guide.style.left=this.handle.style.left,this.guide.style.width=this.hot.view.maximumVisibleElementWidth(0)+"px",this.hot.rootElement.appendChild(this.guide)},refreshGuidePosition:function(){this.guide.style.top=this.handle.style.top},hideHandleAndGuide:function(){h(this.handle,"active"),h(this.guide,"active")},checkIfRowHeader:function(e){return"BODY"!=e.tagName?"TBODY"==e.parentNode.tagName?!0:(e=e.parentNode,this.checkIfRowHeader(e)):!1},getTHFromTargetElement:function(e){return"TABLE"!=e.tagName?"TH"==e.tagName?e:this.getTHFromTargetElement(e.parentNode):null},onMouseOver:function(e){if(this.checkIfRowHeader(e.target)){var t=this.getTHFromTargetElement(e.target);t&&(this.pressed||this.setupHandlePosition(t))}},afterMouseDownTimeout:function(){if(this.dblclick>=2){var e=this.hot.runHooks("beforeRowResize",this.currentRow,this.newSize,!0);void 0!==e&&(this.newSize=e),this.setManualSize(this.currentRow,this.newSize),this.hot.forceFullRender=!0,this.hot.view.render(),this.hot.view.wt.wtOverlays.adjustElementsSize(!0),this.hot.runHooks("afterRowResize",this.currentRow,this.newSize,!0)}this.dblclick=0,this.autoresizeTimeout=null},onMouseDown:function(e){var t=this;d(e.target,"manualRowResizer")&&(this.setupGuidePosition(),this.pressed=this.hot,null==this.autoresizeTimeout&&(this.autoresizeTimeout=setTimeout(function(){return t.afterMouseDownTimeout()},500),this.hot._registerTimeout(this.autoresizeTimeout)),this.dblclick++,this.startY=p(e),this.newSize=this.startHeight)},onMouseMove:function(e){this.pressed&&(this.currentHeight=this.startHeight+(p(e)-this.startY),this.newSize=this.setManualSize(this.currentRow,this.currentHeight),this.refreshHandlePosition(),this.refreshGuidePosition())},onMouseUp:function(e){this.pressed&&(this.hideHandleAndGuide(),this.pressed=!1,this.newSize!=this.startHeight&&(this.hot.runHooks("beforeRowResize",this.currentRow,this.newSize),this.hot.forceFullRender=!0,this.hot.view.render(),this.hot.view.wt.wtOverlays.adjustElementsSize(!0),this.saveManualRowHeights(),this.hot.runHooks("afterRowResize",this.currentRow,this.newSize)),this.setupHandlePosition(this.currentTH))},bindEvents:function(){var e=this;this.eventManager.addEventListener(this.hot.rootElement,"mouseover",function(t){return e.onMouseOver(t)}),this.eventManager.addEventListener(this.hot.rootElement,"mousedown",function(t){return e.onMouseDown(t)}),this.eventManager.addEventListener(window,"mousemove",function(t){return e.onMouseMove(t)}),this.eventManager.addEventListener(window,"mouseup",function(t){return e.onMouseUp(t)})},setManualSize:function(e,t){return e=this.hot.runHooks("modifyRow",e),this.manualRowHeights[e]=t,t},onModifyRowHeight:function(e,t){if(this.enabled){var n=this.hot.getPlugin("autoRowSize"),o=n?n.heights[t]:null;t=this.hot.runHooks("modifyRow",t);var r=this.manualRowHeights[t];if(void 0!==r&&(r===o||r>(e||0)))return r}return e}},{},a),m("manualRowResize",w)},{"_base.js":58,eventManager:41,"helpers/dom/element":45,"helpers/dom/event":46,plugins:57}],81:[function(e,t,n){"use strict";function o(){var e=[];return e.getInfo=function(e,t){for(var n=0,o=this.length;o>n;n++)if(this[n].row<=e&&this[n].row+this[n].rowspan-1>=e&&this[n].col<=t&&this[n].col+this[n].colspan-1>=t)return this[n]},e.setInfo=function(e){for(var t=0,n=this.length;n>t;t++)if(this[t].row===e.row&&this[t].col===e.col)return void(this[t]=e);this.push(e)},e.removeInfo=function(e,t){for(var n=0,o=this.length;o>n;n++)if(this[n].row===e&&this[n].col===t){this.splice(n,1);break}},e}function r(e){if(this.mergedCellInfoCollection=new o,Array.isArray(e))for(var t=0,n=e.length;n>t;t++)this.mergedCellInfoCollection.setInfo(e[t])}function i(e,t){var n=this.getSettings().mergeCells;if(n&&!this.selection.isMultiple()){var o=this.mergeCells.mergedCellInfoCollection.getInfo(e[0],e[1]);o&&(e[0]=o.row,e[1]=o.col,e[2]=o.row+o.rowspan-1,e[3]=o.col+o.colspan-1)}}function s(e,t){this.mergeCells&&this.mergeCells.shiftCollection("right",e,t)}function l(e,t){this.mergeCells&&this.mergeCells.shiftCollection("left",e,t)}function a(e,t){this.mergeCells&&this.mergeCells.shiftCollection("down",e,t)}function u(e,t){this.mergeCells&&this.mergeCells.shiftCollection("up",e,t)}Object.defineProperties(n,{MergeCells:{get:function(){return r}},__esModule:{value:!0}});var c,d,h,f,g,p=((c=e("plugins"),c&&c.__esModule&&c||{"default":c}).registerPlugin,(d=e("helpers/dom/event"),d&&d.__esModule&&d||{"default":d}).stopImmediatePropagation),m=(h=e("3rdparty/walkontable/src/cell/coords"),h&&h.__esModule&&h||{"default":h}).WalkontableCellCoords,w=(f=e("3rdparty/walkontable/src/cell/range"),f&&f.__esModule&&f||{"default":f}).WalkontableCellRange,v=(g=e("3rdparty/walkontable/src/table"),g&&g.__esModule&&g||{"default":g}).WalkontableTable;r.prototype.canMergeRange=function(e){return!e.isSingle()},r.prototype.mergeRange=function(e){if(this.canMergeRange(e)){var t=e.getTopLeftCorner(),n=e.getBottomRightCorner(),o={};o.row=t.row,o.col=t.col,o.rowspan=n.row-t.row+1,o.colspan=n.col-t.col+1,this.mergedCellInfoCollection.setInfo(o)}},r.prototype.mergeOrUnmergeSelection=function(e){var t=this.mergedCellInfoCollection.getInfo(e.from.row,e.from.col);t?this.unmergeSelection(e.from):this.mergeSelection(e)},r.prototype.mergeSelection=function(e){this.mergeRange(e)},r.prototype.unmergeSelection=function(e){var t=this.mergedCellInfoCollection.getInfo(e.row,e.col);this.mergedCellInfoCollection.removeInfo(t.row,t.col)},r.prototype.applySpanProperties=function(e,t,n){var o=this.mergedCellInfoCollection.getInfo(t,n);o?o.row===t&&o.col===n?(e.setAttribute("rowspan",o.rowspan),e.setAttribute("colspan",o.colspan)):(e.removeAttribute("rowspan"),e.removeAttribute("colspan"),e.style.display="none"):(e.removeAttribute("rowspan"),e.removeAttribute("colspan"))},r.prototype.modifyTransform=function(e,t,n){var o=function(e,t){return t.row>=e.row&&t.row<=e.row+e.rowspan-1?!0:!1},r=function(e,t){return t.col>=e.col&&t.col<=e.col+e.colspan-1?!0:!1},i=function(e){return new m(t.to.row+e.row,t.to.col+e.col)},s={row:n.row,col:n.col};if("modifyTransformStart"==e){this.lastDesiredCoords||(this.lastDesiredCoords=new m(null,null));for(var l,a=new m(t.highlight.row,t.highlight.col),u=this.mergedCellInfoCollection.getInfo(a.row,a.col),c=0,d=this.mergedCellInfoCollection.length;d>c;c++){var h=this.mergedCellInfoCollection[c];if(h=new m(h.row+h.rowspan-1,h.col+h.colspan-1),t.includes(h)){l=!0;break}}if(u){var f=new m(u.row,u.col),g=new m(u.row+u.rowspan-1,u.col+u.colspan-1),p=new w(f,f,g);p.includes(this.lastDesiredCoords)||(this.lastDesiredCoords=new m(null,null)),s.row=this.lastDesiredCoords.row?this.lastDesiredCoords.row-a.row:s.row,s.col=this.lastDesiredCoords.col?this.lastDesiredCoords.col-a.col:s.col,n.row>0?s.row=u.row+u.rowspan-1-a.row+n.row:n.row<0&&(s.row=a.row-u.row+n.row),n.col>0?s.col=u.col+u.colspan-1-a.col+n.col:n.col<0&&(s.col=a.col-u.col+n.col)}var v=new m(t.highlight.row+s.row,t.highlight.col+s.col),b=this.mergedCellInfoCollection.getInfo(v.row,v.col);b&&(this.lastDesiredCoords=v,s={row:b.row-a.row,col:b.col-a.col})}else if("modifyTransformEnd"==e)for(var c=0,d=this.mergedCellInfoCollection.length;d>c;c++){var C=this.mergedCellInfoCollection[c],f=new m(C.row,C.col),g=new m(C.row+C.rowspan-1,C.col+C.colspan-1),y=new w(f,f,g),R=t.getBordersSharedWith(y);if(y.isEqual(t))t.setDirection("NW-SE");else if(R.length>0){var E=t.highlight.isEqual(y.from);R.indexOf("top")>-1?t.to.isSouthEastOf(y.from)&&E?t.setDirection("NW-SE"):t.to.isSouthWestOf(y.from)&&E&&t.setDirection("NE-SW"):R.indexOf("bottom")>-1&&(t.to.isNorthEastOf(y.from)&&E?t.setDirection("SW-NE"):t.to.isNorthWestOf(y.from)&&E&&t.setDirection("SE-NW"))}var v=i(s),S=o(C,v),T=r(C,v);t.includesRange(y)&&(y.includes(v)||S||T)&&(S&&(s.row<0?s.row-=C.rowspan-1:s.row>0&&(s.row+=C.rowspan-1)),T&&(s.col<0?s.col-=C.colspan-1:s.col>0&&(s.col+=C.colspan-1))); +}0!==s.row&&(n.row=s.row),0!==s.col&&(n.col=s.col)},r.prototype.shiftCollection=function(e,t,n){var o=[0,0];switch(e){case"right":o[0]+=1;break;case"left":o[0]-=1;break;case"down":o[1]+=1;break;case"up":o[1]-=1}for(var r=0;rn;n++)e.mergeCells.mergedCellInfoCollection.setInfo(t[n])}else e.mergeCells=new r(t);else e.mergeCells&&(e.mergeCells.mergedCellInfoCollection=new o)},R=function(e){if(this.mergeCells){var t=(e.ctrlKey||e.metaKey)&&!e.altKey;t&&77===e.keyCode&&(this.mergeCells.mergeOrUnmergeSelection(this.getSelectedRange()),this.render(),p(e))}},E=function(e){this.getSettings().mergeCells&&(e.items.push(Handsontable.plugins.ContextMenu.SEPARATOR),e.items.push({key:"mergeCells",name:function(){var e=this.getSelected(),t=this.mergeCells.mergedCellInfoCollection.getInfo(e[0],e[1]);return t?"Unmerge cells":"Merge cells"},callback:function(){this.mergeCells.mergeOrUnmergeSelection(this.getSelectedRange()),this.render()},disabled:function(){return!1}}))},S=function(e,t,n,o,r,i){this.mergeCells&&this.mergeCells.applySpanProperties(e,t,n)},T=function(e){return function(t){var n=this.getSettings().mergeCells;if(n){var o=this.getSelectedRange();if(this.mergeCells.modifyTransform(e,o,t),"modifyTransformEnd"===e){var r=this.countRows(),i=this.countCols();o.from.row<0?o.from.row=0:o.from.row>0&&o.from.row>=r&&(o.from.row=o.from-1),o.from.col<0?o.from.col=0:o.from.col>0&&o.from.col>=i&&(o.from.col=i-1)}}}},O=function(e){this.lastDesiredCoords=null;var t=this.getSettings().mergeCells;if(t){var n=this.getSelectedRange();n.highlight=new m(n.highlight.row,n.highlight.col),n.to=e;var o=!1;do{o=!1;for(var r=0,i=this.mergeCells.mergedCellInfoCollection.length;i>r;r++){var s=this.mergeCells.mergedCellInfoCollection[r],l=new m(s.row,s.col),a=new m(s.row+s.rowspan-1,s.col+s.colspan-1),u=new w(l,l,a);n.expandByRange(u)&&(e.row=n.to.row,e.col=n.to.col,o=!0)}}while(o)}},_=function(e,t){if(t&&"area"==t){var n=this.getSettings().mergeCells;if(n)for(var o=this.getSelectedRange(),r=new w(o.from,o.from,o.from),i=new w(o.to,o.to,o.to),s=0,l=this.mergeCells.mergedCellInfoCollection.length;l>s;s++){var a=this.mergeCells.mergedCellInfoCollection[s],u=new m(a.row,a.col),c=new m(a.row+a.rowspan-1,a.col+a.colspan-1),d=new w(u,u,c);r.expandByRange(d)&&(e[0]=r.from.row,e[1]=r.from.col),i.expandByRange(d)&&(e[2]=i.from.row,e[3]=i.from.col)}}},M=function(e,t,n){var o=this.getSettings().mergeCells;if(o){var r=this.mergeCells.mergedCellInfoCollection.getInfo(e,t);!r||r.row==e&&r.col==t||(n.copyable=!1)}},H=function(e){var t=this.getSettings().mergeCells;if(t)for(var n,o=this.countCols(),r=0;o>r;r++){if(n=this.mergeCells.mergedCellInfoCollection.getInfo(e.startRow,r),n&&n.rowe.endRow)return e.endRow=i,H.call(this,e)}}},k=function(e){var t=this.getSettings().mergeCells;if(t)for(var n,o=this.countRows(),r=0;o>r;r++){if(n=this.mergeCells.mergedCellInfoCollection.getInfo(r,e.startColumn),n&&n.cole.endColumn)return e.endColumn=i,k.call(this,e)}}},A=function(e){if(e&&this.mergeCells){var t=this.mergeCells.mergedCellInfoCollection,n=this.getSelectedRange();for(var o in t)if(n.highlight.row==t[o].row&&n.highlight.col==t[o].col&&n.to.row==t[o].row+t[o].rowspan-1&&n.to.col==t[o].col+t[o].colspan-1)return!1}return e};Handsontable.hooks.add("beforeInit",b),Handsontable.hooks.add("afterInit",C),Handsontable.hooks.add("afterUpdateSettings",y),Handsontable.hooks.add("beforeKeyDown",R),Handsontable.hooks.add("modifyTransformStart",T("modifyTransformStart")),Handsontable.hooks.add("modifyTransformEnd",T("modifyTransformEnd")),Handsontable.hooks.add("beforeSetRangeEnd",O),Handsontable.hooks.add("beforeDrawBorders",_),Handsontable.hooks.add("afterIsMultipleSelection",A),Handsontable.hooks.add("afterRenderer",S),Handsontable.hooks.add("afterContextMenuDefaultOptions",E),Handsontable.hooks.add("afterGetCellMeta",M),Handsontable.hooks.add("afterViewportRowCalculatorOverride",H),Handsontable.hooks.add("afterViewportColumnCalculatorOverride",k),Handsontable.hooks.add("afterAutofillApplyValues",i),Handsontable.hooks.add("afterCreateCol",s),Handsontable.hooks.add("afterRemoveCol",l),Handsontable.hooks.add("afterCreateRow",a),Handsontable.hooks.add("afterRemoveRow",u),Handsontable.MergeCells=r},{"3rdparty/walkontable/src/cell/coords":5,"3rdparty/walkontable/src/cell/range":6,"3rdparty/walkontable/src/table":20,"helpers/dom/event":46,plugins:57}],82:[function(e,t,n){"use strict";Object.defineProperties(n,{MultipleSelectionHandles:{get:function(){return g}},__esModule:{value:!0}});var o,r,i,s,l=(o=e("helpers/dom/element"),o&&o.__esModule&&o||{"default":o}),a=l.getWindowScrollTop,u=l.hasClass,c=l.getWindowScrollLeft,d=(r=e("_base"),r&&r.__esModule&&r||{"default":r})["default"],h=(i=e("eventManager"),i&&i.__esModule&&i||{"default":i}).EventManager,f=(s=e("plugins"),s&&s.__esModule&&s||{"default":s}).registerPlugin,g=function(e){$traceurRuntime.superConstructor(p).call(this,e),this.dragged=[],this.eventManager=null,this.lastSetCell=null},p=g;$traceurRuntime.createClass(g,{isEnabled:function(){return Handsontable.mobileBrowser},enablePlugin:function(){this.enabled||(this.eventManager||(this.eventManager=new h(this)),this.registerListeners(),$traceurRuntime.superGet(this,p.prototype,"enablePlugin").call(this))},registerListeners:function(){function e(e){if(1===t.dragged.length)return t.dragged.splice(0,t.dragged.length),!0;var n=t.dragged.indexOf(e);return-1==n?!1:void(0===n?t.dragged=t.dragged.slice(0,1):1==n&&(t.dragged=t.dragged.slice(-1)))}var t=this;this.eventManager.addEventListener(this.hot.rootElement,"touchstart",function(e){var n;return u(e.target,"topLeftSelectionHandle-HitArea")?(n=t.hot.getSelectedRange(),t.dragged.push("topLeft"),t.touchStartRange={width:n.getWidth(),height:n.getHeight(),direction:n.getDirection()},e.preventDefault(),!1):u(e.target,"bottomRightSelectionHandle-HitArea")?(n=t.hot.getSelectedRange(),t.dragged.push("bottomRight"),t.touchStartRange={width:n.getWidth(),height:n.getHeight(),direction:n.getDirection()},e.preventDefault(),!1):void 0}),this.eventManager.addEventListener(this.hot.rootElement,"touchend",function(n){return u(n.target,"topLeftSelectionHandle-HitArea")?(e.call(t,"topLeft"),t.touchStartRange=void 0,n.preventDefault(),!1):u(n.target,"bottomRightSelectionHandle-HitArea")?(e.call(t,"bottomRight"),t.touchStartRange=void 0,n.preventDefault(),!1):void 0}),this.eventManager.addEventListener(this.hot.rootElement,"touchmove",function(e){var n,o,r,i,s,l,u,d=a(),h=c();0!==t.dragged.length&&(n=document.elementFromPoint(e.touches[0].screenX-h,e.touches[0].screenY-d),n&&n!==t.lastSetCell&&(("TD"==n.nodeName||"TH"==n.nodeName)&&(o=t.hot.getCoords(n),-1==o.col&&(o.col=0),r=t.hot.getSelectedRange(),i=r.getWidth(),s=r.getHeight(),l=r.getDirection(),1==i&&1==s&&t.hot.selection.setRangeEnd(o),u=t.getCurrentRangeCoords(r,o,t.touchStartRange.direction,l,t.dragged[0]),null!==u.start&&t.hot.selection.setRangeStart(u.start),t.hot.selection.setRangeEnd(u.end),t.lastSetCell=n),e.preventDefault()))})},getCurrentRangeCoords:function(e,t,n,o,r){var i=e.getTopLeftCorner(),s=e.getBottomRightCorner(),l=e.getBottomLeftCorner(),a=e.getTopRightCorner(),u={start:null,end:null};switch(n){case"NE-SW":switch(o){case"NE-SW":case"NW-SE":u="topLeft"==r?{start:new WalkontableCellCoords(t.row,e.highlight.col),end:new WalkontableCellCoords(l.row,t.col)}:{start:new WalkontableCellCoords(e.highlight.row,t.col),end:new WalkontableCellCoords(t.row,i.col)};break;case"SE-NW":"bottomRight"==r&&(u={start:new WalkontableCellCoords(s.row,t.col),end:new WalkontableCellCoords(t.row,i.col)})}break;case"NW-SE":switch(o){case"NE-SW":"topLeft"==r?u={start:t,end:l}:u.end=t;break;case"NW-SE":"topLeft"==r?u={start:t,end:s}:u.end=t;break;case"SE-NW":"topLeft"==r?u={start:t,end:i}:u.end=t;break;case"SW-NE":"topLeft"==r?u={start:t,end:a}:u.end=t}break;case"SW-NE":switch(o){case"NW-SE":u="bottomRight"==r?{start:new WalkontableCellCoords(t.row,i.col),end:new WalkontableCellCoords(l.row,t.col)}:{start:new WalkontableCellCoords(i.row,t.col),end:new WalkontableCellCoords(t.row,s.col)};break;case"SW-NE":u="topLeft"==r?{start:new WalkontableCellCoords(e.highlight.row,t.col),end:new WalkontableCellCoords(t.row,s.col)}:{start:new WalkontableCellCoords(t.row,i.col),end:new WalkontableCellCoords(i.row,t.col)};break;case"SE-NW":"bottomRight"==r?u={start:new WalkontableCellCoords(t.row,a.col),end:new WalkontableCellCoords(i.row,t.col)}:"topLeft"==r&&(u={start:l,end:t})}break;case"SE-NW":switch(o){case"NW-SE":case"NE-SW":case"SW-NE":"topLeft"==r&&(u.end=t);break;case"SE-NW":"topLeft"==r?u.end=t:u={start:t,end:i}}}return u},isDragged:function(){return this.dragged.length>0}},{},d),f("multipleSelectionHandles",g)},{_base:58,eventManager:41,"helpers/dom/element":45,plugins:57}],83:[function(e,t,n){"use strict";function o(){}function r(){var e=this,t=e.getSettings().observeChanges;t?(e.observer&&l.call(e),i.call(e),u.call(e)):t||l.call(e)}function i(){var e=this;e.observeChangesActive=!0,e.pauseObservingChanges=function(){e.observeChangesActive=!1},e.resumeObservingChanges=function(){e.observeChangesActive=!0},e.observedData=e.getSourceData(),e.observer=g.observe(e.observedData,function(t){e.observeChangesActive&&(s.call(e,t),e.render()),e.runHooks("afterChangesObserved")})}function s(e){function t(e){var t;return t=o(e),t=n(t)}function n(e){var t=[];return e.filter(function(e){var n=r(e.path);if(-1!=["add","remove"].indexOf(e.op)&&!isNaN(n.col)){if(-1!=t.indexOf(n.col))return!1;t.push(n.col)}return!0})}function o(e){return e.filter(function(e){return!/[\/]length/gi.test(e.path)})}function r(e){var t=e.match(/^\/(\d+)\/?(.*)?$/);return{row:parseInt(t[1],10),col:/^\d*$/.test(t[2])?parseInt(t[2],10):t[2]}}for(var i=this,s=t(e),l=0,a=s.length;a>l;l++){var u=s[l],c=r(u.path);switch(u.op){case"add":isNaN(c.col)?i.runHooks("afterCreateRow",c.row):i.runHooks("afterCreateCol",c.col);break;case"remove":isNaN(c.col)?i.runHooks("afterRemoveRow",c.row,1):i.runHooks("afterRemoveCol",c.col,1);break;case"replace":i.runHooks("afterChange",[c.row,c.col,null,u.value],"external")}}}function l(){var e=this;e.observer&&(a.call(e),c.call(e))}function a(){var e=this;g.unobserve(e.observedData,e.observer),delete e.observedData,delete e.observeChangesActive,delete e.pauseObservingChanges,delete e.resumeObservingChanges}function u(){var e=this;e.addHook("afterDestroy",l),e.addHook("afterCreateRow",d),e.addHook("afterRemoveRow",d),e.addHook("afterCreateCol",d),e.addHook("afterRemoveCol",d),e.addHook("afterChange",function(e,t){"loadData"!=t&&d.call(this)})}function c(){var e=this;e.removeHook("afterDestroy",l),e.removeHook("afterCreateRow",d),e.removeHook("afterRemoveRow",d),e.removeHook("afterCreateCol",d),e.removeHook("afterRemoveCol",d),e.removeHook("afterChange",d)}function d(){var e=this;e.pauseObservingChanges(),e.addHookOnce("afterChangesObserved",function(){e.resumeObservingChanges()})}Object.defineProperties(n,{ObserveChanges:{get:function(){return o}},__esModule:{value:!0}});var h,f,g=((h=e("plugins"),h&&h.__esModule&&h||{"default":h}).registerPlugin,(f=e("jsonpatch"),f&&f.__esModule&&f||{"default":f})["default"]);Handsontable.hooks.add("afterLoadData",r),Handsontable.hooks.add("afterUpdateSettings",r),Handsontable.hooks.register("afterChangesObserved")},{jsonpatch:"jsonpatch",plugins:57}],84:[function(e,t,n){"use strict";function o(e){var t,n=function(){window.localStorage[e+"__persistentStateKeys"]=JSON.stringify(t)},o=function(){var n=window.localStorage[e+"__persistentStateKeys"],o="string"==typeof n?JSON.parse(n):void 0;t=o?o:[]},r=function(){t=[],n()};o(),this.saveValue=function(o,r){window.localStorage[e+"_"+o]=JSON.stringify(r),-1==t.indexOf(o)&&(t.push(o),n())},this.loadValue=function(t,n){t="undefined"==typeof t?n:t;var o=window.localStorage[e+"_"+t];return"undefined"==typeof o?void 0:JSON.parse(o)},this.reset=function(t){window.localStorage.removeItem(e+"_"+t)},this.resetAll=function(){for(var n=0;nl;l++)for(var a=0;i>a;a++){var u=e.getDataAtCell(l,a),c=e.getCellMeta(l,a),d=c.search.callback||n,h=c.search.queryMethod||o,f=h(t,u);if(f){var g={row:l,col:a,data:u};s.push(g)}d&&d(e,l,a,u,f)}return s}},Handsontable.Search.DEFAULT_CALLBACK=function(e,t,n,o,r){e.getCellMeta(t,n).isSearchResult=r},Handsontable.Search.DEFAULT_QUERY_METHOD=function(e,t){return"undefined"!=typeof e&&null!=e&&e.toLowerCase&&0!==e.length?"undefined"==typeof t||null==t?!1:-1!=t.toString().toLowerCase().indexOf(e.toLowerCase()):!1},Handsontable.Search.DEFAULT_SEARCH_RESULT_CLASS="htSearchResult",Handsontable.Search.global=function(){var e=Handsontable.Search.DEFAULT_CALLBACK,t=Handsontable.Search.DEFAULT_QUERY_METHOD,n=Handsontable.Search.DEFAULT_SEARCH_RESULT_CLASS;return{getDefaultCallback:function(){return e},setDefaultCallback:function(t){e=t},getDefaultQueryMethod:function(){return t},setDefaultQueryMethod:function(e){t=e},getDefaultSearchResultClass:function(){return n},setDefaultSearchResultClass:function(e){n=e}}}(),Handsontable.SearchCellDecorator=function(e,t,n,o,r,i,s){var u=null!==s.search&&"object"==typeof s.search&&s.search.searchResultClass||Handsontable.Search.global.getDefaultSearchResultClass();s.isSearchResult?l(t,u):a(t,u)};var h=d("base");c("base",function(e,t,n,o,r,i,s){h.apply(this,arguments),Handsontable.SearchCellDecorator.apply(this,arguments)}),Handsontable.hooks.add("afterInit",o),Handsontable.hooks.add("afterUpdateSettings",o)},{"helpers/dom/element":45,renderers:88}],86:[function(e,t,n){"use strict";Object.defineProperties(n,{TouchScroll:{get:function(){return d}},__esModule:{value:!0}});var o,r,i,s=(o=e("helpers/dom/element"),o&&o.__esModule&&o||{"default":o}),l=s.addClass,a=s.removeClass,u=(r=e("_base"),r&&r.__esModule&&r||{"default":r})["default"],c=(i=e("plugins"),i&&i.__esModule&&i||{"default":i}).registerPlugin,d=function(e){var t=this;$traceurRuntime.superConstructor(h).call(this,e),this.hot.addHook("afterInit",function(){return t.afterInit()}),this.hot.addHook("afterUpdateSettings",function(){return t.onAfterUpdateSettings()}),this.scrollbars=[],this.clones=[]},h=d;$traceurRuntime.createClass(d,{afterInit:function(){this.registerEvents(),this.onAfterUpdateSettings()},onAfterUpdateSettings:function(){var e=this;this.hot.addHookOnce("afterRender",function(){var t=e.hot.view.wt.wtOverlays;e.scrollbars=[],e.scrollbars.push(t.topOverlay),t.bottomOverlay.clone&&e.scrollbars.push(t.bottomOverlay),e.scrollbars.push(t.leftOverlay),t.topLeftCornerOverlay&&e.scrollbars.push(t.topLeftCornerOverlay),t.bottomLeftCornerOverlay&&t.bottomLeftCornerOverlay.clone&&e.scrollbars.push(t.bottomLeftCornerOverlay),e.clones=[],t.topOverlay.needFullRender&&e.clones.push(t.topOverlay.clone.wtTable.holder.parentNode),t.bottomOverlay.needFullRender&&e.clones.push(t.bottomOverlay.clone.wtTable.holder.parentNode),t.leftOverlay.needFullRender&&e.clones.push(t.leftOverlay.clone.wtTable.holder.parentNode),t.topLeftCornerOverlay&&e.clones.push(t.topLeftCornerOverlay.clone.wtTable.holder.parentNode),t.bottomLeftCornerOverlay&&t.bottomLeftCornerOverlay.clone&&e.clones.push(t.bottomLeftCornerOverlay.clone.wtTable.holder.parentNode)})},registerEvents:function(){var e=this;this.hot.addHook("beforeTouchScroll",function(){return e.onBeforeTouchScroll()}),this.hot.addHook("afterMomentumScroll",function(){return e.onAfterMomentumScroll()})},onBeforeTouchScroll:function(){Handsontable.freezeOverlays=!0;for(var e=0,t=this.clones.length;t>e;e++)l(this.clones[e],"hide-tween")},onAfterMomentumScroll:function(){Handsontable.freezeOverlays=!1;for(var e=this,t=0,n=this.clones.length;n>t;t++)a(this.clones[t],"hide-tween");for(var o=0,r=this.clones.length;r>o;o++)l(this.clones[o],"show-tween");setTimeout(function(){for(var t=0,n=e.clones.length;n>t;t++)a(e.clones[t],"show-tween")},400);for(var i=0,s=this.scrollbars.length;s>i;i++)this.scrollbars[i].refresh(),this.scrollbars[i].resetFixedPosition();this.hot.view.wt.wtOverlays.syncScrollWithMaster()}},{},u),c("touchScroll",d)},{_base:58,"helpers/dom/element":45,plugins:57}],87:[function(e,t,n){"use strict";function o(){var e=this,t="undefined"==typeof e.getSettings().undo||e.getSettings().undo;t?e.undoRedo||(e.undoRedo=new Handsontable.UndoRedo(e),s(e),e.addHook("beforeKeyDown",r),e.addHook("afterChange",i)):e.undoRedo&&(delete e.undoRedo,l(e),e.removeHook("beforeKeyDown",r),e.removeHook("afterChange",i))}function r(e){var t=this,n=(e.ctrlKey||e.metaKey)&&!e.altKey;n&&(89===e.keyCode||e.shiftKey&&90===e.keyCode?(t.undoRedo.redo(),f(e)):90===e.keyCode&&(t.undoRedo.undo(),f(e)))}function i(e,t){var n=this;return"loadData"==t?n.undoRedo.clear():void 0}function s(e){e.undo=function(){return e.undoRedo.undo()},e.redo=function(){return e.undoRedo.redo()},e.isUndoAvailable=function(){return e.undoRedo.isUndoAvailable()},e.isRedoAvailable=function(){return e.undoRedo.isRedoAvailable()},e.clearUndo=function(){return e.undoRedo.clear()}}function l(e){delete e.undo,delete e.redo,delete e.isUndoAvailable,delete e.isRedoAvailable,delete e.clearUndo}var a,u,c=(a=e("helpers/object"),a&&a.__esModule&&a||{"default":a}),d=c.inherit,h=c.deepClone,f=(u=e("helpers/dom/event"),u&&u.__esModule&&u||{"default":u}).stopImmediatePropagation;Handsontable.UndoRedo=function(e){var t=this;this.instance=e,this.doneActions=[],this.undoneActions=[],this.ignoreNewActions=!1,e.addHook("afterChange",function(e,n){if(e){var o=new Handsontable.UndoRedo.ChangeAction(e);t.done(o)}}),e.addHook("afterCreateRow",function(e,n,o){if(!o){var r=new Handsontable.UndoRedo.CreateRowAction(e,n);t.done(r)}}),e.addHook("beforeRemoveRow",function(e,n){var o=t.instance.getSourceData();e=(o.length+e)%o.length;var r=o.slice(e,e+n),i=new Handsontable.UndoRedo.RemoveRowAction(e,r);t.done(i)}),e.addHook("afterCreateCol",function(e,n,o){if(!o){var r=new Handsontable.UndoRedo.CreateColumnAction(e,n);t.done(r)}}),e.addHook("beforeRemoveCol",function(n,o){var r=t.instance.getSourceData();n=(t.instance.countCols()+n)%t.instance.countCols();for(var i=[],s=0,l=r.length;l>s;s++)i[s]=r[s].slice(n,n+o);var a;Array.isArray(e.getSettings().colHeaders)&&(a=e.getSettings().colHeaders.slice(n,n+i.length));var u=new Handsontable.UndoRedo.RemoveColumnAction(n,i,a);t.done(u)}),e.addHook("beforeCellAlignment",function(e,n,o,r){var i=new Handsontable.UndoRedo.CellAlignmentAction(e,n,o,r);t.done(i)})},Handsontable.UndoRedo.prototype.done=function(e){this.ignoreNewActions||(this.doneActions.push(e),this.undoneActions.length=0)},Handsontable.UndoRedo.prototype.undo=function(){if(this.isUndoAvailable()){var e=this.doneActions.pop();this.ignoreNewActions=!0;var t=this;e.undo(this.instance,function(){t.ignoreNewActions=!1,t.undoneActions.push(e)})}},Handsontable.UndoRedo.prototype.redo=function(){if(this.isRedoAvailable()){var e=this.undoneActions.pop();this.ignoreNewActions=!0;var t=this;e.redo(this.instance,function(){t.ignoreNewActions=!1,t.doneActions.push(e)})}},Handsontable.UndoRedo.prototype.isUndoAvailable=function(){return this.doneActions.length>0},Handsontable.UndoRedo.prototype.isRedoAvailable=function(){return this.undoneActions.length>0},Handsontable.UndoRedo.prototype.clear=function(){this.doneActions.length=0,this.undoneActions.length=0},Handsontable.UndoRedo.Action=function(){},Handsontable.UndoRedo.Action.prototype.undo=function(){},Handsontable.UndoRedo.Action.prototype.redo=function(){},Handsontable.UndoRedo.ChangeAction=function(e){this.changes=e},d(Handsontable.UndoRedo.ChangeAction,Handsontable.UndoRedo.Action),Handsontable.UndoRedo.ChangeAction.prototype.undo=function(e,t){for(var n=h(this.changes),o=e.countEmptyRows(!0),r=e.countEmptyCols(!0),i=0,s=n.length;s>i;i++)n[i].splice(3,1);e.addHookOnce("afterChange",t),e.setDataAtRowProp(n,null,null,"undo");for(var i=0,s=n.length;s>i;i++)e.getSettings().minSpareRows&&n[i][0]+1+e.getSettings().minSpareRows===e.countRows()&&o==e.getSettings().minSpareRows&&(e.alter("remove_row",parseInt(n[i][0]+1,10),e.getSettings().minSpareRows),e.undoRedo.doneActions.pop()),e.getSettings().minSpareCols&&n[i][1]+1+e.getSettings().minSpareCols===e.countCols()&&r==e.getSettings().minSpareCols&&(e.alter("remove_col",parseInt(n[i][1]+1,10),e.getSettings().minSpareCols),e.undoRedo.doneActions.pop())},Handsontable.UndoRedo.ChangeAction.prototype.redo=function(e,t){for(var n=h(this.changes),o=0,r=n.length;r>o;o++)n[o].splice(2,1);e.addHookOnce("afterChange",t),e.setDataAtRowProp(n,null,null,"redo")},Handsontable.UndoRedo.CreateRowAction=function(e,t){this.index=e,this.amount=t},d(Handsontable.UndoRedo.CreateRowAction,Handsontable.UndoRedo.Action),Handsontable.UndoRedo.CreateRowAction.prototype.undo=function(e,t){var n=e.countRows(),o=e.getSettings().minSpareRows;this.index>=n&&this.index-or;r++)n=e.getSourceDataAtRow(r),o=[this.index,0],Array.prototype.push.apply(o,this.data[r]),Array.prototype.splice.apply(n,o);"undefined"!=typeof this.headers&&(o=[this.index,0],Array.prototype.push.apply(o,this.headers),Array.prototype.splice.apply(e.getSettings().colHeaders,o)),e.addHookOnce("afterRender",t),e.render()},Handsontable.UndoRedo.RemoveColumnAction.prototype.redo=function(e,t){e.addHookOnce("afterRemoveCol",t),e.alter("remove_col",this.index,this.amount)},Handsontable.hooks.add("afterInit",o),Handsontable.hooks.add("afterUpdateSettings",o)},{"helpers/dom/event":46,"helpers/object":50}],88:[function(e,t,n){"use strict";function o(e,t){var n;a[e]=t,n=l(e)+"Renderer",Handsontable.renderers[n]=t,Handsontable[n]=t}function r(e){if("function"==typeof e)return e;if("string"!=typeof e)throw Error('Only strings and functions can be passed as "renderer" parameter');if(!(e in a))throw Error('No editor registered under name "'+e+'"');return a[e]}function i(e){return e in a}Object.defineProperties(n,{registerRenderer:{get:function(){return o}},getRenderer:{get:function(){return r}},hasRenderer:{get:function(){return i}},__esModule:{value:!0}});var s,l=(s=e("helpers/string"),s&&s.__esModule&&s||{"default":s}).toUpperCaseFirst,a={};Handsontable.renderers=Handsontable.renderers||{},Handsontable.renderers.registerRenderer=o,Handsontable.renderers.getRenderer=r},{"helpers/string":52}],89:[function(e,t,n){"use strict";function o(e,t,n,o,r,i,s){s.className&&(t.className?t.className=t.className+" "+s.className:t.className=s.className),s.readOnly&&l(t,s.readOnlyCellClassName),s.valid===!1&&s.invalidCellClassName?l(t,s.invalidCellClassName):a(t,s.invalidCellClassName),s.wordWrap===!1&&s.noWordWrapClassName&&l(t,s.noWordWrapClassName),!i&&s.placeholder&&l(t,s.placeholderCellClassName)}Object.defineProperties(n,{cellDecorator:{get:function(){return o}},__esModule:{value:!0}});var r,i,s=(r=e("helpers/dom/element"),r&&r.__esModule&&r||{"default":r}),l=s.addClass,a=s.removeClass,u=(i=e("renderers"),i&&i.__esModule&&i||{"default":i}).registerRenderer;u("base",o),Handsontable.renderers.cellDecorator=o},{"helpers/dom/element":45,renderers:88}],90:[function(e,t,n){"use strict";function o(e,t,n,o,r,i,s){var l=(m.cloneNode(!0),w.cloneNode(!0));if(f("text")(e,t,n,o,r,i,s),t.appendChild(l),u(t,"htAutocomplete"),t.firstChild||t.appendChild(document.createTextNode(String.fromCharCode(160))),!e.acArrowListener){var a=d(e);e.acArrowListener=function(r){c(r.target,"htAutocompleteArrow")&&e.view.wt.getSetting("onCellDblClick",null,new p(n,o),t)},a.addEventListener(e.rootElement,"mousedown",e.acArrowListener),e.addHookOnce("afterDestroy",function(){a.destroy()})}}Object.defineProperties(n,{autocompleteRenderer:{get:function(){return o}},__esModule:{value:!0}});var r,i,s,l,a=(r=e("helpers/dom/element"),r&&r.__esModule&&r||{"default":r}),u=a.addClass,c=a.hasClass,d=(a.empty,(i=e("eventManager"),i&&i.__esModule&&i||{"default":i}).eventManager),h=(s=e("renderers"),s&&s.__esModule&&s||{"default":s}),f=h.getRenderer,g=h.registerRenderer,p=(l=e("3rdparty/walkontable/src/cell/coords"),l&&l.__esModule&&l||{"default":l}).WalkontableCellCoords,m=document.createElement("DIV");m.className="htAutocompleteWrapper";var w=document.createElement("DIV");w.className="htAutocompleteArrow",w.appendChild(document.createTextNode(String.fromCharCode(9660)));g("autocomplete",o)},{"3rdparty/walkontable/src/cell/coords":5,eventManager:41,"helpers/dom/element":45,renderers:88}],91:[function(e,t,n){"use strict";function o(e,t,n,o,l,a,u){function c(e){var t=[y.SPACE,y.ENTER,y.DELETE,y.BACKSPACE];-1===t.indexOf(e.keyCode)||T(e)||f(function(){S(e),e.preventDefault()}),(e.keyCode==y.SPACE||e.keyCode==y.ENTER)&&d(),(e.keyCode==y.DELETE||e.keyCode==y.BACKSPACE)&&d(!1)}function d(){var e=void 0!==arguments[0]?arguments[0]:null;f(function(t){for(var n=0,o=t.length;o>n;n++){if(m(t[n],_)&&null===e)return;h(t[n],e)}})}function h(e){var t=void 0!==arguments[1]?arguments[1]:null;null===t?e.checked=!e.checked:e.checked=t,b.fireEvent(e,"change")}function f(t){for(var n=e.getSelectedRange(),o=n.getTopLeftCorner(),r=n.getBottomRightCorner(),i=o.row;i<=r.row;i++)for(var s=o.col;s<=r.col;s++){var l=e.getCell(i,s),a=e.getCellMeta(i,s),u=l.querySelectorAll("input[type=checkbox]");u.length>0&&!a.readOnly&&t(u)}}var b=new v(e),C=r(),R=u.label,M=!1;if("undefined"==typeof u.checkedTemplate&&(u.checkedTemplate=!0),"undefined"==typeof u.uncheckedTemplate&&(u.uncheckedTemplate=!1),g(t),a===u.checkedTemplate||w(a,u.checkedTemplate)?C.checked=!0:a===u.uncheckedTemplate||w(a,u.uncheckedTemplate)?C.checked=!1:null===a?p(C,"noValue"):(C.style.display="none",p(C,_),M=!0),!M&&R){var H="";R.value?H="function"==typeof R.value?R.value.call(this,n,o,l,a):R.value:R.property&&(H=e.getDataAtRowProp(n,R.property));var k=i(H);"before"===R.position?k.appendChild(C):k.insertBefore(C,k.firstChild),C=k}t.appendChild(C),M&&t.appendChild(document.createTextNode("#bad-value#")),u.readOnly?b.addEventListener(C,"click",s):(b.addEventListener(C,"mousedown",E),b.addEventListener(C,"mouseup",E),b.addEventListener(C,"change",function(t){e.setDataAtRowProp(n,l,t.target.checked?u.checkedTemplate:u.uncheckedTemplate)})),O.has(e)||(O.set(e,!0),e.addHook("beforeKeyDown",c))}function r(){var e=document.createElement("input");return e.className="htCheckboxRendererInput",e.type="checkbox",e.setAttribute("autocomplete","off"),e.cloneNode(!1)}function i(e){var t=document.createElement("label");return t.className="htCheckboxRendererLabel",t.appendChild(document.createTextNode(e)),t.cloneNode(!0)}function s(e){e.preventDefault()}Object.defineProperties(n,{checkboxRenderer:{get:function(){return o}},__esModule:{value:!0}});var l,a,u,c,d,h,f=(l=e("helpers/dom/element"),l&&l.__esModule&&l||{"default":l}),g=f.empty,p=f.addClass,m=f.hasClass,w=(a=e("helpers/string"),a&&a.__esModule&&a||{"default":a}).equalsIgnoreCase,v=(u=e("eventManager"),u&&u.__esModule&&u||{"default":u}).EventManager,b=(c=e("renderers"),c&&c.__esModule&&c||{"default":c}),C=(b.getRenderer,b.registerRenderer),y=(d=e("helpers/unicode"),d&&d.__esModule&&d||{"default":d}).KEY_CODES,R=(h=e("helpers/dom/event"),h&&h.__esModule&&h||{"default":h}),E=R.stopPropagation,S=R.stopImmediatePropagation,T=R.isImmediatePropagationStopped,O=new WeakMap,_="htBadValue";C("checkbox",o)},{eventManager:41,"helpers/dom/element":45, +"helpers/dom/event":46,"helpers/string":52,"helpers/unicode":53,renderers:88}],92:[function(e,t,n){"use strict";function o(e,t,n,o,r,i,l){a("base").apply(this,arguments),s(t,i)}Object.defineProperties(n,{htmlRenderer:{get:function(){return o}},__esModule:{value:!0}});var r,i,s=(r=e("helpers/dom/element"),r&&r.__esModule&&r||{"default":r}).fastInnerHTML,l=(i=e("renderers"),i&&i.__esModule&&i||{"default":i}),a=l.getRenderer,u=l.registerRenderer;u("html",o)},{"helpers/dom/element":45,renderers:88}],93:[function(e,t,n){"use strict";function o(e,t,n,o,r,i,s){f(i)&&("undefined"!=typeof s.language&&a.language(s.language),i=a(i).format(s.format||"0"),u(t,"htNumeric")),d("text")(e,t,n,o,r,i,s)}Object.defineProperties(n,{numericRenderer:{get:function(){return o}},__esModule:{value:!0}});var r,i,s,l,a=(r=e("numeral"),r&&r.__esModule&&r||{"default":r})["default"],u=(i=e("helpers/dom/element"),i&&i.__esModule&&i||{"default":i}).addClass,c=(s=e("renderers"),s&&s.__esModule&&s||{"default":s}),d=c.getRenderer,h=c.registerRenderer,f=(l=e("helpers/number"),l&&l.__esModule&&l||{"default":l}).isNumeric;h("numeric",o)},{"helpers/dom/element":45,"helpers/number":49,numeral:"numeral",renderers:88}],94:[function(e,t,n){"use strict";function o(e,t,n,o,r,i,l){a("text").apply(this,arguments),i=t.innerHTML;var u,c=l.hashLength||i.length,d=l.hashSymbol||"*";for(u="";u.split(d).length-13?("function"==typeof o&&(e.__proto__=o),e.prototype=d(l(o),i(t))):e.prototype=t,f(e,"prototype",{configurable:!1,writable:!1}),h(e,i(n))}function l(e){if("function"==typeof e){var t=e.prototype;if(u(t)===t||null===t)return e.prototype;throw new c("super prototype must be an Object or null")}if(null===e)return null;throw new c("Super expression must either be null or a function, not "+typeof e+".")}function a(e,t,o){null!==p(t)&&n(e,t,"constructor",o)}var u=Object,c=TypeError,d=u.create,h=$traceurRuntime.defineProperties,f=$traceurRuntime.defineProperty,g=$traceurRuntime.getOwnPropertyDescriptor,p=Object.getPrototypeOf,m=$traceurRuntime.toProperty,w=Object,v=w.getOwnPropertyNames,b=w.getOwnPropertySymbols;$traceurRuntime.createClass=s,$traceurRuntime.defaultSuperCall=a,$traceurRuntime.superCall=n,$traceurRuntime.superConstructor=t,$traceurRuntime.superGet=o,$traceurRuntime.superSet=r}()},{}],97:[function(e,t,n){"use strict";function o(e){var t=this;this.eventManager=C(e),this.instance=e,this.settings=e.getSettings(),this.selectionMouseDown=!1;var n=e.rootElement.getAttribute("style");n&&e.rootElement.setAttribute("data-originalstyle",n),d(e.rootElement,"handsontable");var o=document.createElement("TABLE");d(o,"htCore"),e.getSettings().tableClassName&&d(o,e.getSettings().tableClassName),this.THEAD=document.createElement("THEAD"),o.appendChild(this.THEAD),this.TBODY=document.createElement("TBODY"),o.appendChild(this.TBODY),e.table=o,e.container.insertBefore(o,e.container.firstChild),this.eventManager.addEventListener(e.rootElement,"mousedown",function(e){this.selectionMouseDown=!0,t.isTextSelectionAllowed(e.target)||(i(),e.preventDefault(),window.focus())}),this.eventManager.addEventListener(e.rootElement,"mouseup",function(e){this.selectionMouseDown=!1}),this.eventManager.addEventListener(e.rootElement,"mousemove",function(e){this.selectionMouseDown&&!t.isTextSelectionAllowed(e.target)&&(i(),e.preventDefault())}),this.eventManager.addEventListener(document.documentElement,"keyup",function(t){e.selection.isInProgress()&&!t.shiftKey&&e.selection.finish()});var r;this.isMouseDown=function(){return r},this.eventManager.addEventListener(document.documentElement,"mouseup",function(t){e.selection.isInProgress()&&1===t.which&&e.selection.finish(),r=!1,b(document.activeElement)&&e.unlisten()}),this.eventManager.addEventListener(document.documentElement,"mousedown",function(n){var o=n.target,i=n.x||n.clientX,s=n.y||n.clientY;if(!r&&e.rootElement){if(o===e.view.wt.wtTable.holder){var l=p();if(document.elementFromPoint(i+l,s)!==e.view.wt.wtTable.holder||document.elementFromPoint(i,s+l)!==e.view.wt.wtTable.holder)return}else for(;o!==document.documentElement;){if(null===o){if(n.isTargetWebComponent)break;return}if(o===e.rootElement)return;o=o.parentNode}t.settings.outsideClickDeselects?e.deselectCell():e.destroyEditor()}}),this.eventManager.addEventListener(o,"selectstart",function(e){t.settings.fragmentSelection||v(e.target)||e.preventDefault()});var i=function(){window.getSelection?window.getSelection().empty?window.getSelection().empty():window.getSelection().removeAllRanges&&window.getSelection().removeAllRanges():document.selection&&document.selection.empty()},s=[new T({className:"current",border:{width:2,color:"#5292F7",cornerVisible:function(){return t.settings.fillHandle&&!t.isCellEdited()&&!e.selection.isMultiple()},multipleSelectionHandlesVisible:function(){return!t.isCellEdited()&&!e.selection.isMultiple()}}}),new T({className:"area",border:{width:1,color:"#89AFF9",cornerVisible:function(){return t.settings.fillHandle&&!t.isCellEdited()&&e.selection.isMultiple()},multipleSelectionHandlesVisible:function(){return!t.isCellEdited()&&e.selection.isMultiple()}}}),new T({className:"highlight",highlightRowClassName:t.settings.currentRowClassName,highlightColumnClassName:t.settings.currentColClassName}),new T({className:"fill",border:{width:1,color:"red"}})];s.current=s[0],s.area=s[1],s.highlight=s[2],s.fill=s[3];var l={debug:function(){return t.settings.debug},externalRowCalculator:this.instance.getPlugin("autoRowSize")&&this.instance.getPlugin("autoRowSize").isEnabled(),table:o,stretchH:this.settings.stretchH,data:e.getDataAtCell,totalRows:function(){return e.countRows()},totalColumns:function(){return e.countCols()},fixedColumnsLeft:function(){return t.settings.fixedColumnsLeft},fixedRowsTop:function(){return t.settings.fixedRowsTop},fixedRowsBottom:function(){return t.settings.fixedRowsBottom},minSpareRows:function(){return t.settings.minSpareRows},renderAllRows:t.settings.renderAllRows,rowHeaders:function(){var n=[];return e.hasRowHeaders()&&n.push(function(e,n){t.appendRowHeader(e,n)}),Handsontable.hooks.run(e,"afterGetRowHeaderRenderers",n),n},columnHeaders:function(){var n=[];return e.hasColHeaders()&&n.push(function(e,n){t.appendColHeader(e,n)}),Handsontable.hooks.run(e,"afterGetColumnHeaderRenderers",n),n},columnWidth:e.getColWidth,rowHeight:e.getRowHeight,cellRenderer:function(e,n,o){var r=t.instance.colToProp(n),i=t.instance.getCellMeta(e,n),s=t.instance.getCellRenderer(i),l=t.instance.getDataAtRowProp(e,r);s(t.instance,o,e,n,r,l,i),Handsontable.hooks.run(t.instance,"afterRenderer",o,e,n,r,l,i)},selections:s,hideBorderOnMouseDownOver:function(){return t.settings.fragmentSelection},onCellMouseDown:function(n,o,i,s){var l,a,u=i.parentNode,c=u.parentNode;if(e.listen(),t.activeWt=s,r=!0,Handsontable.hooks.run(e,"beforeOnCellMouseDown",n,o,i),e.selection.setSelectedHeaders(!1,!1),!E(n)){if(2===n.button&&e.selection.inInSelection(o));else n.shiftKey?o.row>=0&&o.col>=0&&e.selection.setRangeEnd(o):(o.row<0||o.col<0)&&(o.row>=0||o.col>=0)?(o.row<0&&(l=c.childNodes.length-Array.prototype.indexOf.call(c.childNodes,u)-1,a=e.getHeaderColspan(o.col,l),e.selection.setSelectedHeaders(!1,!0),e.selectCell(0,o.col,e.countRows()-1,o.col+Math.max(0,a-1))),o.col<0&&(e.selection.setSelectedHeaders(!0,!1),e.selectCell(o.row,0,o.row,e.countCols()-1))):(o.row=o.row<0?0:o.row,o.col=o.col<0?0:o.col,e.selection.setRangeStart(o));Handsontable.hooks.run(e,"afterOnCellMouseDown",n,o,i),t.activeWt=t.wt}},onCellMouseOver:function(n,o,i,s){t.activeWt=s,o.row>=0&&o.col>=0?r&&e.selection.setRangeEnd(o):r&&(o.row<0&&(e.selection.selectedHeader.cols?(e.selection.setRangeEnd(new S(e.countRows()-1,o.col)),e.selection.setSelectedHeaders(!1,!0)):e.selection.setRangeEnd(new S(o.row,o.col))),o.col<0&&(e.selection.selectedHeader.rows?(e.selection.setRangeEnd(new S(o.row,e.countCols()-1)),e.selection.setSelectedHeaders(!0,!1)):e.selection.setRangeEnd(new S(o.row,o.col)))),Handsontable.hooks.run(e,"afterOnCellMouseOver",n,o,i),t.activeWt=t.wt},onCellCornerMouseDown:function(t){t.preventDefault(),Handsontable.hooks.run(e,"afterOnCellCornerMouseDown",t)},beforeDraw:function(e){t.beforeRender(e)},onDraw:function(e){t.onDraw(e)},onScrollVertically:function(){e.runHooks("afterScrollVertically")},onScrollHorizontally:function(){e.runHooks("afterScrollHorizontally")},onBeforeDrawBorders:function(t,n){e.runHooks("beforeDrawBorders",t,n)},onBeforeTouchScroll:function(){e.runHooks("beforeTouchScroll")},onAfterMomentumScroll:function(){e.runHooks("afterMomentumScroll")},viewportRowCalculatorOverride:function(n){var o=e.countRows(),r=t.settings.viewportRowRenderingOffset;if("auto"===r&&t.settings.fixedRowsTop&&(r=10),"number"==typeof r&&(n.startRow=Math.max(n.startRow-r,0),n.endRow=Math.min(n.endRow+r,o-1)),"auto"===r){var i=n.startRow+n.endRow-n.startRow,s=Math.ceil(i/o*12);n.startRow=Math.max(n.startRow-s,0),n.endRow=Math.min(n.endRow+s,o-1)}e.runHooks("afterViewportRowCalculatorOverride",n)},viewportColumnCalculatorOverride:function(n){var o=e.countCols(),r=t.settings.viewportColumnRenderingOffset;if("auto"===r&&t.settings.fixedColumnsLeft&&(r=10),"number"==typeof r&&(n.startColumn=Math.max(n.startColumn-r,0),n.endColumn=Math.min(n.endColumn+r,o-1)),"auto"===r){var i=n.startColumn+n.endColumn-n.startColumn,s=Math.ceil(i/o*12);n.startRow=Math.max(n.startColumn-s,0),n.endColumn=Math.min(n.endColumn+s,o-1)}e.runHooks("afterViewportColumnCalculatorOverride",n)}};Handsontable.hooks.run(e,"beforeInitWalkontable",l),this.wt=new O(l),this.activeWt=this.wt,this.eventManager.addEventListener(t.wt.wtTable.spreader,"mousedown",function(e){e.target===t.wt.wtTable.spreader&&3===e.which&&R(e)}),this.eventManager.addEventListener(t.wt.wtTable.spreader,"contextmenu",function(e){e.target===t.wt.wtTable.spreader&&3===e.which&&R(e)}),this.eventManager.addEventListener(document.documentElement,"click",function(){t.settings.observeDOMVisibility&&t.wt.drawInterrupted&&(t.instance.forceFullRender=!0,t.render())})}Object.defineProperties(n,{TableView:{get:function(){return o}},__esModule:{value:!0}});var r,i,s,l,a,u,c=(r=e("helpers/dom/element"),r&&r.__esModule&&r||{"default":r}),d=c.addClass,h=c.empty,f=c.fastInnerHTML,g=c.fastInnerText,p=c.getScrollbarWidth,m=c.hasClass,w=c.isChildOf,v=c.isInput,b=c.isOutsideInput,C=(i=e("eventManager"),i&&i.__esModule&&i||{"default":i}).eventManager,y=(s=e("helpers/dom/event"),s&&s.__esModule&&s||{"default":s}),R=y.stopPropagation,E=y.isImmediatePropagationStopped,S=(l=e("3rdparty/walkontable/src/cell/coords"),l&&l.__esModule&&l||{"default":l}).WalkontableCellCoords,T=(a=e("3rdparty/walkontable/src/selection"),a&&a.__esModule&&a||{"default":a}).WalkontableSelection,O=(u=e("3rdparty/walkontable/src/core"),u&&u.__esModule&&u||{"default":u}).Walkontable;Handsontable.TableView=o,o.prototype.isTextSelectionAllowed=function(e){if(v(e))return!0;var t=w(e,this.instance.view.wt.wtTable.spreader);return this.settings.fragmentSelection===!0&&t?!0:"cell"===this.settings.fragmentSelection&&this.isSelectedOnlyCell()&&t?!0:!1},o.prototype.isSelectedOnlyCell=function(){var e=this.instance.getSelected()||[],t=e[0],n=e[1],o=e[2],r=e[3];return void 0!==t&&t===o&&n===r},o.prototype.isCellEdited=function(){var e=this.instance.getActiveEditor();return e&&e.isOpened()},o.prototype.beforeRender=function(e){e&&Handsontable.hooks.run(this.instance,"beforeRender",this.instance.forceFullRender)},o.prototype.onDraw=function(e){e&&Handsontable.hooks.run(this.instance,"afterRender",this.instance.forceFullRender)},o.prototype.render=function(){this.wt.draw(!this.instance.forceFullRender),this.instance.forceFullRender=!1,this.instance.renderCall=!1},o.prototype.getCellAtCoords=function(e,t){var n=this.wt.getCell(e,t);return 0>n?null:n},o.prototype.scrollViewport=function(e){this.wt.scrollViewport(e)},o.prototype.appendRowHeader=function(e,t){if(t.firstChild){var n=t.firstChild;if(!m(n,"relative"))return h(t),void this.appendRowHeader(e,t);this.updateCellHeader(n.querySelector(".rowHeader"),e,this.instance.getRowHeader)}else{var o=document.createElement("div"),r=document.createElement("span");o.className="relative",r.className="rowHeader",this.updateCellHeader(r,e,this.instance.getRowHeader),o.appendChild(r),t.appendChild(o)}Handsontable.hooks.run(this.instance,"afterGetRowHeader",e,t)},o.prototype.appendColHeader=function(e,t){if(t.firstChild){var n=t.firstChild;m(n,"relative")?this.updateCellHeader(n.querySelector(".colHeader"),e,this.instance.getColHeader):(h(t),this.appendColHeader(e,t))}else{var o=document.createElement("div"),r=document.createElement("span");o.className="relative",r.className="colHeader",this.updateCellHeader(r,e,this.instance.getColHeader),o.appendChild(r),t.appendChild(o)}Handsontable.hooks.run(this.instance,"afterGetColHeader",e,t)},o.prototype.updateCellHeader=function(e,t,n){t>-1?f(e,n(t)):(g(e,String.fromCharCode(160)),d(e,"cornerHeader"))},o.prototype.maximumVisibleElementWidth=function(e){var t=this.wt.wtViewport.getWorkspaceWidth(),n=t-e;return n>0?n:0},o.prototype.maximumVisibleElementHeight=function(e){var t=this.wt.wtViewport.getWorkspaceHeight(),n=t-e;return n>0?n:0},o.prototype.mainViewIsActive=function(){return this.wt===this.activeWt},o.prototype.destroy=function(){this.wt.destroy(),this.eventManager.destroy()}},{"3rdparty/walkontable/src/cell/coords":5,"3rdparty/walkontable/src/core":7,"3rdparty/walkontable/src/selection":18,eventManager:41,"helpers/dom/element":45,"helpers/dom/event":46}],98:[function(e,t,n){"use strict";Object.defineProperties(n,{GhostTable:{get:function(){return f}},__esModule:{value:!0}});var o,r,i,s,l,a=(o=e("helpers/dom/element"),o&&o.__esModule&&o||{"default":o}),u=a.addClass,c=a.outerHeight,d=a.outerWidth,h=(r=e("helpers/array"),r&&r.__esModule&&r||{"default":r}).arrayEach,f=((i=e("helpers/object"),i&&i.__esModule&&i||{"default":i}).objectEach,(s=e("helpers/number"),s&&s.__esModule&&s||{"default":s}).rangeEach,(l=e("helpers/mixed"),l&&l.__esModule&&l||{"default":l}).stringify,function(e){this.hot=e,this.container=null,this.injected=!1,this.rows=[],this.columns=[],this.samples=null});$traceurRuntime.createClass(f,{addRow:function(e,t){if(this.columns.length)throw new Error("Doesn't support multi-dimensional table");this.rows.length||(this.container=this.createContainer(this.hot.rootElement.className));var n={row:e};this.rows.push(n),this.samples=t,this.table=this.createTable(this.hot.table.className),this.table.colGroup.appendChild(this.createColGroupsCol()),this.table.tr.appendChild(this.createRow(e)),this.container.container.appendChild(this.table.fragment),n.table=this.table.table},addColumn:function(e,t){if(this.rows.length)throw new Error("Doesn't support multi-dimensional table");this.columns.length||(this.container=this.createContainer(this.hot.rootElement.className));var n={col:e};this.columns.push(n),this.samples=t,this.table=this.createTable(this.hot.table.className),null!==this.hot.getColHeader(e)&&this.hot.view.appendColHeader(e,this.table.th),this.table.tBody.appendChild(this.createCol(e)),this.container.container.appendChild(this.table.fragment),n.table=this.table.table},getHeights:function(e){this.injected||this.injectTable(),h(this.rows,function(t){e(t.row,c(t.table)-1)})},getWidths:function(e){this.injected||this.injectTable(),h(this.columns,function(t){e(t.col,d(t.table))})},createColGroupsCol:function(){var e=this,t=document,n=t.createDocumentFragment();return n.appendChild(this.createColElement(-1)),this.samples.forEach(function(t){h(t.strings,function(t){n.appendChild(e.createColElement(t.col))})}),n},createRow:function(e){var t=this,n=document,o=n.createDocumentFragment(),r=n.createElement("th");return null!==this.hot.getRowHeader(e)&&this.hot.view.appendRowHeader(e,r),o.appendChild(r),this.samples.forEach(function(r){h(r.strings,function(r){var i=r.col,s=t.hot.getCellMeta(e,i);s.col=i,s.row=e;var l=t.hot.getCellRenderer(s),a=n.createElement("td");l(t.hot,a,e,i,t.hot.colToProp(i),r.value,s),o.appendChild(a)})}),o},createCol:function(e){var t=this,n=document,o=n.createDocumentFragment();return this.samples.forEach(function(r){h(r.strings,function(r){var i=r.row,s=t.hot.getCellMeta(i,e);s.col=e,s.row=i;var l=t.hot.getCellRenderer(s),a=n.createElement("td"),u=n.createElement("tr");l(t.hot,a,i,e,t.hot.colToProp(i),r.value,s),u.appendChild(a),o.appendChild(u)})}),o},clean:function(){this.rows.length=0,this.columns.length=0,this.samples&&this.samples.clear(),this.samples=null,this.removeTable()},injectTable:function(){var e=void 0!==arguments[0]?arguments[0]:null;this.injected||((e||this.hot.rootElement).appendChild(this.container.fragment),this.injected=!0)},removeTable:function(){this.injected&&this.container.container.parentNode&&(this.container.container.parentNode.removeChild(this.container.container),this.container=null,this.injected=!1)},createColElement:function(e){var t=document,n=t.createElement("col");return n.style.width=this.hot.view.wt.wtTable.getStretchedColumnWidth(e)+"px",n},createTable:function(){var e=void 0!==arguments[0]?arguments[0]:"",t=document,n=t.createDocumentFragment(),o=t.createElement("table"),r=t.createElement("thead"),i=t.createElement("tbody"),s=t.createElement("colgroup"),l=t.createElement("tr"),a=t.createElement("th");return this.isVertical()&&o.appendChild(s),this.isHorizontal()&&(l.appendChild(a),r.appendChild(l),o.style.tableLayout="auto",o.style.width="auto"),o.appendChild(r),this.isVertical()&&i.appendChild(l),o.appendChild(i),u(o,e),n.appendChild(o),{fragment:n,table:o,tHead:r,tBody:i,colGroup:s,tr:l,th:a}},createContainer:function(){var e=void 0!==arguments[0]?arguments[0]:"",t=document,n=t.createDocumentFragment(),o=t.createElement("div");return e="htGhostTable htAutoSize "+e.trim(),u(o,e),n.appendChild(o),{fragment:n,container:o}},isVertical:function(){return this.rows.length&&!this.columns.length?!0:!1},isHorizontal:function(){return this.columns.length&&!this.rows.length?!0:!1}},{}),Handsontable.utils=Handsontable.utils||{},Handsontable.utils.GhostTable=f},{"helpers/array":42,"helpers/dom/element":45,"helpers/mixed":48,"helpers/number":49,"helpers/object":50}],99:[function(e,t,n){"use strict";var o;Object.defineProperties(n,{SamplesGenerator:{get:function(){return h}},__esModule:{value:!0}});var r,i,s,l,a,u=(r=e("helpers/dom/element"),r&&r.__esModule&&r||{"default":r}),c=(u.addClass,u.outerHeight,u.outerWidth,(i=e("helpers/array"),i&&i.__esModule&&i||{"default":i}).arrayEach,(s=e("helpers/object"),s&&s.__esModule&&s||{"default":s}).objectEach,(l=e("helpers/number"),l&&l.__esModule&&l||{"default":l}).rangeEach),d=(a=e("helpers/mixed"),a&&a.__esModule&&a||{"default":a}).stringify,h=function(e){this.samples=null,this.dataFactory=e},f=h;$traceurRuntime.createClass(h,(o={},Object.defineProperty(o,"generateRowSamples",{value:function(e,t){return this.generateSamples("row",t,e)},configurable:!0,enumerable:!0,writable:!0}),Object.defineProperty(o,"generateColumnSamples",{value:function(e,t){return this.generateSamples("col",t,e)},configurable:!0,enumerable:!0,writable:!0}),Object.defineProperty(o,"generateSamples",{value:function(e,t,n){var o=this,r=new Map;return"number"==typeof n&&(n={from:n,to:n}),c(n.from,n.to,function(n){var i=o.generateSample(e,t,n);r.set(n,i)}),r},configurable:!0,enumerable:!0,writable:!0}),Object.defineProperty(o,"generateSample",{value:function(e,t,n){var o=this,r=new Map;return c(t.from,t.to,function(t){var i,s;if("row"===e)s=o.dataFactory(n,t);else{if("col"!==e)throw new Error("Unsupported sample type");s=o.dataFactory(t,n)}Array.isArray(s)||(s=d(s));var l=s.length;r.has(l)||r.set(l,{needed:f.SAMPLE_COUNT,strings:[]});var a=r.get(l);if(a.needed){var u="row"===e?"col":"row";a.strings.push((i={},Object.defineProperty(i,"value",{value:s,configurable:!0,enumerable:!0,writable:!0}),Object.defineProperty(i,u,{value:t,configurable:!0,enumerable:!0,writable:!0}),i)),a.needed--}}),r},configurable:!0,enumerable:!0,writable:!0}),o),{get SAMPLE_COUNT(){return 3}}),Handsontable.utils=Handsontable.utils||{},Handsontable.utils.SamplesGenerator=h},{"helpers/array":42,"helpers/dom/element":45,"helpers/mixed":48,"helpers/number":49,"helpers/object":50}],100:[function(e,t,n){"use strict";function o(e,t){var n=e,o="string"==typeof n?n.toLowerCase():null;return function(e){for(var r=!1,s=0,l=e.length;l>s;s++){if(n===e[s]){r=!0;break}if(o===i(e[s]).toLowerCase()){r=!0;break}}t(r)}}var r,i=(r=e("helpers/mixed"),r&&r.__esModule&&r||{"default":r}).stringify;Handsontable.AutocompleteValidator=function(e,t){this.strict&&this.source?"function"==typeof this.source?this.source(e,o(e,t)):o(e,t)(this.source):t(!0)}},{"helpers/mixed":48}],101:[function(e,t,n){"use strict";var o,r,i=(o=e("moment"),o&&o.__esModule&&o||{"default":o})["default"],s=(r=e("editors"),r&&r.__esModule&&r||{"default":r}).getEditor;Handsontable.DateValidator=function(e,t){var n=!0,o=s("date",this.instance);null===e&&(e="");var r=i(new Date(e)).isValid(),a=i(e,this.dateFormat||o.defaultDateFormat,!0).isValid();if(r||(n=!1),!r&&a&&(n=!0),r&&!a)if(this.correctFormat===!0){var u=l(e,this.dateFormat);this.instance.setDataAtCell(this.row,this.col,u,"dateValidator"),n=!0}else n=!1;t(n)};var l=function(e,t){var n=i(new Date(e)),o=n.format("YYYY"),r=i().format("YYYY");return o.substr(0,2)!==r.substr(0,2)?e.match(new RegExp(o))||n.year(o.replace(o.substr(0,2),r.substr(0,2))):o.length>4&&n.year((n.year()+"").substr(0,4)),n.format(t)}},{editors:29,moment:void 0}],102:[function(e,t,n){"use strict";Handsontable.NumericValidator=function(e,t){null===e&&(e=""),t(/^-?\d*(\.|\,)?\d*$/.test(e))}},{}],SheetClip:[function(e,t,n){"use strict";!function(e){function t(e){return e.split('"').length-1}var o={parse:function(e){var n,o,r,i,s,l,a,u=[],c=0;for(r=e.split("\n"),r.length>1&&""===r[r.length-1]&&r.pop(),n=0,o=r.length;o>n;n+=1){for(r[n]=r[n].split(" "),i=0,s=r[n].length;s>i;i+=1)u[c]||(u[c]=[]),l&&0===i?(a=u[c].length-1,u[c][a]=u[c][a]+"\n"+r[n][0],l&&1&t(r[n][0])&&(l=!1,u[c][a]=u[c][a].substring(0,u[c][a].length-1).replace(/""/g,'"'))):i===s-1&&0===r[n][i].indexOf('"')&&1&t(r[n][i])?(u[c].push(r[n][i].substring(1).replace(/""/g,'"')),l=!0):(u[c].push(r[n][i].replace(/""/g,'"')),l=!1);l||(c+=1)}return u},stringify:function(e){var t,n,o,r,i,s="";for(t=0,n=e.length;n>t;t+=1){for(r=e[t].length,o=0;r>o;o+=1)o>0&&(s+=" "),i=e[t][o],s+="string"==typeof i?i.indexOf("\n")>-1?'"'+i.replace(/"/g,'""')+'"':i:null===i||void 0===i?"":i;s+="\n"}return s}};"undefined"!=typeof n?(n.parse=o.parse,n.stringify=o.stringify):e.SheetClip=o}(window)},{}],autoResize:[function(e,t,n){"use strict";function o(){var e,t={minHeight:200,maxHeight:300,minWidth:100,maxWidth:300},n=document.body,o=document.createTextNode(""),r=document.createElement("SPAN"),i=function(e,t,n){window.attachEvent?e.attachEvent("on"+t,n):e.addEventListener(t,n,!1)},s=function(e,t,n){window.removeEventListener?e.removeEventListener(t,n,!1):e.detachEvent("on"+t,n)},l=function(i){var s,l;i?/^[a-zA-Z \.,\\\/\|0-9]$/.test(i)||(i="."):i="",void 0!==o.textContent?o.textContent=e.value+i:o.data=e.value+i,r.style.fontSize=Handsontable.Dom.getComputedStyle(e).fontSize,r.style.fontFamily=Handsontable.Dom.getComputedStyle(e).fontFamily,r.style.whiteSpace="pre",n.appendChild(r),s=r.clientWidth+2,n.removeChild(r),e.style.height=t.minHeight+"px",t.minWidth>s?e.style.width=t.minWidth+"px":s>t.maxWidth?e.style.width=t.maxWidth+"px":e.style.width=s+"px",l=e.scrollHeight?e.scrollHeight-1:0,t.minHeight>l?e.style.height=t.minHeight+"px":t.maxHeight-1||"true"===e.contentEditable}var n=this,o=!1;if(e.metaKey?o=!0:e.ctrlKey&&-1===navigator.userAgent.indexOf("Mac")&&(o=!0),o){ +if(document.activeElement!==this.elTextarea&&(""!==this.getSelectionText()||t()))return;this.selectNodeText(this.elTextarea),setTimeout(function(){document.activeElement!==n.elTextarea&&n.selectNodeText(n.elTextarea)},0)}!o||67!==e.keyCode&&86!==e.keyCode&&88!==e.keyCode||(88===e.keyCode?setTimeout(function(){n.triggerCut(e)},0):86===e.keyCode&&setTimeout(function(){n.triggerPaste(e)},0))},r.prototype.selectNodeText=function(e){e&&e.select()},r.prototype.getSelectionText=function(){var e="";return window.getSelection?e=window.getSelection().toString():document.selection&&"Control"!==document.selection.type&&(e=document.selection.createRange().text),e},r.prototype.copyable=function(e){if("string"!=typeof e&&void 0===e.toString)throw new Error("copyable requires string parameter");this.elTextarea.value=e,this.selectNodeText(this.elTextarea)},r.prototype.onCut=function(e){this.cutCallbacks.push(e)},r.prototype.onPaste=function(e){this.pasteCallbacks.push(e)},r.prototype.removeCallback=function(e){var t,n;for(t=0,n=this.copyCallbacks.length;n>t;t++)if(this.copyCallbacks[t]===e)return this.copyCallbacks.splice(t,1),!0;for(t=0,n=this.cutCallbacks.length;n>t;t++)if(this.cutCallbacks[t]===e)return this.cutCallbacks.splice(t,1),!0;for(t=0,n=this.pasteCallbacks.length;n>t;t++)if(this.pasteCallbacks[t]===e)return this.pasteCallbacks.splice(t,1),!0;return!1},r.prototype.triggerCut=function(e){var t=this;t.cutCallbacks&&setTimeout(function(){for(var n=0,o=t.cutCallbacks.length;o>n;n++)t.cutCallbacks[n](e)},50)},r.prototype.triggerPaste=function(e,t){var n=this;n.pasteCallbacks&&setTimeout(function(){for(var o=t||n.elTextarea.value,r=0,i=n.pasteCallbacks.length;i>r;r++)n.pasteCallbacks[r](o,e)},50)},r.prototype.destroy=function(){this.hasBeenDestroyed()||0!==--this.refCounter||(this.elDiv&&this.elDiv.parentNode&&(this.elDiv.parentNode.removeChild(this.elDiv),this.elDiv=null,this.elTextarea=null),document.documentElement.removeEventListener("keydown",this.onKeyDownRef),this.onKeyDownRef=null)},r.prototype.hasBeenDestroyed=function(){return!this.refCounter}},{}],es6collections:[function(e,t,n){"use strict";!function(e){function t(e,t){function o(e){return this&&this.constructor===o?(this._keys=[],this._values=[],this._itp=[],this.objectOnly=t,void(e&&n.call(this,e))):new o(e)}return t||b(e,"size",{get:m}),e.constructor=o,o.prototype=e,o}function n(e){this.add?e.forEach(this.add,this):e.forEach(function(e){this.set(e[0],e[1])},this)}function o(e){return this.has(e)&&(this._keys.splice(v,1),this._values.splice(v,1),this._itp.forEach(function(e){v-1}function r(e){return this.has(e)?this._values[v]:void 0}function i(e,t){if(this.objectOnly&&t!==Object(t))throw new TypeError("Invalid value used as weak collection key");if(t!=t||0===t)for(v=e.length;v--&&!C(e[v],t););else v=e.indexOf(t);return v>-1}function s(e){return i.call(this,this._values,e)}function l(e){return i.call(this,this._keys,e)}function a(e,t){return this.has(e)?this._values[v]=t:this._values[this._keys.push(e)-1]=t,this}function u(e){return this.has(e)||this._values.push(e),this}function c(){this._values.length=0}function d(){return p(this._itp,this._keys)}function h(){return p(this._itp,this._values)}function f(){return p(this._itp,this._keys,this._values)}function g(){return p(this._itp,this._values,this._values)}function p(e,t,n){var o=[0],r=!1;return e.push(o),{next:function(){var i,s=o[0];return!r&&st;t++)if(v[t].obj===e)return v[t]}function i(e){for(var t=0,n=v.length;n>t;t++)v[t]===e&&v.splice(t,1)}function s(e,t){for(var n=0,o=e.observers.length;o>n;n++)if(e.observers[n].callback===t)return e.observers[n].observer}function l(e,t){for(var n=0,o=e.observers.length;o>n;n++)if(e.observers[n].observer===t)return e.observers.splice(n,1),void(e.observers.length||i(e))}function a(e,t){h(t),Object.observe?d(t,e):clearTimeout(t.next);var n=r(e);l(n,t)}function u(e,t){var n,i=[],l=e,a=r(e);if(a?n=s(a,t):(a=new b(e),v.push(a)),n)return n;if(Object.observe)n=function(r){d(n,e),c(n,e);for(var s=0,a=r.length;a>s;){if(("length"!==r[s].name||!R(r[s].object))&&"__Jasmine_been_here_before__"!==r[s].name){var u=r[s].type;switch(u){case"new":u="add";break;case"deleted":u="delete";break;case"updated":u="update"}w[u].call(r[s],i,o(l,r[s].object))}s++}i&&t&&t(i),n.patches=i,i=[]};else if(n={},a.value=JSON.parse(JSON.stringify(e)),t){n.callback=t,n.next=null;var u=this.intervals||[100,1e3,1e4,6e4],f=0,g=function(){h(n)},p=function(){clearTimeout(n.next),n.next=setTimeout(function(){g(),f=0,n.next=setTimeout(m,u[f++])},0)},m=function(){g(),f==u.length&&(f=u.length-1),n.next=setTimeout(m,u[f++])};"undefined"!=typeof window&&(window.addEventListener?(window.addEventListener("mousedown",p),window.addEventListener("mouseup",p),window.addEventListener("keydown",p)):(window.attachEvent("onmousedown",p),window.attachEvent("onmouseup",p),window.attachEvent("onkeydown",p))),n.next=setTimeout(m,u[f++])}return n.patches=i,n.object=e,a.observers.push(new C(t,n)),c(n,e)}function c(e,t){if(Object.observe){Object.observe(t,e);for(var n in t)if(t.hasOwnProperty(n)){var o=t[n];o&&"object"==typeof o&&c(e,o)}}return e}function d(e,t){if(Object.observe){Object.unobserve(t,e);for(var n in t)if(t.hasOwnProperty(n)){var o=t[n];o&&"object"==typeof o&&d(e,o)}}return e}function h(e){if(Object.observe)Object.deliverChangeRecords(e);else{for(var t,n=0,o=v.length;o>n;n++)if(v[n].obj===e.object){t=v[n];break}t&&f(t.value,e.object,e.patches,"")}var r=e.patches;return r.length>0&&(e.patches=[],e.callback&&e.callback(r)),r}function f(e,n,o,r){for(var i=y(n),s=y(e),l=!1,a=!1,u=s.length-1;u>=0;u--){var c=s[u],d=e[c];if(n.hasOwnProperty(c)){var h=n[c];d instanceof Object?f(d,h,o,r+"/"+t(c)):d!=h&&(l=!0,o.push({op:"replace",path:r+"/"+t(c),value:h}),e[c]=h)}else o.push({op:"remove",path:r+"/"+t(c)}),delete e[c],a=!0}if(a||i.length!=s.length)for(var u=0;ur;){n=t[r];for(var s=n.path.split("/"),l=e,a=1,u=s.length;;)if(R(l)){var c=parseInt(s[a],10);if(a++,a>=u){o=m[n.op].call(n,l,c,e);break}l=l[c]}else{var d=s[a];if(-1!=d.indexOf("~")&&(d=d.replace(/~1/g,"/").replace(/~0/g,"~")),a++,a>=u){o=p[n.op].call(n,l,d,e);break}l=l[d]}r++}return o}var p={add:function(e,t){return e[t]=this.value,!0},remove:function(e,t){return delete e[t],!0},replace:function(e,t){return e[t]=this.value,!0},move:function(e,t,n){var o={op:"_get",path:this.from};return g(n,[o]),g(n,[{op:"remove",path:this.from}]),g(n,[{op:"add",path:this.path,value:o.value}]),!0},copy:function(e,t,n){var o={op:"_get",path:this.from};return g(n,[o]),g(n,[{op:"add",path:this.path,value:o.value}]),!0},test:function(e,t){return JSON.stringify(e[t])===JSON.stringify(this.value)},_get:function(e,t){this.value=e[t]}},m={add:function(e,t){return e.splice(t,0,this.value),!0},remove:function(e,t){return e.splice(t,1),!0},replace:function(e,t){return e[t]=this.value,!0},move:p.move,copy:p.copy,test:p.test,_get:p._get},w={add:function(e,n){var o={op:"add",path:n+t(this.name),value:this.object[this.name]};e.push(o)},"delete":function(e,n){var o={op:"remove",path:n+t(this.name)};e.push(o)},update:function(e,n){var o={op:"replace",path:n+t(this.name),value:this.object[this.name]};e.push(o)}},v=[];e.intervals;var b=function(){function e(e){this.observers=[],this.obj=e}return e}(),C=function(){function e(e,t){this.callback=e,this.observer=t}return e}();e.unobserve=a,e.observe=u,e.generate=h;var y;y=Object.keys?Object.keys:function(e){var t=[];for(var n in e)e.hasOwnProperty(n)&&t.push(n);return t};var R;R=Array.isArray?Array.isArray:function(e){return e.push&&"number"==typeof e.length},e.apply=g}(o||(o={})),"undefined"!=typeof n&&(n.apply=o.apply,n.observe=o.observe,n.unobserve=o.unobserve,n.generate=o.generate)},{}],numeral:[function(t,n,o){"use strict";(function(){function t(e){this._value=e}function o(e,t,n,o){var r,i,s=Math.pow(10,t);return i=(n(e*s)/s).toFixed(t),o&&(r=new RegExp("0{1,"+o+"}$"),i=i.replace(r,"")),i}function r(e,t,n){var o;return o=t.indexOf("$")>-1?s(e,t,n):t.indexOf("%")>-1?l(e,t,n):t.indexOf(":")>-1?a(e,t):c(e._value,t,n)}function i(e,t){var n,o,r,i,s,l=t,a=["KB","MB","GB","TB","PB","EB","ZB","YB"],c=!1;if(t.indexOf(":")>-1)e._value=u(t);else if(t===v)e._value=0;else{for("."!==m[w].delimiters.decimal&&(t=t.replace(/\./g,"").replace(m[w].delimiters.decimal,".")),n=new RegExp("[^a-zA-Z]"+m[w].abbreviations.thousand+"(?:\\)|(\\"+m[w].currency.symbol+")?(?:\\))?)?$"),o=new RegExp("[^a-zA-Z]"+m[w].abbreviations.million+"(?:\\)|(\\"+m[w].currency.symbol+")?(?:\\))?)?$"),r=new RegExp("[^a-zA-Z]"+m[w].abbreviations.billion+"(?:\\)|(\\"+m[w].currency.symbol+")?(?:\\))?)?$"),i=new RegExp("[^a-zA-Z]"+m[w].abbreviations.trillion+"(?:\\)|(\\"+m[w].currency.symbol+")?(?:\\))?)?$"),s=0;s<=a.length&&!(c=t.indexOf(a[s])>-1?Math.pow(1024,s+1):!1);s++);e._value=(c?c:1)*(l.match(n)?Math.pow(10,3):1)*(l.match(o)?Math.pow(10,6):1)*(l.match(r)?Math.pow(10,9):1)*(l.match(i)?Math.pow(10,12):1)*(t.indexOf("%")>-1?.01:1)*((t.split("-").length+Math.min(t.split("(").length-1,t.split(")").length-1))%2?1:-1)*Number(t.replace(/[^0-9\.]+/g,"")),e._value=c?Math.ceil(e._value):e._value}return e._value}function s(e,t,n){var o,r,i=t.indexOf("$"),s=t.indexOf("("),l=t.indexOf("-"),a="";return t.indexOf(" $")>-1?(a=" ",t=t.replace(" $","")):t.indexOf("$ ")>-1?(a=" ",t=t.replace("$ ","")):t=t.replace("$",""),r=c(e._value,t,n),1>=i?r.indexOf("(")>-1||r.indexOf("-")>-1?(r=r.split(""),o=1,(s>i||l>i)&&(o=0),r.splice(o,0,m[w].currency.symbol+a),r=r.join("")):r=m[w].currency.symbol+a+r:r.indexOf(")")>-1?(r=r.split(""),r.splice(-1,0,a+m[w].currency.symbol),r=r.join("")):r=r+a+m[w].currency.symbol,r}function l(e,t,n){var o,r="",i=100*e._value;return t.indexOf(" %")>-1?(r=" ",t=t.replace(" %","")):t=t.replace("%",""),o=c(i,t,n),o.indexOf(")")>-1?(o=o.split(""),o.splice(-1,0,r+"%"),o=o.join("")):o=o+r+"%",o}function a(e){var t=Math.floor(e._value/60/60),n=Math.floor((e._value-60*t*60)/60),o=Math.round(e._value-60*t*60-60*n);return t+":"+(10>n?"0"+n:n)+":"+(10>o?"0"+o:o)}function u(e){var t=e.split(":"),n=0;return 3===t.length?(n+=60*Number(t[0])*60,n+=60*Number(t[1]),n+=Number(t[2])):2===t.length&&(n+=60*Number(t[0]),n+=Number(t[1])),Number(n)}function c(e,t,n){var r,i,s,l,a,u,c=!1,d=!1,h=!1,f="",g=!1,p=!1,b=!1,C=!1,y=!1,R="",E="",S=Math.abs(e),T=["B","KB","MB","GB","TB","PB","EB","ZB","YB"],O="",_=!1;if(0===e&&null!==v)return v;if(t.indexOf("(")>-1?(c=!0,t=t.slice(1,-1)):t.indexOf("+")>-1&&(d=!0,t=t.replace(/\+/g,"")),t.indexOf("a")>-1&&(g=t.indexOf("aK")>=0,p=t.indexOf("aM")>=0,b=t.indexOf("aB")>=0,C=t.indexOf("aT")>=0,y=g||p||b||C,t.indexOf(" a")>-1?(f=" ",t=t.replace(" a","")):t=t.replace("a",""),S>=Math.pow(10,12)&&!y||C?(f+=m[w].abbreviations.trillion,e/=Math.pow(10,12)):S=Math.pow(10,9)&&!y||b?(f+=m[w].abbreviations.billion,e/=Math.pow(10,9)):S=Math.pow(10,6)&&!y||p?(f+=m[w].abbreviations.million,e/=Math.pow(10,6)):(S=Math.pow(10,3)&&!y||g)&&(f+=m[w].abbreviations.thousand,e/=Math.pow(10,3))),t.indexOf("b")>-1)for(t.indexOf(" b")>-1?(R=" ",t=t.replace(" b","")):t=t.replace("b",""),s=0;s<=T.length;s++)if(r=Math.pow(1024,s),i=Math.pow(1024,s+1),e>=r&&i>e){R+=T[s],r>0&&(e/=r);break}return t.indexOf("o")>-1&&(t.indexOf(" o")>-1?(E=" ",t=t.replace(" o","")):t=t.replace("o",""),E+=m[w].ordinal(e)),t.indexOf("[.]")>-1&&(h=!0,t=t.replace("[.]",".")),l=e.toString().split(".")[0],a=t.split(".")[1],u=t.indexOf(","),a?(a.indexOf("[")>-1?(a=a.replace("]",""),a=a.split("["),O=o(e,a[0].length+a[1].length,n,a[1].length)):O=o(e,a.length,n),l=O.split(".")[0],O=O.split(".")[1].length?m[w].delimiters.decimal+O.split(".")[1]:"",h&&0===Number(O.slice(1))&&(O="")):l=o(e,null,n),l.indexOf("-")>-1&&(l=l.slice(1),_=!0),u>-1&&(l=l.toString().replace(/(\d)(?=(\d{3})+(?!\d))/g,"$1"+m[w].delimiters.thousands)),0===t.indexOf(".")&&(l=""),(c&&_?"(":"")+(!c&&_?"-":"")+(!_&&d?"+":"")+l+O+(E?E:"")+(f?f:"")+(R?R:"")+(c&&_?")":"")}function d(e,t){m[e]=t}function h(e){var t=e.toString().split(".");return t.length<2?1:Math.pow(10,t[1].length)}function f(){var e=Array.prototype.slice.call(arguments);return e.reduce(function(e,t){var n=h(e),o=h(t);return n>o?n:o},-(1/0))}var g,p="1.5.3",m={},w="en",v=null,b="0,0",C="undefined"!=typeof n&&n.exports;g=function(e){return g.isNumeral(e)?e=e.value():0===e||"undefined"==typeof e?e=0:Number(e)||(e=g.fn.unformat(e)),new t(Number(e))},g.version=p,g.isNumeral=function(e){return e instanceof t},g.language=function(e,t){if(!e)return w;if(e&&!t){if(!m[e])throw new Error("Unknown language : "+e);w=e}return(t||!m[e])&&d(e,t),g},g.languageData=function(e){if(!e)return m[w];if(!m[e])throw new Error("Unknown language : "+e);return m[e]},g.language("en",{delimiters:{thousands:",",decimal:"."},abbreviations:{thousand:"k",million:"m",billion:"b",trillion:"t"},ordinal:function(e){var t=e%10;return 1===~~(e%100/10)?"th":1===t?"st":2===t?"nd":3===t?"rd":"th"},currency:{symbol:"$"}}),g.zeroFormat=function(e){v="string"==typeof e?e:null},g.defaultFormat=function(e){b="string"==typeof e?e:"0.0"},g.validate=function(e,t){var n,o,r,i,s,l,a,u;if("string"!=typeof e&&(e+="",console.warn&&console.warn("Numeral.js: Value is not string. It has been co-erced to: ",e)),e=e.trim(),""===e)return!1;e=e.replace(/^[+-]?/,"");try{a=g.languageData(t)}catch(c){a=g.languageData(g.language())}return r=a.currency.symbol,s=a.abbreviations,n=a.delimiters.decimal,o="."===a.delimiters.thousands?"\\.":a.delimiters.thousands,u=e.match(/^[^\d\.\,]+/),null!==u&&(e=e.substr(1),u[0]!==r)?!1:(u=e.match(/[^\d]+$/),null!==u&&(e=e.slice(0,-1),u[0]!==s.thousand&&u[0]!==s.million&&u[0]!==s.billion&&u[0]!==s.trillion)?!1:e.match(/^\d+$/)?!0:(l=new RegExp(o+"{2}"),e.match(/[^\d.,]/g)?!1:(i=e.split(n),i.length>2?!1:i.length<2?!!i[0].match(/^\d+.*\d$/)&&!i[0].match(l):""===i[0]?!i[0].match(l)&&!!i[1].match(/^\d+$/):1===i[0].length?!!i[0].match(/^\d+$/)&&!i[0].match(l)&&!!i[1].match(/^\d+$/):!!i[0].match(/^\d+.*\d$/)&&!i[0].match(l)&&!!i[1].match(/^\d+$/))))},"function"!=typeof Array.prototype.reduce&&(Array.prototype.reduce=function(e,t){if(null===this||"undefined"==typeof this)throw new TypeError("Array.prototype.reduce called on null or undefined");if("function"!=typeof e)throw new TypeError(e+" is not a function");var n,o,r=this.length>>>0,i=!1;for(1n;++n)this.hasOwnProperty(n)&&(i?o=e(o,this[n],n,this):(o=this[n],i=!0));if(!i)throw new TypeError("Reduce of empty array with no initial value");return o}),g.fn=t.prototype={clone:function(){return g(this)},format:function(e,t){return r(this,e?e:b,void 0!==t?t:Math.round)},unformat:function(e){return"[object Number]"===Object.prototype.toString.call(e)?e:i(this,e?e:b)},value:function(){return this._value},valueOf:function(){return this._value},set:function(e){return this._value=Number(e),this},add:function(e){function t(e,t,o,r){return e+n*t}var n=f.call(null,this._value,e);return this._value=[this._value,e].reduce(t,0)/n,this},subtract:function(e){function t(e,t,o,r){return e-n*t}var n=f.call(null,this._value,e);return this._value=[e].reduce(t,this._value*n)/n,this},multiply:function(e){function t(e,t,n,o){var r=f(e,t);return e*r*(t*r)/(r*r)}return this._value=[this._value,e].reduce(t,1),this},divide:function(e){function t(e,t,n,o){var r=f(e,t);return e*r/(t*r)}return this._value=[this._value,e].reduce(t),this},difference:function(e){return Math.abs(g(this._value).subtract(e).value())}},C&&(n.exports=g),"undefined"==typeof ender&&(this.numeral=g),"function"==typeof e&&e.amd&&e([],function(){return g})}).call(window)},{}]},{},[23,59,61,60,62,83,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,84,85,86,87,100,101,102,90,91,92,93,94,95,31,35,32,33,40,34,36,37,38,39])("numeral")}); \ No newline at end of file diff --git a/bower_components/handsontable/handsontable.jquery.json b/bower_components/handsontable/handsontable.jquery.json index 47279ac..6823881 100644 --- a/bower_components/handsontable/handsontable.jquery.json +++ b/bower_components/handsontable/handsontable.jquery.json @@ -1,7 +1,7 @@ { "name": "handsontable", "title": "Handsontable", - "version": "0.20.1", + "version": "0.20.2", "author": { "name": "Marcin Warpechowski", "email": "hello@handsontable.com", diff --git a/bower_components/handsontable/package.json b/bower_components/handsontable/package.json index 2780e6e..1ac5f97 100644 --- a/bower_components/handsontable/package.json +++ b/bower_components/handsontable/package.json @@ -10,7 +10,7 @@ "url": "https://github.com/handsontable/handsontable/issues" }, "author": "Handsoncode ", - "version": "0.20.1", + "version": "0.20.2", "keywords": [ "data", "grid", diff --git a/lib/handsontable.meteor.0.20.2.css b/lib/handsontable.meteor.0.20.2.css new file mode 100644 index 0000000..b8e6c92 --- /dev/null +++ b/lib/handsontable.meteor.0.20.2.css @@ -0,0 +1,1392 @@ +/*! +(The MIT License) + +Copyright (c) 2012-2014 Marcin Warpechowski +Copyright (c) 2015 Handsoncode sp. z o.o. + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +'Software'), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +*/ +.handsontable { + position: relative; +} + +.handsontable .hide{ + display: none; +} +.handsontable .relative { + position: relative; +} + +.handsontable.htAutoSize { + visibility: hidden; + left: -99000px; + position: absolute; + top: -99000px; +} + +.handsontable .wtHider { + width: 0; +} + +.handsontable .wtSpreader { + position: relative; + width: 0; /*must be 0, otherwise blank space appears in scroll demo after scrolling max to the right */ + height: auto; +} + +.handsontable table, +.handsontable tbody, +.handsontable thead, +.handsontable td, +.handsontable th, +.handsontable input, +.handsontable textarea, +.handsontable div { + box-sizing: content-box; + -webkit-box-sizing: content-box; + -moz-box-sizing: content-box; +} + +.handsontable input, +.handsontable textarea { + min-height: initial; +} + +.handsontable table.htCore { + border-collapse: separate; + /*it must be separate, otherwise there are offset miscalculations in WebKit: http://stackoverflow.com/questions/2655987/border-collapse-differences-in-ff-and-webkit*/ + /*this actually only changes appearance of user selection - does not make text unselectable + -webkit-user-select: none; + -khtml-user-select: none; + -moz-user-select: none; + -o-user-select: none; + -ms-user-select: none; + /*user-select: none; /*no browser supports unprefixed version*/ + border-spacing: 0; + margin: 0; + border-width: 0; + table-layout: fixed; + width: 0; + outline-width: 0; + /* reset bootstrap table style. for more info see: https://github.com/handsontable/handsontable/issues/224 */ + max-width: none; + max-height: none; +} + +.handsontable col { + width: 50px; +} + +.handsontable col.rowHeader { + width: 50px; +} + +.handsontable th, +.handsontable td { + border-right: 1px solid #CCC; + border-bottom: 1px solid #CCC; + height: 22px; + empty-cells: show; + line-height: 21px; + padding: 0 4px 0 4px; + /* top, bottom padding different than 0 is handled poorly by FF with HTML5 doctype */ + background-color: #FFF; + vertical-align: top; + overflow: hidden; + outline-width: 0; + white-space: pre-line; + /* preserve new line character in cell */ +} + +.handsontable td.htInvalid { + background-color: #ff4c42 !important; /*gives priority over td.area selection background*/ +} + +.handsontable td.htNoWrap { + white-space: nowrap; +} + +.handsontable th:last-child { + /*Foundation framework fix*/ + border-right: 1px solid #CCC; + border-bottom: 1px solid #CCC; +} + +.handsontable tr:first-child th.htNoFrame, +.handsontable th:first-child.htNoFrame, +.handsontable th.htNoFrame { + border-left-width: 0; + background-color: white; + border-color: #FFF; +} + +.handsontable th:first-child, +.handsontable td:first-of-type, +.handsontable .htNoFrame + th, +.handsontable .htNoFrame + td { + border-left: 1px solid #CCC; +} + +.handsontable.htRowHeaders thead tr th:nth-child(2) { + border-left: 1px solid #CCC; +} + +.handsontable tr:first-child th, +.handsontable tr:first-child td { + border-top: 1px solid #CCC; +} + +.ht_master:not(.innerBorderLeft) ~ .handsontable tbody tr th, +.ht_master:not(.innerBorderLeft) ~ .handsontable:not(.ht_clone_top) thead tr th:first-child +{ + border-right-width: 0; +} + +.ht_master:not(.innerBorderTop) thead tr:last-child th, +.ht_master:not(.innerBorderTop) ~ .handsontable thead tr:last-child th, +.ht_master:not(.innerBorderTop) thead tr.lastChild th, +.ht_master:not(.innerBorderTop) ~ .handsontable thead tr.lastChild th { + border-bottom-width: 0; +} + +.handsontable th { + background-color: #EEE; + color: #222; + text-align: center; + font-weight: normal; + white-space: nowrap; +} + +.handsontable thead th { + padding: 0; +} + +.handsontable th.active { + background-color: #CCC; +} + +.handsontable thead th .relative { + padding: 2px 4px; +} + +/* plugins */ + +.handsontable .manualColumnMover { + position: fixed; + left: 0; + top: 0; + background-color: transparent; + width: 5px; + height: 25px; + z-index: 999; + cursor: move; +} + +.handsontable .manualRowMover { + position: fixed; + left: -4px; + top: 0; + background-color: transparent; + height: 5px; + width: 50px; + z-index: 999; + cursor: move; +} + +.handsontable .manualColumnMoverGuide, +.handsontable .manualRowMoverGuide { + position: fixed; + left: 0; + top: 0; + background-color: #CCC; + width: 25px; + height: 25px; + opacity: 0.7; + display: none; +} + +.handsontable .manualColumnMoverGuide.active, +.handsontable .manualRowMoverGuide.active { + display: block; +} + +.handsontable .manualColumnMover:hover, +.handsontable .manualColumnMover.active, +.handsontable .manualRowMover:hover, +.handsontable .manualRowMover.active{ + background-color: #88F; +} + +/* row + column resizer*/ + +.handsontable .manualColumnResizer { + position: fixed; + top: 0; + cursor: col-resize; + z-index: 110; + width: 5px; + height: 25px; +} + +.handsontable .manualRowResizer { + position: fixed; + left: 0; + cursor: row-resize; + z-index: 110; + height: 5px; + width: 50px; +} + +.handsontable .manualColumnResizer:hover, +.handsontable .manualColumnResizer.active, +.handsontable .manualRowResizer:hover, +.handsontable .manualRowResizer.active { + background-color: #AAB; +} + +.handsontable .manualColumnResizerGuide { + position: fixed; + right: 0; + top: 0; + background-color: #AAB; + display: none; + width: 0; + border-right: 1px dashed #777; + margin-left: 5px; +} + +.handsontable .manualRowResizerGuide { + position: fixed; + left: 0; + bottom: 0; + background-color: #AAB; + display: none; + height: 0; + border-bottom: 1px dashed #777; + margin-top: 5px; +} + +.handsontable .manualColumnResizerGuide.active, +.handsontable .manualRowResizerGuide.active { + display: block; +} + +.handsontable .columnSorting { + position: relative; +} + +.handsontable .columnSorting:hover { + text-decoration: underline; + cursor: pointer; +} + +.handsontable .columnSorting.ascending::after { + content: '\25B2'; + color: #5f5f5f; + position: absolute; + right: -15px; +} + +.handsontable .columnSorting.descending::after { + content: '\25BC'; + color: #5f5f5f; + position: absolute; + right: -15px; +} + +.handsontable th.beforeHiddenColumn { + position: relative; +} + +.handsontable th.beforeHiddenColumn::after, +.handsontable th.afterHiddenColumn::before { + content: '\25C0'; + color: #bbb; + position: absolute; + right: 1px; + top: 2px; + font-size: 5pt; +} + +.handsontable th.afterHiddenColumn { + position: relative; +} + +.handsontable th.afterHiddenColumn::before { + left: 1px; + top: 2px; + right: auto; + content: '\25B6'; +} + +.handsontable td.afterHiddenColumn.firstVisible { + border-left: 1px solid #CCC; +} + +.handsontable thead th.hiddenHeader { + display: none; +} + +/* border line */ + +.handsontable .wtBorder { + position: absolute; + font-size: 0; +} +.handsontable .wtBorder.hidden{ + display:none !important; +} + +.handsontable td.area { + background: -moz-linear-gradient(top, rgba(181,209,255,0.34) 0%, rgba(181,209,255,0.34) 100%); /* FF3.6+ */ + background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,rgba(181,209,255,0.34)), color-stop(100%,rgba(181,209,255,0.34))); /* Chrome,Safari4+ */ + background: -webkit-linear-gradient(top, rgba(181,209,255,0.34) 0%,rgba(181,209,255,0.34) 100%); /* Chrome10+,Safari5.1+ */ + background: -o-linear-gradient(top, rgba(181,209,255,0.34) 0%,rgba(181,209,255,0.34) 100%); /* Opera 11.10+ */ + background: -ms-linear-gradient(top, rgba(181,209,255,0.34) 0%,rgba(181,209,255,0.34) 100%); /* IE10+ */ + background: linear-gradient(to bottom, rgba(181,209,255,0.34) 0%,rgba(181,209,255,0.34) 100%); /* W3C */ + filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#57b5d1ff', endColorstr='#57b5d1ff',GradientType=0 ); /* IE6-9 */ + background-color: #fff; +} + +/* fill handle */ + +.handsontable .wtBorder.corner { + font-size: 0; + cursor: crosshair; +} + +.handsontable .htBorder.htFillBorder { + background: red; + width: 1px; + height: 1px; +} + +.handsontableInput { + border:none; + outline-width: 0; + margin: 0 ; + padding: 1px 5px 0 5px; + font-family: inherit; + line-height: 21px; + font-size: inherit; + box-shadow: 0 0 0 2px #5292F7 inset; + resize: none; + /*below are needed to overwrite stuff added by jQuery UI Bootstrap theme*/ + display: inline-block; + color: #000; + border-radius: 0; + background-color: #FFF; + /*overwrite styles potentionally made by a framework*/ +} + +.handsontableInputHolder { + position: absolute; + top: 0; + left: 0; + z-index: 100; +} + +.htSelectEditor { + -webkit-appearance: menulist-button !important; + position: absolute; + width: auto; +} + +/* +TextRenderer readOnly cell +*/ + +.handsontable .htDimmed { + color: #777; +} + +.handsontable .htSubmenu { + position: relative; +} + +.handsontable .htSubmenu :after{ + content: '▶'; + color: #777; + position: absolute; + right: 5px; +} + + +/* +TextRenderer horizontal alignment +*/ +.handsontable .htLeft{ + text-align: left; +} +.handsontable .htCenter{ + text-align: center; +} +.handsontable .htRight{ + text-align: right; +} +.handsontable .htJustify{ + text-align: justify; +} +/* +TextRenderer vertical alignment +*/ +.handsontable .htTop{ + vertical-align: top; +} +.handsontable .htMiddle{ + vertical-align: middle; +} +.handsontable .htBottom{ + vertical-align: bottom; +} + +/* +TextRenderer placeholder value +*/ + +.handsontable .htPlaceholder { + color: #999; +} + +/* +AutocompleteRenderer down arrow +*/ + +.handsontable .htAutocompleteArrow { + float: right; + font-size: 10px; + color: #EEE; + cursor: default; + width: 16px; + text-align: center; +} + +.handsontable td .htAutocompleteArrow:hover { + color: #777; +} + +.handsontable td.area .htAutocompleteArrow { + color: #d3d3d3; +} + +/* +CheckboxRenderer +*/ + +.handsontable .htCheckboxRendererInput.noValue { + opacity: 0.5; +} +.handsontable .htCheckboxRendererLabel { + cursor: pointer; + display: inline-block; + width: 100%; +} + +/* +NumericRenderer +*/ + +.handsontable .htNumeric { + text-align: right; +} + +/* +Comment For Cell +*/ +.htCommentCell{ + position: relative; +} +.htCommentCell:after{ + content: ''; + position: absolute; + top: 0; + right: 0; + border-left: 6px solid transparent; + border-top: 6px solid red; +} + +@-webkit-keyframes opacity-hide { + from { + opacity: 1; + } + to { + opacity: 0; + /*display: none;*/ + } +} +@keyframes opacity-hide { + from { + /*display: block;*/ + opacity: 1; + } + to { + opacity: 0; + /*display: none;*/ + } +} + +@-webkit-keyframes opacity-show { + from { + opacity: 0; + /*display: none;*/ + } + to { + opacity: 1; + /*display: block;*/ + } +} +@keyframes opacity-show { + from { + opacity: 0; + /*display: none;*/ + } + to { + opacity: 1; + /*display: block;*/ + } +} + +/** + * Handsontable in Handsontable + */ + +.handsontable .handsontable.ht_clone_top .wtHider { + padding: 0 0 5px 0; +} + +/* removing shadows, TODO: remove the commented code and this comment */ +/*.handsontable .handsontable:not(.ht_master) table {*/ + /*-webkit-box-shadow: 1px 2px 5px rgba(0, 0, 0, 0.4);*/ + /*box-shadow: 1px 2px 5px rgba(0, 0, 0, 0.4);*/ +/*}*/ + +/** +* Autocomplete Editor +*/ +.handsontable .autocompleteEditor.handsontable { + padding-right: 17px; +} +.handsontable .autocompleteEditor.handsontable.htMacScroll { + padding-right: 15px; +} + + +/** + * Handsontable listbox theme + */ + +.handsontable.listbox { + margin: 0; +} + +.handsontable.listbox .ht_master table { + border: 1px solid #ccc; + border-collapse: separate; + background: white; +} + +.handsontable.listbox th, +.handsontable.listbox tr:first-child th, +.handsontable.listbox tr:last-child th, +.handsontable.listbox tr:first-child td, +.handsontable.listbox td { + border-color: transparent; +} + +.handsontable.listbox th, +.handsontable.listbox td { + white-space: nowrap; + text-overflow: ellipsis; +} + +.handsontable.listbox td.htDimmed { + cursor: default; + color: inherit; + font-style: inherit; +} + +.handsontable.listbox .wtBorder { + visibility: hidden; +} + +.handsontable.listbox tr td.current, +.handsontable.listbox tr:hover td { + background: #eee; +} + +.ht_clone_top { + z-index: 101; +} + +.ht_clone_left { + z-index: 102; +} + +.ht_clone_top_left_corner, +.ht_clone_bottom_left_corner { + z-index: 103; +} + +.ht_clone_debug { + z-index: 103; +} + +.handsontable td.htSearchResult { + background: #fcedd9; + color: #583707; +} + +/* +Cell borders +*/ +.htBordered{ + /*box-sizing: border-box !important;*/ + border-width: 1px; +} +.htBordered.htTopBorderSolid { + border-top-style: solid; + border-top-color: #000; +} +.htBordered.htRightBorderSolid { + border-right-style: solid; + border-right-color: #000; +} +.htBordered.htBottomBorderSolid { + border-bottom-style: solid; + border-bottom-color: #000; +} +.htBordered.htLeftBorderSolid { + border-left-style: solid; + border-left-color: #000; +} + +.htCommentTextArea{ + -moz-box-shadow: 1px 1px 2px #bbb; + -webkit-box-shadow: 1px 1px 2px #bbb; + background-color: #FFFACD; + border: 1px solid #999; + box-shadow: 1px 1px 2px #bbb; + font-family: 'Arial'; +} + +.handsontable tbody tr th:nth-last-child(2) { + border-right: 1px solid #CCC; +} + +.handsontable thead tr:nth-last-child(2) th.htGroupIndicatorContainer { + border-bottom: 1px solid #CCC; + padding-bottom: 5px; +} + + +.ht_clone_top_left_corner thead tr th:nth-last-child(2) { + border-right: 1px solid #CCC; +} + +.htCollapseButton { + width: 10px; + height: 10px; + line-height: 10px; + text-align: center; + border-radius: 5px; + border: 1px solid #f3f3f3; + -webkit-box-shadow: 1px 1px 3px rgba(0, 0, 0, 0.4); + box-shadow: 1px 1px 3px rgba(0, 0, 0, 0.4); + cursor: pointer; + margin-bottom: 3px; + position: relative; +} + +.htCollapseButton:after { + content: ""; + height: 300%; + width: 1px; + display: block; + background: #ccc; + margin-left: 4px; + position: absolute; + /*top: -300%;*/ + bottom: 10px; +} + + +thead .htCollapseButton { + right: 5px; + position: absolute; + top: 5px; + background: #fff; +} + +thead .htCollapseButton:after { + height: 1px; + width: 700%; + right: 10px; + top: 4px; +} + +.handsontable tr th .htExpandButton { + position: absolute; + width: 10px; + height: 10px; + line-height: 10px; + text-align: center; + border-radius: 5px; + border: 1px solid #f3f3f3; + -webkit-box-shadow: 1px 1px 3px rgba(0, 0, 0, 0.4); + box-shadow: 1px 1px 3px rgba(0, 0, 0, 0.4); + cursor: pointer; + top: 0; + display: none; +} + +.handsontable thead tr th .htExpandButton { + /*left: 5px;*/ + top: 5px; +} + +.handsontable tr th .htExpandButton.clickable { + display: block; +} + +.collapsibleIndicator { + position: absolute; + top: 50%; + transform: translate(0% ,-50%); + right: 5px; + border: 1px solid #A6A6A6; + line-height: 10px; + color: #222; + border-radius: 10px; + font-size: 10px; + width: 10px; + height: 10px; + cursor: pointer; + -webkit-box-shadow: 0px 0px 0px 6px rgba(238,238,238,1); + -moz-box-shadow: 0px 0px 0px 6px rgba(238,238,238,1); + box-shadow: 0px 0px 0px 6px rgba(238,238,238,1); + background: #eee; +} + +.handsontable col.hidden { + width: 0 !important; +} + +.handsontable table tr th.lightRightBorder { + border-right: 1px solid #E6E6E6; +} + +.handsontable tr.hidden, +.handsontable tr.hidden td, +.handsontable tr.hidden th { + display: none; +} + +.ht_master, +.ht_clone_left, +.ht_clone_top, +.ht_clone_bottom { + overflow: hidden; +} + +.ht_master .wtHolder { + overflow: auto; +} + +.ht_clone_left .wtHolder { + overflow-x: hidden; + overflow-y: auto; +} + +.ht_clone_top .wtHolder, +.ht_clone_bottom .wtHolder { + overflow-x: auto; + overflow-y: hidden; +} + + +/*WalkontableDebugOverlay*/ + +.wtDebugHidden { + display: none; +} + +.wtDebugVisible { + display: block; + -webkit-animation-duration: 0.5s; + -webkit-animation-name: wtFadeInFromNone; + animation-duration: 0.5s; + animation-name: wtFadeInFromNone; +} + +@keyframes wtFadeInFromNone { + 0% { + display: none; + opacity: 0; + } + + 1% { + display: block; + opacity: 0; + } + + 100% { + display: block; + opacity: 1; + } +} + +@-webkit-keyframes wtFadeInFromNone { + 0% { + display: none; + opacity: 0; + } + + 1% { + display: block; + opacity: 0; + } + + 100% { + display: block; + opacity: 1; + } +} +/* + + Handsontable Mobile Text Editor stylesheet + + */ + +.handsontable.mobile, +.handsontable.mobile .wtHolder { + -webkit-touch-callout:none; + -webkit-user-select:none; + -khtml-user-select:none; + -moz-user-select:none; + -ms-user-select:none; + user-select:none; + -webkit-tap-highlight-color:rgba(0,0,0,0); + -webkit-overflow-scrolling: touch; +} + +.htMobileEditorContainer { + display: none; + position: absolute; + top: 0; + width: 70%; + height: 54pt; + background: #f8f8f8; + border-radius: 20px; + border: 1px solid #ebebeb; + z-index: 999; + box-sizing: border-box; + -webkit-box-sizing: border-box; + -webkit-text-size-adjust: none; +} + +.topLeftSelectionHandle:not(.ht_master .topLeftSelectionHandle), +.topLeftSelectionHandle-HitArea:not(.ht_master .topLeftSelectionHandle-HitArea) { + z-index: 9999; +} + +/* Initial left/top coordinates - overwritten when actual position is set */ +.topLeftSelectionHandle, +.topLeftSelectionHandle-HitArea, +.bottomRightSelectionHandle, +.bottomRightSelectionHandle-HitArea { + left: -10000px; + top: -10000px; +} + +.htMobileEditorContainer.active { + display: block; +} + +.htMobileEditorContainer .inputs { + position: absolute; + right: 210pt; + bottom: 10pt; + top: 10pt; + left: 14px; + height: 34pt; +} + +.htMobileEditorContainer .inputs textarea { + font-size: 13pt; + border: 1px solid #a1a1a1; + -webkit-appearance: none; + -webkit-box-shadow: none; + -moz-box-shadow: none; + box-shadow: none; + position: absolute; + left: 14px; + right: 14px; + top: 0; + bottom: 0; + padding: 7pt; +} + +.htMobileEditorContainer .cellPointer { + position: absolute; + top: -13pt; + height: 0; + width: 0; + left: 30px; + + border-left: 13pt solid transparent; + border-right: 13pt solid transparent; + border-bottom: 13pt solid #ebebeb; +} + +.htMobileEditorContainer .cellPointer.hidden { + display: none; +} + +.htMobileEditorContainer .cellPointer:before { + content: ''; + display: block; + position: absolute; + top: 2px; + height: 0; + width: 0; + left: -13pt; + + border-left: 13pt solid transparent; + border-right: 13pt solid transparent; + border-bottom: 13pt solid #f8f8f8; +} + +.htMobileEditorContainer .moveHandle { + position: absolute; + top: 10pt; + left: 5px; + width: 30px; + bottom: 0px; + cursor: move; + z-index: 9999; +} + +.htMobileEditorContainer .moveHandle:after { + content: "..\a..\a..\a.."; + white-space: pre; + line-height: 10px; + font-size: 20pt; + display: inline-block; + margin-top: -8px; + color: #ebebeb; +} + +.htMobileEditorContainer .positionControls { + width: 205pt; + position: absolute; + right: 5pt; + top: 0; + bottom: 0; +} + +.htMobileEditorContainer .positionControls > div { + width: 50pt; + height: 100%; + float: left; +} + +.htMobileEditorContainer .positionControls > div:after { + content: " "; + display: block; + width: 15pt; + height: 15pt; + text-align: center; + line-height: 50pt; +} + +.htMobileEditorContainer .leftButton:after, +.htMobileEditorContainer .rightButton:after, +.htMobileEditorContainer .upButton:after, +.htMobileEditorContainer .downButton:after { + transform-origin: 5pt 5pt; + -webkit-transform-origin: 5pt 5pt; + margin: 21pt 0 0 21pt; +} + +.htMobileEditorContainer .leftButton:after { + border-top: 2px solid #288ffe; + border-left: 2px solid #288ffe; + -webkit-transform: rotate(-45deg); + /*margin-top: 17pt;*/ + /*margin-left: 20pt;*/ +} +.htMobileEditorContainer .leftButton:active:after { + border-color: #cfcfcf; +} + +.htMobileEditorContainer .rightButton:after { + border-top: 2px solid #288ffe; + border-left: 2px solid #288ffe; + -webkit-transform: rotate(135deg); + /*margin-top: 17pt;*/ + /*margin-left: 10pt;*/ +} +.htMobileEditorContainer .rightButton:active:after { + border-color: #cfcfcf; +} + +.htMobileEditorContainer .upButton:after { + /*border-top: 2px solid #cfcfcf;*/ + border-top: 2px solid #288ffe; + border-left: 2px solid #288ffe; + -webkit-transform: rotate(45deg); + /*margin-top: 22pt;*/ + /*margin-left: 15pt;*/ +} +.htMobileEditorContainer .upButton:active:after { + border-color: #cfcfcf; +} + +.htMobileEditorContainer .downButton:after { + border-top: 2px solid #288ffe; + border-left: 2px solid #288ffe; + -webkit-transform: rotate(225deg); + /*margin-top: 15pt;*/ + /*margin-left: 15pt;*/ +} +.htMobileEditorContainer .downButton:active:after { + border-color: #cfcfcf; +} + +.handsontable.hide-tween { + -webkit-animation: opacity-hide 0.3s; + animation: opacity-hide 0.3s; + animation-fill-mode: forwards; + -webkit-animation-fill-mode: forwards; +} + +.handsontable.show-tween { + -webkit-animation: opacity-show 0.3s; + animation: opacity-show 0.3s; + animation-fill-mode: forwards; + -webkit-animation-fill-mode: forwards; +} +/*! + * Handsontable ContextMenu + */ + +.htContextMenu { + display: none; + position: absolute; + z-index: 1060; /* needs to be higher than 1050 - z-index for Twitter Bootstrap modal (#1569) */ +} + +.htContextMenu .ht_clone_top, +.htContextMenu .ht_clone_left, +.htContextMenu .ht_clone_corner, +.htContextMenu .ht_clone_debug { + display: none; +} + +.htContextMenu table.htCore { + border: 1px solid #bbb; + border-bottom-width: 2px; + border-right-width: 2px; +} + +.htContextMenu .wtBorder { + visibility: hidden; +} + +.htContextMenu table tbody tr td { + background: white; + border-width: 0; + padding: 4px 6px 0 6px; + cursor: pointer; + overflow: hidden; + white-space: nowrap; + text-overflow: ellipsis; +} + +.htContextMenu table tbody tr td:first-child { + border: 0; +} + +.htContextMenu table tbody tr td.htDimmed { + font-style: normal; + color: #323232; +} + +.htContextMenu table tbody tr td.current, +.htContextMenu table tbody tr td.zeroclipboard-is-hover { + background: #e9e9e9; +} + +.htContextMenu table tbody tr td.htSeparator { + border-top: 1px solid #bbb; + height: 0; + padding: 0; +} + +.htContextMenu table tbody tr td.htDisabled { + color: #999; +} + +.htContextMenu table tbody tr td.htDisabled:hover { + background: #fff; + color: #999; + cursor: default; +} + +.htContextMenu table tbody tr.htHidden { + display: none; +} + +.htContextMenu table tbody tr td .htItemWrapper { + margin-left: 10px; + margin-right: 6px; +} + +.htContextMenu table tbody tr td div span.selected { + margin-top: -2px; + position: absolute; + left: 4px; +} + +.htContextMenu .ht_master .wtHolder { + overflow: hidden; +} +@charset "UTF-8"; + +/*! + * Pikaday + * Copyright © 2014 David Bushell | BSD & MIT license | http://dbushell.com/ + */ + +.pika-single { + z-index: 9999; + display: block; + position: relative; + color: #333; + background: #fff; + border: 1px solid #ccc; + border-bottom-color: #bbb; + font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; +} + +/* +clear child float (pika-lendar), using the famous micro clearfix hack +http://nicolasgallagher.com/micro-clearfix-hack/ +*/ +.pika-single:before, +.pika-single:after { + content: " "; + display: table; +} +.pika-single:after { clear: both } +.pika-single { *zoom: 1 } + +.pika-single.is-hidden { + display: none; +} + +.pika-single.is-bound { + position: absolute; + box-shadow: 0 5px 15px -5px rgba(0,0,0,.5); +} + +.pika-lendar { + float: left; + width: 240px; + margin: 8px; +} + +.pika-title { + position: relative; + text-align: center; +} + +.pika-label { + display: inline-block; + *display: inline; + position: relative; + z-index: 9999; + overflow: hidden; + margin: 0; + padding: 5px 3px; + font-size: 14px; + line-height: 20px; + font-weight: bold; + background-color: #fff; +} +.pika-title select { + cursor: pointer; + position: absolute; + z-index: 9998; + margin: 0; + left: 0; + top: 5px; + filter: alpha(opacity=0); + opacity: 0; +} + +.pika-prev, +.pika-next { + display: block; + cursor: pointer; + position: relative; + outline: none; + border: 0; + padding: 0; + width: 20px; + height: 30px; + /* hide text using text-indent trick, using width value (it's enough) */ + text-indent: 20px; + white-space: nowrap; + overflow: hidden; + background-color: transparent; + background-position: center center; + background-repeat: no-repeat; + background-size: 75% 75%; + opacity: .5; + *position: absolute; + *top: 0; +} + +.pika-prev:hover, +.pika-next:hover { + opacity: 1; +} + +.pika-prev, +.is-rtl .pika-next { + float: left; + background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAeCAYAAAAsEj5rAAAAUklEQVR42u3VMQoAIBADQf8Pgj+OD9hG2CtONJB2ymQkKe0HbwAP0xucDiQWARITIDEBEnMgMQ8S8+AqBIl6kKgHiXqQqAeJepBo/z38J/U0uAHlaBkBl9I4GwAAAABJRU5ErkJggg=='); + *left: 0; +} + +.pika-next, +.is-rtl .pika-prev { + float: right; + background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAeCAYAAAAsEj5rAAAAU0lEQVR42u3VOwoAMAgE0dwfAnNjU26bYkBCFGwfiL9VVWoO+BJ4Gf3gtsEKKoFBNTCoCAYVwaAiGNQGMUHMkjGbgjk2mIONuXo0nC8XnCf1JXgArVIZAQh5TKYAAAAASUVORK5CYII='); + *right: 0; +} + +.pika-prev.is-disabled, +.pika-next.is-disabled { + cursor: default; + opacity: .2; +} + +.pika-select { + display: inline-block; + *display: inline; +} + +.pika-table { + width: 100%; + border-collapse: collapse; + border-spacing: 0; + border: 0; +} + +.pika-table th, +.pika-table td { + width: 14.285714285714286%; + padding: 0; +} + +.pika-table th { + color: #999; + font-size: 12px; + line-height: 25px; + font-weight: bold; + text-align: center; +} + +.pika-button { + cursor: pointer; + display: block; + box-sizing: border-box; + -moz-box-sizing: border-box; + outline: none; + border: 0; + margin: 0; + width: 100%; + padding: 5px; + color: #666; + font-size: 12px; + line-height: 15px; + text-align: right; + background: #f5f5f5; +} + +.pika-week { + font-size: 11px; + color: #999; +} + +.is-today .pika-button { + color: #33aaff; + font-weight: bold; +} + +.is-selected .pika-button { + color: #fff; + font-weight: bold; + background: #33aaff; + box-shadow: inset 0 1px 3px #178fe5; + border-radius: 3px; +} + +.is-inrange .pika-button { + background: #D5E9F7; +} + +.is-startrange .pika-button { + color: #fff; + background: #6CB31D; + box-shadow: none; + border-radius: 3px; +} + +.is-endrange .pika-button { + color: #fff; + background: #33aaff; + box-shadow: none; + border-radius: 3px; +} + +.is-disabled .pika-button { + pointer-events: none; + cursor: default; + color: #999; + opacity: .3; +} + +.pika-button:hover { + color: #fff; + background: #ff8000; + box-shadow: none; + border-radius: 3px; +} + +/* styling for abbr */ +.pika-table abbr { + border-bottom: none; + cursor: help; +} + diff --git a/lib/handsontable.meteor.0.20.2.js b/lib/handsontable.meteor.0.20.2.js new file mode 100644 index 0000000..77edd1b --- /dev/null +++ b/lib/handsontable.meteor.0.20.2.js @@ -0,0 +1,27619 @@ +/*! +(The MIT License) + +Copyright (c) 2012-2014 Marcin Warpechowski +Copyright (c) 2015 Handsoncode sp. z o.o. + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +'Software'), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +*/ +(function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.Handsontable = f()}})(function(){var define,module,exports;return (function init(modules, cache, entry) { + (function outer (modules, cache, entry) { + // Save the require from previous bundle to this closure if any + var previousRequire = typeof require == "function" && require; + var globalNS = JSON.parse('{"zeroclipboard":"ZeroClipboard","moment":"moment","pikaday":"Pikaday"}') || {}; + + function newRequire(name, jumped){ + if(!cache[name]) { + + if(!modules[name]) { + // if we cannot find the the module within our internal map or + // cache jump to the current global require ie. the last bundle + // that was added to the page. + var currentRequire = typeof require == "function" && require; + if (!jumped && currentRequire) return currentRequire(name, true); + + // If there are other bundles on this page the require from the + // previous one is saved to 'previousRequire'. Repeat this as + // many times as there are bundles until the module is found or + // we exhaust the require chain. + if (previousRequire) return previousRequire(name, true); + + // Try find module from global scope + if (globalNS[name] && typeof window[globalNS[name]] !== 'undefined') { + return window[globalNS[name]]; + } + + var err = new Error('Cannot find module \'' + name + '\''); + err.code = 'MODULE_NOT_FOUND'; + throw err; + } + var m = cache[name] = {exports:{}}; + modules[name][0].call(m.exports, function(x){ + var id = modules[name][1][x]; + return newRequire(id ? id : x); + },m,m.exports,outer,modules,cache,entry); + } + + return cache[name].exports; + } + for(var i=0;i 1) { + for (i = 1, ilen = arguments.length; i < ilen; i++) { + args.push(arguments[i]); + } + } + if (instance) { + if (typeof instance[action] !== 'undefined') { + output = instance[action].apply(instance, args); + if (action === 'destroy') { + $this.removeData(); + } + } else { + throw new Error('Handsontable do not provide action: ' + action); + } + } + return output; + } + }; + })(window, jQuery, Handsontable); +} + +//# +},{}],2:[function(require,module,exports){ +"use strict"; +Object.defineProperties(exports, { + WalkontableBorder: {get: function() { + return WalkontableBorder; + }}, + __esModule: {value: true} +}); +var $___46__46__47__46__46__47__46__46__47_helpers_47_dom_47_element__, + $___46__46__47__46__46__47__46__46__47_helpers_47_dom_47_event__, + $___46__46__47__46__46__47__46__46__47_eventManager__, + $__cell_47_coords__, + $__overlay_47__95_base_46_js__; +var $__0 = ($___46__46__47__46__46__47__46__46__47_helpers_47_dom_47_element__ = require("helpers/dom/element"), $___46__46__47__46__46__47__46__46__47_helpers_47_dom_47_element__ && $___46__46__47__46__46__47__46__46__47_helpers_47_dom_47_element__.__esModule && $___46__46__47__46__46__47__46__46__47_helpers_47_dom_47_element__ || {default: $___46__46__47__46__46__47__46__46__47_helpers_47_dom_47_element__}), + getComputedStyle = $__0.getComputedStyle, + getTrimmingContainer = $__0.getTrimmingContainer, + innerWidth = $__0.innerWidth, + innerHeight = $__0.innerHeight, + offset = $__0.offset, + outerHeight = $__0.outerHeight, + outerWidth = $__0.outerWidth; +var stopImmediatePropagation = ($___46__46__47__46__46__47__46__46__47_helpers_47_dom_47_event__ = require("helpers/dom/event"), $___46__46__47__46__46__47__46__46__47_helpers_47_dom_47_event__ && $___46__46__47__46__46__47__46__46__47_helpers_47_dom_47_event__.__esModule && $___46__46__47__46__46__47__46__46__47_helpers_47_dom_47_event__ || {default: $___46__46__47__46__46__47__46__46__47_helpers_47_dom_47_event__}).stopImmediatePropagation; +var EventManager = ($___46__46__47__46__46__47__46__46__47_eventManager__ = require("eventManager"), $___46__46__47__46__46__47__46__46__47_eventManager__ && $___46__46__47__46__46__47__46__46__47_eventManager__.__esModule && $___46__46__47__46__46__47__46__46__47_eventManager__ || {default: $___46__46__47__46__46__47__46__46__47_eventManager__}).EventManager; +var WalkontableCellCoords = ($__cell_47_coords__ = require("cell/coords"), $__cell_47_coords__ && $__cell_47_coords__.__esModule && $__cell_47_coords__ || {default: $__cell_47_coords__}).WalkontableCellCoords; +var WalkontableOverlay = ($__overlay_47__95_base_46_js__ = require("overlay/_base.js"), $__overlay_47__95_base_46_js__ && $__overlay_47__95_base_46_js__.__esModule && $__overlay_47__95_base_46_js__ || {default: $__overlay_47__95_base_46_js__}).WalkontableOverlay; +var WalkontableBorder = function WalkontableBorder(wotInstance, settings) { + if (!settings) { + return; + } + this.eventManager = new EventManager(wotInstance); + this.instance = wotInstance; + this.wot = wotInstance; + this.settings = settings; + this.mouseDown = false; + this.main = null; + this.top = null; + this.left = null; + this.bottom = null; + this.right = null; + this.topStyle = null; + this.leftStyle = null; + this.bottomStyle = null; + this.rightStyle = null; + this.cornerDefaultStyle = { + width: '5px', + height: '5px', + borderWidth: '2px', + borderStyle: 'solid', + borderColor: '#FFF' + }; + this.corner = null; + this.cornerStyle = null; + this.createBorders(settings); + this.registerListeners(); +}; +($traceurRuntime.createClass)(WalkontableBorder, { + registerListeners: function() { + var $__5 = this; + this.eventManager.addEventListener(document.body, 'mousedown', (function() { + return $__5.onMouseDown(); + })); + this.eventManager.addEventListener(document.body, 'mouseup', (function() { + return $__5.onMouseUp(); + })); + var $__7 = this, + $__8 = function(c, len) { + $__7.eventManager.addEventListener($__7.main.childNodes[c], 'mouseenter', (function(event) { + return $__5.onMouseEnter(event, $__5.main.childNodes[c]); + })); + }; + for (var c = 0, + len = this.main.childNodes.length; c < len; c++) { + $__8(c, len); + } + }, + onMouseDown: function() { + this.mouseDown = true; + }, + onMouseUp: function() { + this.mouseDown = false; + }, + onMouseEnter: function(event, parentElement) { + if (!this.mouseDown || !this.wot.getSetting('hideBorderOnMouseDownOver')) { + return; + } + event.preventDefault(); + stopImmediatePropagation(event); + var _this = this; + var bounds = parentElement.getBoundingClientRect(); + parentElement.style.display = 'none'; + function isOutside(event) { + if (event.clientY < Math.floor(bounds.top)) { + return true; + } + if (event.clientY > Math.ceil(bounds.top + bounds.height)) { + return true; + } + if (event.clientX < Math.floor(bounds.left)) { + return true; + } + if (event.clientX > Math.ceil(bounds.left + bounds.width)) { + return true; + } + } + function handler(event) { + if (isOutside(event)) { + _this.eventManager.removeEventListener(document.body, 'mousemove', handler); + parentElement.style.display = 'block'; + } + } + this.eventManager.addEventListener(document.body, 'mousemove', handler); + }, + createBorders: function(settings) { + this.main = document.createElement('div'); + var borderDivs = ['top', 'left', 'bottom', 'right', 'corner']; + var style = this.main.style; + style.position = 'absolute'; + style.top = 0; + style.left = 0; + for (var i = 0; i < 5; i++) { + var position = borderDivs[i]; + var div = document.createElement('div'); + div.className = 'wtBorder ' + (this.settings.className || ''); + if (this.settings[position] && this.settings[position].hide) { + div.className += ' hidden'; + } + style = div.style; + style.backgroundColor = (this.settings[position] && this.settings[position].color) ? this.settings[position].color : settings.border.color; + style.height = (this.settings[position] && this.settings[position].width) ? this.settings[position].width + 'px' : settings.border.width + 'px'; + style.width = (this.settings[position] && this.settings[position].width) ? this.settings[position].width + 'px' : settings.border.width + 'px'; + this.main.appendChild(div); + } + this.top = this.main.childNodes[0]; + this.left = this.main.childNodes[1]; + this.bottom = this.main.childNodes[2]; + this.right = this.main.childNodes[3]; + this.topStyle = this.top.style; + this.leftStyle = this.left.style; + this.bottomStyle = this.bottom.style; + this.rightStyle = this.right.style; + this.corner = this.main.childNodes[4]; + this.corner.className += ' corner'; + this.cornerStyle = this.corner.style; + this.cornerStyle.width = this.cornerDefaultStyle.width; + this.cornerStyle.height = this.cornerDefaultStyle.height; + this.cornerStyle.border = [this.cornerDefaultStyle.borderWidth, this.cornerDefaultStyle.borderStyle, this.cornerDefaultStyle.borderColor].join(' '); + if (Handsontable.mobileBrowser) { + this.createMultipleSelectorHandles(); + } + this.disappear(); + if (!this.wot.wtTable.bordersHolder) { + this.wot.wtTable.bordersHolder = document.createElement('div'); + this.wot.wtTable.bordersHolder.className = 'htBorders'; + this.wot.wtTable.spreader.appendChild(this.wot.wtTable.bordersHolder); + } + this.wot.wtTable.bordersHolder.insertBefore(this.main, this.wot.wtTable.bordersHolder.firstChild); + }, + createMultipleSelectorHandles: function() { + this.selectionHandles = { + topLeft: document.createElement('DIV'), + topLeftHitArea: document.createElement('DIV'), + bottomRight: document.createElement('DIV'), + bottomRightHitArea: document.createElement('DIV') + }; + var width = 10; + var hitAreaWidth = 40; + this.selectionHandles.topLeft.className = 'topLeftSelectionHandle'; + this.selectionHandles.topLeftHitArea.className = 'topLeftSelectionHandle-HitArea'; + this.selectionHandles.bottomRight.className = 'bottomRightSelectionHandle'; + this.selectionHandles.bottomRightHitArea.className = 'bottomRightSelectionHandle-HitArea'; + this.selectionHandles.styles = { + topLeft: this.selectionHandles.topLeft.style, + topLeftHitArea: this.selectionHandles.topLeftHitArea.style, + bottomRight: this.selectionHandles.bottomRight.style, + bottomRightHitArea: this.selectionHandles.bottomRightHitArea.style + }; + var hitAreaStyle = { + position: 'absolute', + height: hitAreaWidth + 'px', + width: hitAreaWidth + 'px', + 'border-radius': parseInt(hitAreaWidth / 1.5, 10) + 'px' + }; + for (var prop in hitAreaStyle) { + if (hitAreaStyle.hasOwnProperty(prop)) { + this.selectionHandles.styles.bottomRightHitArea[prop] = hitAreaStyle[prop]; + this.selectionHandles.styles.topLeftHitArea[prop] = hitAreaStyle[prop]; + } + } + var handleStyle = { + position: 'absolute', + height: width + 'px', + width: width + 'px', + 'border-radius': parseInt(width / 1.5, 10) + 'px', + background: '#F5F5FF', + border: '1px solid #4285c8' + }; + for (var prop$__9 in handleStyle) { + if (handleStyle.hasOwnProperty(prop$__9)) { + this.selectionHandles.styles.bottomRight[prop$__9] = handleStyle[prop$__9]; + this.selectionHandles.styles.topLeft[prop$__9] = handleStyle[prop$__9]; + } + } + this.main.appendChild(this.selectionHandles.topLeft); + this.main.appendChild(this.selectionHandles.bottomRight); + this.main.appendChild(this.selectionHandles.topLeftHitArea); + this.main.appendChild(this.selectionHandles.bottomRightHitArea); + }, + isPartRange: function(row, col) { + if (this.wot.selections.area.cellRange) { + if (row != this.wot.selections.area.cellRange.to.row || col != this.wot.selections.area.cellRange.to.col) { + return true; + } + } + return false; + }, + updateMultipleSelectionHandlesPosition: function(row, col, top, left, width, height) { + var handleWidth = parseInt(this.selectionHandles.styles.topLeft.width, 10); + var hitAreaWidth = parseInt(this.selectionHandles.styles.topLeftHitArea.width, 10); + this.selectionHandles.styles.topLeft.top = parseInt(top - handleWidth, 10) + 'px'; + this.selectionHandles.styles.topLeft.left = parseInt(left - handleWidth, 10) + 'px'; + this.selectionHandles.styles.topLeftHitArea.top = parseInt(top - (hitAreaWidth / 4) * 3, 10) + 'px'; + this.selectionHandles.styles.topLeftHitArea.left = parseInt(left - (hitAreaWidth / 4) * 3, 10) + 'px'; + this.selectionHandles.styles.bottomRight.top = parseInt(top + height, 10) + 'px'; + this.selectionHandles.styles.bottomRight.left = parseInt(left + width, 10) + 'px'; + this.selectionHandles.styles.bottomRightHitArea.top = parseInt(top + height - hitAreaWidth / 4, 10) + 'px'; + this.selectionHandles.styles.bottomRightHitArea.left = parseInt(left + width - hitAreaWidth / 4, 10) + 'px'; + if (this.settings.border.multipleSelectionHandlesVisible && this.settings.border.multipleSelectionHandlesVisible()) { + this.selectionHandles.styles.topLeft.display = 'block'; + this.selectionHandles.styles.topLeftHitArea.display = 'block'; + if (this.isPartRange(row, col)) { + this.selectionHandles.styles.bottomRight.display = 'none'; + this.selectionHandles.styles.bottomRightHitArea.display = 'none'; + } else { + this.selectionHandles.styles.bottomRight.display = 'block'; + this.selectionHandles.styles.bottomRightHitArea.display = 'block'; + } + } else { + this.selectionHandles.styles.topLeft.display = 'none'; + this.selectionHandles.styles.bottomRight.display = 'none'; + this.selectionHandles.styles.topLeftHitArea.display = 'none'; + this.selectionHandles.styles.bottomRightHitArea.display = 'none'; + } + if (row == this.wot.wtSettings.getSetting('fixedRowsTop') || col == this.wot.wtSettings.getSetting('fixedColumnsLeft')) { + this.selectionHandles.styles.topLeft.zIndex = '9999'; + this.selectionHandles.styles.topLeftHitArea.zIndex = '9999'; + } else { + this.selectionHandles.styles.topLeft.zIndex = ''; + this.selectionHandles.styles.topLeftHitArea.zIndex = ''; + } + }, + appear: function(corners) { + if (this.disabled) { + return; + } + var isMultiple, + fromTD, + toTD, + fromOffset, + toOffset, + containerOffset, + top, + minTop, + left, + minLeft, + height, + width, + fromRow, + fromColumn, + toRow, + toColumn, + trimmingContainer, + cornerOverlappingContainer, + ilen; + if (WalkontableOverlay.isOverlayTypeOf(this.wot.cloneOverlay, WalkontableOverlay.CLONE_TOP) || WalkontableOverlay.isOverlayTypeOf(this.wot.cloneOverlay, WalkontableOverlay.CLONE_TOP_LEFT_CORNER)) { + ilen = this.wot.getSetting('fixedRowsTop'); + } else if (WalkontableOverlay.isOverlayTypeOf(this.wot.cloneOverlay, WalkontableOverlay.CLONE_BOTTOM) || WalkontableOverlay.isOverlayTypeOf(this.wot.cloneOverlay, WalkontableOverlay.CLONE_BOTTOM_LEFT_CORNER)) { + ilen = this.wot.getSetting('fixedRowsBottom'); + } else { + ilen = this.wot.wtTable.getRenderedRowsCount(); + } + for (var i = 0; i < ilen; i++) { + var s = this.wot.wtTable.rowFilter.renderedToSource(i); + if (s >= corners[0] && s <= corners[2]) { + fromRow = s; + break; + } + } + for (var i$__10 = ilen - 1; i$__10 >= 0; i$__10--) { + var s$__11 = this.wot.wtTable.rowFilter.renderedToSource(i$__10); + if (s$__11 >= corners[0] && s$__11 <= corners[2]) { + toRow = s$__11; + break; + } + } + ilen = this.wot.wtTable.getRenderedColumnsCount(); + for (var i$__12 = 0; i$__12 < ilen; i$__12++) { + var s$__13 = this.wot.wtTable.columnFilter.renderedToSource(i$__12); + if (s$__13 >= corners[1] && s$__13 <= corners[3]) { + fromColumn = s$__13; + break; + } + } + for (var i$__14 = ilen - 1; i$__14 >= 0; i$__14--) { + var s$__15 = this.wot.wtTable.columnFilter.renderedToSource(i$__14); + if (s$__15 >= corners[1] && s$__15 <= corners[3]) { + toColumn = s$__15; + break; + } + } + if (fromRow === void 0 || fromColumn === void 0) { + this.disappear(); + return; + } + isMultiple = (fromRow !== toRow || fromColumn !== toColumn); + fromTD = this.wot.wtTable.getCell(new WalkontableCellCoords(fromRow, fromColumn)); + toTD = isMultiple ? this.wot.wtTable.getCell(new WalkontableCellCoords(toRow, toColumn)) : fromTD; + fromOffset = offset(fromTD); + toOffset = isMultiple ? offset(toTD) : fromOffset; + containerOffset = offset(this.wot.wtTable.TABLE); + minTop = fromOffset.top; + height = toOffset.top + outerHeight(toTD) - minTop; + minLeft = fromOffset.left; + width = toOffset.left + outerWidth(toTD) - minLeft; + top = minTop - containerOffset.top - 1; + left = minLeft - containerOffset.left - 1; + var style = getComputedStyle(fromTD); + if (parseInt(style.borderTopWidth, 10) > 0) { + top += 1; + height = height > 0 ? height - 1 : 0; + } + if (parseInt(style.borderLeftWidth, 10) > 0) { + left += 1; + width = width > 0 ? width - 1 : 0; + } + this.topStyle.top = top + 'px'; + this.topStyle.left = left + 'px'; + this.topStyle.width = width + 'px'; + this.topStyle.display = 'block'; + this.leftStyle.top = top + 'px'; + this.leftStyle.left = left + 'px'; + this.leftStyle.height = height + 'px'; + this.leftStyle.display = 'block'; + var delta = Math.floor(this.settings.border.width / 2); + this.bottomStyle.top = top + height - delta + 'px'; + this.bottomStyle.left = left + 'px'; + this.bottomStyle.width = width + 'px'; + this.bottomStyle.display = 'block'; + this.rightStyle.top = top + 'px'; + this.rightStyle.left = left + width - delta + 'px'; + this.rightStyle.height = height + 1 + 'px'; + this.rightStyle.display = 'block'; + if (Handsontable.mobileBrowser || (!this.hasSetting(this.settings.border.cornerVisible) || this.isPartRange(toRow, toColumn))) { + this.cornerStyle.display = 'none'; + } else { + this.cornerStyle.top = top + height - 4 + 'px'; + this.cornerStyle.left = left + width - 4 + 'px'; + this.cornerStyle.borderRightWidth = this.cornerDefaultStyle.borderWidth; + this.cornerStyle.width = this.cornerDefaultStyle.width; + this.cornerStyle.display = 'block'; + trimmingContainer = getTrimmingContainer(this.wot.wtTable.TABLE); + if (toColumn === this.wot.getSetting('totalColumns') - 1) { + cornerOverlappingContainer = toTD.offsetLeft + outerWidth(toTD) >= innerWidth(trimmingContainer); + if (cornerOverlappingContainer) { + this.cornerStyle.left = Math.floor(left + width - 3 - parseInt(this.cornerDefaultStyle.width) / 2) + 'px'; + this.cornerStyle.borderRightWidth = 0; + } + } + if (toRow === this.wot.getSetting('totalRows') - 1) { + cornerOverlappingContainer = toTD.offsetTop + outerHeight(toTD) >= innerHeight(trimmingContainer); + if (cornerOverlappingContainer) { + this.cornerStyle.top = Math.floor(top + height - 3 - parseInt(this.cornerDefaultStyle.height) / 2) + 'px'; + this.cornerStyle.borderBottomWidth = 0; + } + } + } + if (Handsontable.mobileBrowser) { + this.updateMultipleSelectionHandlesPosition(fromRow, fromColumn, top, left, width, height); + } + }, + disappear: function() { + this.topStyle.display = 'none'; + this.leftStyle.display = 'none'; + this.bottomStyle.display = 'none'; + this.rightStyle.display = 'none'; + this.cornerStyle.display = 'none'; + if (Handsontable.mobileBrowser) { + this.selectionHandles.styles.topLeft.display = 'none'; + this.selectionHandles.styles.bottomRight.display = 'none'; + } + }, + hasSetting: function(setting) { + if (typeof setting === 'function') { + return setting(); + } + return !!setting; + } +}, {}); +; +window.WalkontableBorder = WalkontableBorder; + +//# +},{"cell/coords":5,"eventManager":41,"helpers/dom/element":45,"helpers/dom/event":46,"overlay/_base.js":11}],3:[function(require,module,exports){ +"use strict"; +Object.defineProperties(exports, { + WalkontableViewportColumnsCalculator: {get: function() { + return WalkontableViewportColumnsCalculator; + }}, + __esModule: {value: true} +}); +var privatePool = new WeakMap(); +var WalkontableViewportColumnsCalculator = function WalkontableViewportColumnsCalculator(viewportWidth, scrollOffset, totalColumns, columnWidthFn, overrideFn, onlyFullyVisible, stretchH) { + privatePool.set(this, { + viewportWidth: viewportWidth, + scrollOffset: scrollOffset, + totalColumns: totalColumns, + columnWidthFn: columnWidthFn, + overrideFn: overrideFn, + onlyFullyVisible: onlyFullyVisible + }); + this.count = 0; + this.startColumn = null; + this.endColumn = null; + this.startPosition = null; + this.stretchAllRatio = 0; + this.stretchLastWidth = 0; + this.stretch = stretchH; + this.totalTargetWidth = 0; + this.needVerifyLastColumnWidth = true; + this.stretchAllColumnsWidth = []; + this.calculate(); +}; +var $WalkontableViewportColumnsCalculator = WalkontableViewportColumnsCalculator; +($traceurRuntime.createClass)(WalkontableViewportColumnsCalculator, { + calculate: function() { + var sum = 0; + var needReverse = true; + var startPositions = []; + var columnWidth; + var priv = privatePool.get(this); + var onlyFullyVisible = priv.onlyFullyVisible; + var overrideFn = priv.overrideFn; + var scrollOffset = priv.scrollOffset; + var totalColumns = priv.totalColumns; + var viewportWidth = priv.viewportWidth; + for (var i = 0; i < totalColumns; i++) { + columnWidth = this._getColumnWidth(i); + if (sum <= scrollOffset && !onlyFullyVisible) { + this.startColumn = i; + } + if (sum >= scrollOffset && sum + columnWidth <= scrollOffset + viewportWidth) { + if (this.startColumn == null) { + this.startColumn = i; + } + this.endColumn = i; + } + startPositions.push(sum); + sum += columnWidth; + if (!onlyFullyVisible) { + this.endColumn = i; + } + if (sum >= scrollOffset + viewportWidth) { + needReverse = false; + break; + } + } + if (this.endColumn === totalColumns - 1 && needReverse) { + this.startColumn = this.endColumn; + while (this.startColumn > 0) { + var viewportSum = startPositions[this.endColumn] + columnWidth - startPositions[this.startColumn - 1]; + if (viewportSum <= viewportWidth || !onlyFullyVisible) { + this.startColumn--; + } + if (viewportSum > viewportWidth) { + break; + } + } + } + if (this.startColumn !== null && overrideFn) { + overrideFn(this); + } + this.startPosition = startPositions[this.startColumn]; + if (this.startPosition == void 0) { + this.startPosition = null; + } + if (this.startColumn !== null) { + this.count = this.endColumn - this.startColumn + 1; + } + }, + refreshStretching: function(totalWidth) { + if (this.stretch === 'none') { + return; + } + var sumAll = 0; + var columnWidth; + var remainingSize; + var priv = privatePool.get(this); + var totalColumns = priv.totalColumns; + for (var i = 0; i < totalColumns; i++) { + columnWidth = this._getColumnWidth(i); + sumAll += columnWidth; + } + this.totalTargetWidth = totalWidth; + remainingSize = sumAll - totalWidth; + if (this.stretch === 'all' && remainingSize < 0) { + this.stretchAllRatio = totalWidth / sumAll; + this.stretchAllColumnsWidth = []; + this.needVerifyLastColumnWidth = true; + } else if (this.stretch === 'last' && totalWidth !== Infinity) { + this.stretchLastWidth = -remainingSize + this._getColumnWidth(totalColumns - 1); + } + }, + getStretchedColumnWidth: function(column, baseWidth) { + var result = null; + if (this.stretch === 'all' && this.stretchAllRatio !== 0) { + result = this._getStretchedAllColumnWidth(column, baseWidth); + } else if (this.stretch === 'last' && this.stretchLastWidth !== 0) { + result = this._getStretchedLastColumnWidth(column); + } + return result; + }, + _getStretchedAllColumnWidth: function(column, baseWidth) { + var sumRatioWidth = 0; + var priv = privatePool.get(this); + var totalColumns = priv.totalColumns; + if (!this.stretchAllColumnsWidth[column]) { + this.stretchAllColumnsWidth[column] = Math.round(baseWidth * this.stretchAllRatio); + } + if (this.stretchAllColumnsWidth.length === totalColumns && this.needVerifyLastColumnWidth) { + this.needVerifyLastColumnWidth = false; + for (var i = 0; i < this.stretchAllColumnsWidth.length; i++) { + sumRatioWidth += this.stretchAllColumnsWidth[i]; + } + if (sumRatioWidth !== this.totalTargetWidth) { + this.stretchAllColumnsWidth[this.stretchAllColumnsWidth.length - 1] += this.totalTargetWidth - sumRatioWidth; + } + } + return this.stretchAllColumnsWidth[column]; + }, + _getStretchedLastColumnWidth: function(column) { + var priv = privatePool.get(this); + var totalColumns = priv.totalColumns; + if (column === totalColumns - 1) { + return this.stretchLastWidth; + } + return null; + }, + _getColumnWidth: function(column) { + var width = privatePool.get(this).columnWidthFn(column); + if (width === undefined) { + width = $WalkontableViewportColumnsCalculator.DEFAULT_WIDTH; + } + return width; + } +}, {get DEFAULT_WIDTH() { + return 50; + }}); +; +window.WalkontableViewportColumnsCalculator = WalkontableViewportColumnsCalculator; + +//# +},{}],4:[function(require,module,exports){ +"use strict"; +Object.defineProperties(exports, { + WalkontableViewportRowsCalculator: {get: function() { + return WalkontableViewportRowsCalculator; + }}, + __esModule: {value: true} +}); +var privatePool = new WeakMap(); +var WalkontableViewportRowsCalculator = function WalkontableViewportRowsCalculator(viewportHeight, scrollOffset, totalRows, rowHeightFn, overrideFn, onlyFullyVisible, horizontalScrollbarHeight) { + privatePool.set(this, { + viewportHeight: viewportHeight, + scrollOffset: scrollOffset, + totalRows: totalRows, + rowHeightFn: rowHeightFn, + overrideFn: overrideFn, + onlyFullyVisible: onlyFullyVisible, + horizontalScrollbarHeight: horizontalScrollbarHeight + }); + this.count = 0; + this.startRow = null; + this.endRow = null; + this.startPosition = null; + this.calculate(); +}; +var $WalkontableViewportRowsCalculator = WalkontableViewportRowsCalculator; +($traceurRuntime.createClass)(WalkontableViewportRowsCalculator, {calculate: function() { + var sum = 0; + var needReverse = true; + var startPositions = []; + var priv = privatePool.get(this); + var onlyFullyVisible = priv.onlyFullyVisible; + var overrideFn = priv.overrideFn; + var rowHeightFn = priv.rowHeightFn; + var scrollOffset = priv.scrollOffset; + var totalRows = priv.totalRows; + var viewportHeight = priv.viewportHeight; + var horizontalScrollbarHeight = priv.horizontalScrollbarHeight || 0; + for (var i = 0; i < totalRows; i++) { + var rowHeight = rowHeightFn(i); + if (rowHeight === undefined) { + rowHeight = $WalkontableViewportRowsCalculator.DEFAULT_HEIGHT; + } + if (sum <= scrollOffset && !onlyFullyVisible) { + this.startRow = i; + } + if (sum >= scrollOffset && sum + rowHeight <= scrollOffset + viewportHeight - horizontalScrollbarHeight) { + if (this.startRow === null) { + this.startRow = i; + } + this.endRow = i; + } + startPositions.push(sum); + sum += rowHeight; + if (!onlyFullyVisible) { + this.endRow = i; + } + if (sum >= scrollOffset + viewportHeight - horizontalScrollbarHeight) { + needReverse = false; + break; + } + } + if (this.endRow === totalRows - 1 && needReverse) { + this.startRow = this.endRow; + while (this.startRow > 0) { + var viewportSum = startPositions[this.endRow] + rowHeight - startPositions[this.startRow - 1]; + if (viewportSum <= viewportHeight - horizontalScrollbarHeight || !onlyFullyVisible) { + this.startRow--; + } + if (viewportSum >= viewportHeight - horizontalScrollbarHeight) { + break; + } + } + } + if (this.startRow !== null && overrideFn) { + overrideFn(this); + } + this.startPosition = startPositions[this.startRow]; + if (this.startPosition == void 0) { + this.startPosition = null; + } + if (this.startRow !== null) { + this.count = this.endRow - this.startRow + 1; + } + }}, {get DEFAULT_HEIGHT() { + return 23; + }}); +; +window.WalkontableViewportRowsCalculator = WalkontableViewportRowsCalculator; + +//# +},{}],5:[function(require,module,exports){ +"use strict"; +Object.defineProperties(exports, { + WalkontableCellCoords: {get: function() { + return WalkontableCellCoords; + }}, + __esModule: {value: true} +}); +var WalkontableCellCoords = function WalkontableCellCoords(row, col) { + if (typeof row !== 'undefined' && typeof col !== 'undefined') { + this.row = row; + this.col = col; + } else { + this.row = null; + this.col = null; + } +}; +($traceurRuntime.createClass)(WalkontableCellCoords, { + isValid: function(wotInstance) { + if (this.row < 0 || this.col < 0) { + return false; + } + if (this.row >= wotInstance.getSetting('totalRows') || this.col >= wotInstance.getSetting('totalColumns')) { + return false; + } + return true; + }, + isEqual: function(cellCoords) { + if (cellCoords === this) { + return true; + } + return this.row === cellCoords.row && this.col === cellCoords.col; + }, + isSouthEastOf: function(testedCoords) { + return this.row >= testedCoords.row && this.col >= testedCoords.col; + }, + isNorthWestOf: function(testedCoords) { + return this.row <= testedCoords.row && this.col <= testedCoords.col; + }, + isSouthWestOf: function(testedCoords) { + return this.row >= testedCoords.row && this.col <= testedCoords.col; + }, + isNorthEastOf: function(testedCoords) { + return this.row <= testedCoords.row && this.col >= testedCoords.col; + } +}, {}); +; +window.WalkontableCellCoords = WalkontableCellCoords; + +//# +},{}],6:[function(require,module,exports){ +"use strict"; +Object.defineProperties(exports, { + WalkontableCellRange: {get: function() { + return WalkontableCellRange; + }}, + __esModule: {value: true} +}); +var $___46__46__47_cell_47_coords__; +var WalkontableCellCoords = ($___46__46__47_cell_47_coords__ = require("cell/coords"), $___46__46__47_cell_47_coords__ && $___46__46__47_cell_47_coords__.__esModule && $___46__46__47_cell_47_coords__ || {default: $___46__46__47_cell_47_coords__}).WalkontableCellCoords; +var WalkontableCellRange = function WalkontableCellRange(highlight, from, to) { + this.highlight = highlight; + this.from = from; + this.to = to; +}; +var $WalkontableCellRange = WalkontableCellRange; +($traceurRuntime.createClass)(WalkontableCellRange, { + isValid: function(wotInstance) { + return this.from.isValid(wotInstance) && this.to.isValid(wotInstance); + }, + isSingle: function() { + return this.from.row === this.to.row && this.from.col === this.to.col; + }, + getHeight: function() { + return Math.max(this.from.row, this.to.row) - Math.min(this.from.row, this.to.row) + 1; + }, + getWidth: function() { + return Math.max(this.from.col, this.to.col) - Math.min(this.from.col, this.to.col) + 1; + }, + includes: function(cellCoords) { + var topLeft = this.getTopLeftCorner(); + var bottomRight = this.getBottomRightCorner(); + if (cellCoords.row < 0) { + cellCoords.row = 0; + } + if (cellCoords.col < 0) { + cellCoords.col = 0; + } + return topLeft.row <= cellCoords.row && bottomRight.row >= cellCoords.row && topLeft.col <= cellCoords.col && bottomRight.col >= cellCoords.col; + }, + includesRange: function(testedRange) { + return this.includes(testedRange.getTopLeftCorner()) && this.includes(testedRange.getBottomRightCorner()); + }, + isEqual: function(testedRange) { + return (Math.min(this.from.row, this.to.row) == Math.min(testedRange.from.row, testedRange.to.row)) && (Math.max(this.from.row, this.to.row) == Math.max(testedRange.from.row, testedRange.to.row)) && (Math.min(this.from.col, this.to.col) == Math.min(testedRange.from.col, testedRange.to.col)) && (Math.max(this.from.col, this.to.col) == Math.max(testedRange.from.col, testedRange.to.col)); + }, + overlaps: function(testedRange) { + return testedRange.isSouthEastOf(this.getTopLeftCorner()) && testedRange.isNorthWestOf(this.getBottomRightCorner()); + }, + isSouthEastOf: function(testedCoords) { + return this.getTopLeftCorner().isSouthEastOf(testedCoords) || this.getBottomRightCorner().isSouthEastOf(testedCoords); + }, + isNorthWestOf: function(testedCoords) { + return this.getTopLeftCorner().isNorthWestOf(testedCoords) || this.getBottomRightCorner().isNorthWestOf(testedCoords); + }, + expand: function(cellCoords) { + var topLeft = this.getTopLeftCorner(); + var bottomRight = this.getBottomRightCorner(); + if (cellCoords.row < topLeft.row || cellCoords.col < topLeft.col || cellCoords.row > bottomRight.row || cellCoords.col > bottomRight.col) { + this.from = new WalkontableCellCoords(Math.min(topLeft.row, cellCoords.row), Math.min(topLeft.col, cellCoords.col)); + this.to = new WalkontableCellCoords(Math.max(bottomRight.row, cellCoords.row), Math.max(bottomRight.col, cellCoords.col)); + return true; + } + return false; + }, + expandByRange: function(expandingRange) { + if (this.includesRange(expandingRange) || !this.overlaps(expandingRange)) { + return false; + } + var topLeft = this.getTopLeftCorner(); + var bottomRight = this.getBottomRightCorner(); + var topRight = this.getTopRightCorner(); + var bottomLeft = this.getBottomLeftCorner(); + var expandingTopLeft = expandingRange.getTopLeftCorner(); + var expandingBottomRight = expandingRange.getBottomRightCorner(); + var resultTopRow = Math.min(topLeft.row, expandingTopLeft.row); + var resultTopCol = Math.min(topLeft.col, expandingTopLeft.col); + var resultBottomRow = Math.max(bottomRight.row, expandingBottomRight.row); + var resultBottomCol = Math.max(bottomRight.col, expandingBottomRight.col); + var finalFrom = new WalkontableCellCoords(resultTopRow, resultTopCol), + finalTo = new WalkontableCellCoords(resultBottomRow, resultBottomCol); + var isCorner = new $WalkontableCellRange(finalFrom, finalFrom, finalTo).isCorner(this.from, expandingRange), + onlyMerge = expandingRange.isEqual(new $WalkontableCellRange(finalFrom, finalFrom, finalTo)); + if (isCorner && !onlyMerge) { + if (this.from.col > finalFrom.col) { + finalFrom.col = resultBottomCol; + finalTo.col = resultTopCol; + } + if (this.from.row > finalFrom.row) { + finalFrom.row = resultBottomRow; + finalTo.row = resultTopRow; + } + } + this.from = finalFrom; + this.to = finalTo; + return true; + }, + getDirection: function() { + if (this.from.isNorthWestOf(this.to)) { + return 'NW-SE'; + } else if (this.from.isNorthEastOf(this.to)) { + return 'NE-SW'; + } else if (this.from.isSouthEastOf(this.to)) { + return 'SE-NW'; + } else if (this.from.isSouthWestOf(this.to)) { + return 'SW-NE'; + } + }, + setDirection: function(direction) { + switch (direction) { + case 'NW-SE': + this.from = this.getTopLeftCorner(); + this.to = this.getBottomRightCorner(); + break; + case 'NE-SW': + this.from = this.getTopRightCorner(); + this.to = this.getBottomLeftCorner(); + break; + case 'SE-NW': + this.from = this.getBottomRightCorner(); + this.to = this.getTopLeftCorner(); + break; + case 'SW-NE': + this.from = this.getBottomLeftCorner(); + this.to = this.getTopRightCorner(); + break; + } + }, + getTopLeftCorner: function() { + return new WalkontableCellCoords(Math.min(this.from.row, this.to.row), Math.min(this.from.col, this.to.col)); + }, + getBottomRightCorner: function() { + return new WalkontableCellCoords(Math.max(this.from.row, this.to.row), Math.max(this.from.col, this.to.col)); + }, + getTopRightCorner: function() { + return new WalkontableCellCoords(Math.min(this.from.row, this.to.row), Math.max(this.from.col, this.to.col)); + }, + getBottomLeftCorner: function() { + return new WalkontableCellCoords(Math.max(this.from.row, this.to.row), Math.min(this.from.col, this.to.col)); + }, + isCorner: function(coords, expandedRange) { + if (expandedRange) { + if (expandedRange.includes(coords)) { + if (this.getTopLeftCorner().isEqual(new WalkontableCellCoords(expandedRange.from.row, expandedRange.from.col)) || this.getTopRightCorner().isEqual(new WalkontableCellCoords(expandedRange.from.row, expandedRange.to.col)) || this.getBottomLeftCorner().isEqual(new WalkontableCellCoords(expandedRange.to.row, expandedRange.from.col)) || this.getBottomRightCorner().isEqual(new WalkontableCellCoords(expandedRange.to.row, expandedRange.to.col))) { + return true; + } + } + } + return coords.isEqual(this.getTopLeftCorner()) || coords.isEqual(this.getTopRightCorner()) || coords.isEqual(this.getBottomLeftCorner()) || coords.isEqual(this.getBottomRightCorner()); + }, + getOppositeCorner: function(coords, expandedRange) { + if (!(coords instanceof WalkontableCellCoords)) { + return false; + } + if (expandedRange) { + if (expandedRange.includes(coords)) { + if (this.getTopLeftCorner().isEqual(new WalkontableCellCoords(expandedRange.from.row, expandedRange.from.col))) { + return this.getBottomRightCorner(); + } + if (this.getTopRightCorner().isEqual(new WalkontableCellCoords(expandedRange.from.row, expandedRange.to.col))) { + return this.getBottomLeftCorner(); + } + if (this.getBottomLeftCorner().isEqual(new WalkontableCellCoords(expandedRange.to.row, expandedRange.from.col))) { + return this.getTopRightCorner(); + } + if (this.getBottomRightCorner().isEqual(new WalkontableCellCoords(expandedRange.to.row, expandedRange.to.col))) { + return this.getTopLeftCorner(); + } + } + } + if (coords.isEqual(this.getBottomRightCorner())) { + return this.getTopLeftCorner(); + } else if (coords.isEqual(this.getTopLeftCorner())) { + return this.getBottomRightCorner(); + } else if (coords.isEqual(this.getTopRightCorner())) { + return this.getBottomLeftCorner(); + } else if (coords.isEqual(this.getBottomLeftCorner())) { + return this.getTopRightCorner(); + } + }, + getBordersSharedWith: function(range) { + if (!this.includesRange(range)) { + return []; + } + var thisBorders = { + top: Math.min(this.from.row, this.to.row), + bottom: Math.max(this.from.row, this.to.row), + left: Math.min(this.from.col, this.to.col), + right: Math.max(this.from.col, this.to.col) + }; + var rangeBorders = { + top: Math.min(range.from.row, range.to.row), + bottom: Math.max(range.from.row, range.to.row), + left: Math.min(range.from.col, range.to.col), + right: Math.max(range.from.col, range.to.col) + }; + var result = []; + if (thisBorders.top == rangeBorders.top) { + result.push('top'); + } + if (thisBorders.right == rangeBorders.right) { + result.push('right'); + } + if (thisBorders.bottom == rangeBorders.bottom) { + result.push('bottom'); + } + if (thisBorders.left == rangeBorders.left) { + result.push('left'); + } + return result; + }, + getInner: function() { + var topLeft = this.getTopLeftCorner(); + var bottomRight = this.getBottomRightCorner(); + var out = []; + for (var r = topLeft.row; r <= bottomRight.row; r++) { + for (var c = topLeft.col; c <= bottomRight.col; c++) { + if (!(this.from.row === r && this.from.col === c) && !(this.to.row === r && this.to.col === c)) { + out.push(new WalkontableCellCoords(r, c)); + } + } + } + return out; + }, + getAll: function() { + var topLeft = this.getTopLeftCorner(); + var bottomRight = this.getBottomRightCorner(); + var out = []; + for (var r = topLeft.row; r <= bottomRight.row; r++) { + for (var c = topLeft.col; c <= bottomRight.col; c++) { + if (topLeft.row === r && topLeft.col === c) { + out.push(topLeft); + } else if (bottomRight.row === r && bottomRight.col === c) { + out.push(bottomRight); + } else { + out.push(new WalkontableCellCoords(r, c)); + } + } + } + return out; + }, + forAll: function(callback) { + var topLeft = this.getTopLeftCorner(); + var bottomRight = this.getBottomRightCorner(); + for (var r = topLeft.row; r <= bottomRight.row; r++) { + for (var c = topLeft.col; c <= bottomRight.col; c++) { + var breakIteration = callback(r, c); + if (breakIteration === false) { + return; + } + } + } + } +}, {}); +; +window.WalkontableCellRange = WalkontableCellRange; + +//# +},{"cell/coords":5}],7:[function(require,module,exports){ +"use strict"; +Object.defineProperties(exports, { + Walkontable: {get: function() { + return Walkontable; + }}, + __esModule: {value: true} +}); +var $___46__46__47__46__46__47__46__46__47_helpers_47_dom_47_element__, + $___46__46__47__46__46__47__46__46__47_helpers_47_object__, + $___46__46__47__46__46__47__46__46__47_helpers_47_string__, + $__event__, + $__overlays__, + $__scroll__, + $__settings__, + $__table__, + $__viewport__, + $__overlay_47__95_base_46_js__, + $__overlay_47_top_46_js__, + $__overlay_47_left_46_js__, + $__overlay_47_debug_46_js__, + $__overlay_47_topLeftCorner_46_js__; +var $__0 = ($___46__46__47__46__46__47__46__46__47_helpers_47_dom_47_element__ = require("helpers/dom/element"), $___46__46__47__46__46__47__46__46__47_helpers_47_dom_47_element__ && $___46__46__47__46__46__47__46__46__47_helpers_47_dom_47_element__.__esModule && $___46__46__47__46__46__47__46__46__47_helpers_47_dom_47_element__ || {default: $___46__46__47__46__46__47__46__46__47_helpers_47_dom_47_element__}), + addClass = $__0.addClass, + fastInnerText = $__0.fastInnerText, + isVisible = $__0.isVisible, + removeClass = $__0.removeClass; +var objectEach = ($___46__46__47__46__46__47__46__46__47_helpers_47_object__ = require("helpers/object"), $___46__46__47__46__46__47__46__46__47_helpers_47_object__ && $___46__46__47__46__46__47__46__46__47_helpers_47_object__.__esModule && $___46__46__47__46__46__47__46__46__47_helpers_47_object__ || {default: $___46__46__47__46__46__47__46__46__47_helpers_47_object__}).objectEach; +var $__2 = ($___46__46__47__46__46__47__46__46__47_helpers_47_string__ = require("helpers/string"), $___46__46__47__46__46__47__46__46__47_helpers_47_string__ && $___46__46__47__46__46__47__46__46__47_helpers_47_string__.__esModule && $___46__46__47__46__46__47__46__46__47_helpers_47_string__ || {default: $___46__46__47__46__46__47__46__46__47_helpers_47_string__}), + toUpperCaseFirst = $__2.toUpperCaseFirst, + randomString = $__2.randomString; +var WalkontableEvent = ($__event__ = require("event"), $__event__ && $__event__.__esModule && $__event__ || {default: $__event__}).WalkontableEvent; +var WalkontableOverlays = ($__overlays__ = require("overlays"), $__overlays__ && $__overlays__.__esModule && $__overlays__ || {default: $__overlays__}).WalkontableOverlays; +var WalkontableScroll = ($__scroll__ = require("scroll"), $__scroll__ && $__scroll__.__esModule && $__scroll__ || {default: $__scroll__}).WalkontableScroll; +var WalkontableSettings = ($__settings__ = require("settings"), $__settings__ && $__settings__.__esModule && $__settings__ || {default: $__settings__}).WalkontableSettings; +var WalkontableTable = ($__table__ = require("table"), $__table__ && $__table__.__esModule && $__table__ || {default: $__table__}).WalkontableTable; +var WalkontableViewport = ($__viewport__ = require("viewport"), $__viewport__ && $__viewport__.__esModule && $__viewport__ || {default: $__viewport__}).WalkontableViewport; +var WalkontableOverlay = ($__overlay_47__95_base_46_js__ = require("overlay/_base.js"), $__overlay_47__95_base_46_js__ && $__overlay_47__95_base_46_js__.__esModule && $__overlay_47__95_base_46_js__ || {default: $__overlay_47__95_base_46_js__}).WalkontableOverlay; +var WalkontableTopOverlay = ($__overlay_47_top_46_js__ = require("overlay/top.js"), $__overlay_47_top_46_js__ && $__overlay_47_top_46_js__.__esModule && $__overlay_47_top_46_js__ || {default: $__overlay_47_top_46_js__}).WalkontableTopOverlay; +var WalkontableLeftOverlay = ($__overlay_47_left_46_js__ = require("overlay/left.js"), $__overlay_47_left_46_js__ && $__overlay_47_left_46_js__.__esModule && $__overlay_47_left_46_js__ || {default: $__overlay_47_left_46_js__}).WalkontableLeftOverlay; +var WalkontableDebugOverlay = ($__overlay_47_debug_46_js__ = require("overlay/debug.js"), $__overlay_47_debug_46_js__ && $__overlay_47_debug_46_js__.__esModule && $__overlay_47_debug_46_js__ || {default: $__overlay_47_debug_46_js__}).WalkontableDebugOverlay; +var WalkontableTopLeftCornerOverlay = ($__overlay_47_topLeftCorner_46_js__ = require("overlay/topLeftCorner.js"), $__overlay_47_topLeftCorner_46_js__ && $__overlay_47_topLeftCorner_46_js__.__esModule && $__overlay_47_topLeftCorner_46_js__ || {default: $__overlay_47_topLeftCorner_46_js__}).WalkontableTopLeftCornerOverlay; +var Walkontable = function Walkontable(settings) { + var originalHeaders = []; + this.guid = 'wt_' + randomString(); + if (settings.cloneSource) { + this.cloneSource = settings.cloneSource; + this.cloneOverlay = settings.cloneOverlay; + this.wtSettings = settings.cloneSource.wtSettings; + this.wtTable = new WalkontableTable(this, settings.table, settings.wtRootElement); + this.wtScroll = new WalkontableScroll(this); + this.wtViewport = settings.cloneSource.wtViewport; + this.wtEvent = new WalkontableEvent(this); + this.selections = this.cloneSource.selections; + } else { + this.wtSettings = new WalkontableSettings(this, settings); + this.wtTable = new WalkontableTable(this, settings.table); + this.wtScroll = new WalkontableScroll(this); + this.wtViewport = new WalkontableViewport(this); + this.wtEvent = new WalkontableEvent(this); + this.selections = this.getSetting('selections'); + this.wtOverlays = new WalkontableOverlays(this); + this.exportSettingsAsClassNames(); + } + if (this.wtTable.THEAD.childNodes.length && this.wtTable.THEAD.childNodes[0].childNodes.length) { + for (var c = 0, + clen = this.wtTable.THEAD.childNodes[0].childNodes.length; c < clen; c++) { + originalHeaders.push(this.wtTable.THEAD.childNodes[0].childNodes[c].innerHTML); + } + if (!this.getSetting('columnHeaders').length) { + this.update('columnHeaders', [function(column, TH) { + fastInnerText(TH, originalHeaders[column]); + }]); + } + } + this.drawn = false; + this.drawInterrupted = false; +}; +($traceurRuntime.createClass)(Walkontable, { + draw: function() { + var fastDraw = arguments[0] !== (void 0) ? arguments[0] : false; + this.drawInterrupted = false; + if (!fastDraw && !isVisible(this.wtTable.TABLE)) { + this.drawInterrupted = true; + } else { + this.wtTable.draw(fastDraw); + } + return this; + }, + getCell: function(coords) { + var topmost = arguments[1] !== (void 0) ? arguments[1] : false; + if (!topmost) { + return this.wtTable.getCell(coords); + } + var totalRows = this.wtSettings.getSetting('totalRows'); + var fixedRowsTop = this.wtSettings.getSetting('fixedRowsTop'); + var fixedRowsBottom = this.wtSettings.getSetting('fixedRowsBottom'); + var fixedColumns = this.wtSettings.getSetting('fixedColumnsLeft'); + if (coords.row < fixedRowsTop && coords.col < fixedColumns) { + return this.wtOverlays.topLeftCornerOverlay.clone.wtTable.getCell(coords); + } else if (coords.row < fixedRowsTop) { + return this.wtOverlays.topOverlay.clone.wtTable.getCell(coords); + } else if (coords.col < fixedColumns && coords.row >= totalRows - fixedRowsBottom) { + if (this.wtOverlays.bottomLeftCornerOverlay.clone) { + return this.wtOverlays.bottomLeftCornerOverlay.clone.wtTable.getCell(coords); + } + } else if (coords.col < fixedColumns) { + return this.wtOverlays.leftOverlay.clone.wtTable.getCell(coords); + } else if (coords.row > totalRows - fixedRowsBottom) { + if (this.wtOverlays.bottomOverlay.clone) { + return this.wtOverlays.bottomOverlay.clone.wtTable.getCell(coords); + } + } + return this.wtTable.getCell(coords); + }, + update: function(settings, value) { + return this.wtSettings.update(settings, value); + }, + scrollVertical: function(row) { + this.wtOverlays.topOverlay.scrollTo(row); + this.getSetting('onScrollVertically'); + return this; + }, + scrollHorizontal: function(column) { + this.wtOverlays.leftOverlay.scrollTo(column); + this.getSetting('onScrollHorizontally'); + return this; + }, + scrollViewport: function(coords) { + this.wtScroll.scrollViewport(coords); + return this; + }, + getViewport: function() { + return [this.wtTable.getFirstVisibleRow(), this.wtTable.getFirstVisibleColumn(), this.wtTable.getLastVisibleRow(), this.wtTable.getLastVisibleColumn()]; + }, + getOverlayName: function() { + return this.cloneOverlay ? this.cloneOverlay.type : 'master'; + }, + exportSettingsAsClassNames: function() { + var $__14 = this; + var toExport = { + rowHeaders: ['array'], + columnHeaders: ['array'] + }; + var allClassNames = []; + var newClassNames = []; + objectEach(toExport, (function(optionType, key) { + if (optionType.indexOf('array') > -1 && $__14.getSetting(key).length) { + newClassNames.push('ht' + toUpperCaseFirst(key)); + } + allClassNames.push('ht' + toUpperCaseFirst(key)); + })); + removeClass(this.wtTable.wtRootElement.parentNode, allClassNames); + addClass(this.wtTable.wtRootElement.parentNode, newClassNames); + }, + getSetting: function(key, param1, param2, param3, param4) { + return this.wtSettings.getSetting(key, param1, param2, param3, param4); + }, + hasSetting: function(key) { + return this.wtSettings.has(key); + }, + destroy: function() { + this.wtOverlays.destroy(); + this.wtEvent.destroy(); + } +}, {}); +; +window.Walkontable = Walkontable; + +//# +},{"event":8,"helpers/dom/element":45,"helpers/object":50,"helpers/string":52,"overlay/_base.js":11,"overlay/debug.js":12,"overlay/left.js":13,"overlay/top.js":14,"overlay/topLeftCorner.js":15,"overlays":16,"scroll":17,"settings":19,"table":20,"viewport":22}],8:[function(require,module,exports){ +"use strict"; +Object.defineProperties(exports, { + WalkontableEvent: {get: function() { + return WalkontableEvent; + }}, + __esModule: {value: true} +}); +var $___46__46__47__46__46__47__46__46__47_helpers_47_dom_47_element__, + $___46__46__47__46__46__47__46__46__47_eventManager__; +var $__0 = ($___46__46__47__46__46__47__46__46__47_helpers_47_dom_47_element__ = require("helpers/dom/element"), $___46__46__47__46__46__47__46__46__47_helpers_47_dom_47_element__ && $___46__46__47__46__46__47__46__46__47_helpers_47_dom_47_element__.__esModule && $___46__46__47__46__46__47__46__46__47_helpers_47_dom_47_element__ || {default: $___46__46__47__46__46__47__46__46__47_helpers_47_dom_47_element__}), + closest = $__0.closest, + hasClass = $__0.hasClass, + isChildOf = $__0.isChildOf; +var eventManagerObject = ($___46__46__47__46__46__47__46__46__47_eventManager__ = require("eventManager"), $___46__46__47__46__46__47__46__46__47_eventManager__ && $___46__46__47__46__46__47__46__46__47_eventManager__.__esModule && $___46__46__47__46__46__47__46__46__47_eventManager__ || {default: $___46__46__47__46__46__47__46__46__47_eventManager__}).eventManager; +function WalkontableEvent(instance) { + var that = this; + var eventManager = eventManagerObject(instance); + this.instance = instance; + var dblClickOrigin = [null, null]; + this.dblClickTimeout = [null, null]; + var onMouseDown = function(event) { + var cell = that.parentCell(event.realTarget); + if (hasClass(event.realTarget, 'corner')) { + that.instance.getSetting('onCellCornerMouseDown', event, event.realTarget); + } else if (cell.TD) { + if (that.instance.hasSetting('onCellMouseDown')) { + that.instance.getSetting('onCellMouseDown', event, cell.coords, cell.TD, that.instance); + } + } + if (event.button !== 2) { + if (cell.TD) { + dblClickOrigin[0] = cell.TD; + clearTimeout(that.dblClickTimeout[0]); + that.dblClickTimeout[0] = setTimeout(function() { + dblClickOrigin[0] = null; + }, 1000); + } + } + }; + var onTouchMove = function(event) { + that.instance.touchMoving = true; + }; + var longTouchTimeout; + var onTouchStart = function(event) { + var container = this; + eventManager.addEventListener(this, 'touchmove', onTouchMove); + that.checkIfTouchMove = setTimeout(function() { + if (that.instance.touchMoving === true) { + that.instance.touchMoving = void 0; + eventManager.removeEventListener('touchmove', onTouchMove, false); + return; + } else { + onMouseDown(event); + } + }, 30); + }; + var lastMouseOver; + var onMouseOver = function(event) { + var table, + td; + if (that.instance.hasSetting('onCellMouseOver')) { + table = that.instance.wtTable.TABLE; + td = closest(event.realTarget, ['TD', 'TH'], table); + if (td && td !== lastMouseOver && isChildOf(td, table)) { + lastMouseOver = td; + that.instance.getSetting('onCellMouseOver', event, that.instance.wtTable.getCoords(td), td, that.instance); + } + } + }; + var onMouseUp = function(event) { + if (event.button !== 2) { + var cell = that.parentCell(event.realTarget); + if (cell.TD === dblClickOrigin[0] && cell.TD === dblClickOrigin[1]) { + if (hasClass(event.realTarget, 'corner')) { + that.instance.getSetting('onCellCornerDblClick', event, cell.coords, cell.TD, that.instance); + } else { + that.instance.getSetting('onCellDblClick', event, cell.coords, cell.TD, that.instance); + } + dblClickOrigin[0] = null; + dblClickOrigin[1] = null; + } else if (cell.TD === dblClickOrigin[0]) { + dblClickOrigin[1] = cell.TD; + clearTimeout(that.dblClickTimeout[1]); + that.dblClickTimeout[1] = setTimeout(function() { + dblClickOrigin[1] = null; + }, 500); + } + } + }; + var onTouchEnd = function(event) { + clearTimeout(longTouchTimeout); + event.preventDefault(); + onMouseUp(event); + }; + eventManager.addEventListener(this.instance.wtTable.holder, 'mousedown', onMouseDown); + eventManager.addEventListener(this.instance.wtTable.TABLE, 'mouseover', onMouseOver); + eventManager.addEventListener(this.instance.wtTable.holder, 'mouseup', onMouseUp); + if (this.instance.wtTable.holder.parentNode.parentNode && Handsontable.mobileBrowser && !that.instance.wtTable.isWorkingOnClone()) { + var classSelector = '.' + this.instance.wtTable.holder.parentNode.className.split(' ').join('.'); + eventManager.addEventListener(this.instance.wtTable.holder, 'touchstart', function(event) { + that.instance.touchApplied = true; + if (isChildOf(event.target, classSelector)) { + onTouchStart.call(event.target, event); + } + }); + eventManager.addEventListener(this.instance.wtTable.holder, 'touchend', function(event) { + that.instance.touchApplied = false; + if (isChildOf(event.target, classSelector)) { + onTouchEnd.call(event.target, event); + } + }); + if (!that.instance.momentumScrolling) { + that.instance.momentumScrolling = {}; + } + eventManager.addEventListener(this.instance.wtTable.holder, 'scroll', function(event) { + clearTimeout(that.instance.momentumScrolling._timeout); + if (!that.instance.momentumScrolling.ongoing) { + that.instance.getSetting('onBeforeTouchScroll'); + } + that.instance.momentumScrolling.ongoing = true; + that.instance.momentumScrolling._timeout = setTimeout(function() { + if (!that.instance.touchApplied) { + that.instance.momentumScrolling.ongoing = false; + that.instance.getSetting('onAfterMomentumScroll'); + } + }, 200); + }); + } + eventManager.addEventListener(window, 'resize', function() { + if (that.instance.getSetting('stretchH') !== 'none') { + that.instance.draw(); + } + }); + this.destroy = function() { + clearTimeout(this.dblClickTimeout[0]); + clearTimeout(this.dblClickTimeout[1]); + eventManager.destroy(); + }; +} +WalkontableEvent.prototype.parentCell = function(elem) { + var cell = {}; + var TABLE = this.instance.wtTable.TABLE; + var TD = closest(elem, ['TD', 'TH'], TABLE); + if (TD && isChildOf(TD, TABLE)) { + cell.coords = this.instance.wtTable.getCoords(TD); + cell.TD = TD; + } else if (hasClass(elem, 'wtBorder') && hasClass(elem, 'current')) { + cell.coords = this.instance.selections.current.cellRange.highlight; + cell.TD = this.instance.wtTable.getCell(cell.coords); + } else if (hasClass(elem, 'wtBorder') && hasClass(elem, 'area')) { + if (this.instance.selections.area.cellRange) { + cell.coords = this.instance.selections.area.cellRange.to; + cell.TD = this.instance.wtTable.getCell(cell.coords); + } + } + return cell; +}; +; +window.WalkontableEvent = WalkontableEvent; + +//# +},{"eventManager":41,"helpers/dom/element":45}],9:[function(require,module,exports){ +"use strict"; +Object.defineProperties(exports, { + WalkontableColumnFilter: {get: function() { + return WalkontableColumnFilter; + }}, + __esModule: {value: true} +}); +var WalkontableColumnFilter = function WalkontableColumnFilter(offset, total, countTH) { + this.offset = offset; + this.total = total; + this.countTH = countTH; +}; +($traceurRuntime.createClass)(WalkontableColumnFilter, { + offsetted: function(index) { + return index + this.offset; + }, + unOffsetted: function(index) { + return index - this.offset; + }, + renderedToSource: function(index) { + return this.offsetted(index); + }, + sourceToRendered: function(index) { + return this.unOffsetted(index); + }, + offsettedTH: function(index) { + return index - this.countTH; + }, + unOffsettedTH: function(index) { + return index + this.countTH; + }, + visibleRowHeadedColumnToSourceColumn: function(index) { + return this.renderedToSource(this.offsettedTH(index)); + }, + sourceColumnToVisibleRowHeadedColumn: function(index) { + return this.unOffsettedTH(this.sourceToRendered(index)); + } +}, {}); +; +window.WalkontableColumnFilter = WalkontableColumnFilter; + +//# +},{}],10:[function(require,module,exports){ +"use strict"; +Object.defineProperties(exports, { + WalkontableRowFilter: {get: function() { + return WalkontableRowFilter; + }}, + __esModule: {value: true} +}); +var WalkontableRowFilter = function WalkontableRowFilter(offset, total, countTH) { + this.offset = offset; + this.total = total; + this.countTH = countTH; +}; +($traceurRuntime.createClass)(WalkontableRowFilter, { + offsetted: function(index) { + return index + this.offset; + }, + unOffsetted: function(index) { + return index - this.offset; + }, + renderedToSource: function(index) { + return this.offsetted(index); + }, + sourceToRendered: function(index) { + return this.unOffsetted(index); + }, + offsettedTH: function(index) { + return index - this.countTH; + }, + unOffsettedTH: function(index) { + return index + this.countTH; + }, + visibleColHeadedRowToSourceRow: function(index) { + return this.renderedToSource(this.offsettedTH(index)); + }, + sourceRowToVisibleColHeadedRow: function(index) { + return this.unOffsettedTH(this.sourceToRendered(index)); + } +}, {}); +; +window.WalkontableRowFilter = WalkontableRowFilter; + +//# +},{}],11:[function(require,module,exports){ +"use strict"; +Object.defineProperties(exports, { + WalkontableOverlay: {get: function() { + return WalkontableOverlay; + }}, + __esModule: {value: true} +}); +var $___46__46__47__46__46__47__46__46__47__46__46__47_helpers_47_dom_47_element__, + $___46__46__47__46__46__47__46__46__47__46__46__47_helpers_47_object__, + $___46__46__47__46__46__47__46__46__47__46__46__47_eventManager__; +var $__0 = ($___46__46__47__46__46__47__46__46__47__46__46__47_helpers_47_dom_47_element__ = require("helpers/dom/element"), $___46__46__47__46__46__47__46__46__47__46__46__47_helpers_47_dom_47_element__ && $___46__46__47__46__46__47__46__46__47__46__46__47_helpers_47_dom_47_element__.__esModule && $___46__46__47__46__46__47__46__46__47__46__46__47_helpers_47_dom_47_element__ || {default: $___46__46__47__46__46__47__46__46__47__46__46__47_helpers_47_dom_47_element__}), + getScrollableElement = $__0.getScrollableElement, + getTrimmingContainer = $__0.getTrimmingContainer; +var defineGetter = ($___46__46__47__46__46__47__46__46__47__46__46__47_helpers_47_object__ = require("helpers/object"), $___46__46__47__46__46__47__46__46__47__46__46__47_helpers_47_object__ && $___46__46__47__46__46__47__46__46__47__46__46__47_helpers_47_object__.__esModule && $___46__46__47__46__46__47__46__46__47__46__46__47_helpers_47_object__ || {default: $___46__46__47__46__46__47__46__46__47__46__46__47_helpers_47_object__}).defineGetter; +var eventManagerObject = ($___46__46__47__46__46__47__46__46__47__46__46__47_eventManager__ = require("eventManager"), $___46__46__47__46__46__47__46__46__47__46__46__47_eventManager__ && $___46__46__47__46__46__47__46__46__47__46__46__47_eventManager__.__esModule && $___46__46__47__46__46__47__46__46__47__46__46__47_eventManager__ || {default: $___46__46__47__46__46__47__46__46__47__46__46__47_eventManager__}).eventManager; +var registeredOverlays = {}; +var WalkontableOverlay = function WalkontableOverlay(wotInstance) { + defineGetter(this, 'wot', wotInstance, {writable: false}); + this.instance = this.wot; + this.type = ''; + this.TABLE = this.wot.wtTable.TABLE; + this.hider = this.wot.wtTable.hider; + this.spreader = this.wot.wtTable.spreader; + this.holder = this.wot.wtTable.holder; + this.wtRootElement = this.wot.wtTable.wtRootElement; + this.trimmingContainer = getTrimmingContainer(this.hider.parentNode.parentNode); + this.mainTableScrollableElement = getScrollableElement(this.wot.wtTable.TABLE); + this.needFullRender = this.shouldBeRendered(); + this.areElementSizesAdjusted = false; +}; +var $WalkontableOverlay = WalkontableOverlay; +($traceurRuntime.createClass)(WalkontableOverlay, { + shouldBeRendered: function() { + return true; + }, + makeClone: function(direction) { + if ($WalkontableOverlay.CLONE_TYPES.indexOf(direction) === -1) { + throw new Error('Clone type "' + direction + '" is not supported.'); + } + var clone = document.createElement('DIV'); + var clonedTable = document.createElement('TABLE'); + clone.className = 'ht_clone_' + direction + ' handsontable'; + clone.style.position = 'absolute'; + clone.style.top = 0; + clone.style.left = 0; + clone.style.overflow = 'hidden'; + clonedTable.className = this.wot.wtTable.TABLE.className; + clone.appendChild(clonedTable); + this.type = direction; + this.wot.wtTable.wtRootElement.parentNode.appendChild(clone); + return new Walkontable({ + cloneSource: this.wot, + cloneOverlay: this, + table: clonedTable + }); + }, + refresh: function() { + var fastDraw = arguments[0] !== (void 0) ? arguments[0] : false; + var nextCycleRenderFlag = this.shouldBeRendered(); + if (this.clone && (this.needFullRender || nextCycleRenderFlag)) { + this.clone.draw(fastDraw); + } + this.needFullRender = nextCycleRenderFlag; + }, + destroy: function() { + eventManagerObject(this.clone).destroy(); + } +}, { + get CLONE_TOP() { + return 'top'; + }, + get CLONE_BOTTOM() { + return 'bottom'; + }, + get CLONE_LEFT() { + return 'left'; + }, + get CLONE_TOP_LEFT_CORNER() { + return 'top_left_corner'; + }, + get CLONE_BOTTOM_LEFT_CORNER() { + return 'bottom_left_corner'; + }, + get CLONE_DEBUG() { + return 'debug'; + }, + get CLONE_TYPES() { + return [$WalkontableOverlay.CLONE_TOP, $WalkontableOverlay.CLONE_BOTTOM, $WalkontableOverlay.CLONE_LEFT, $WalkontableOverlay.CLONE_TOP_LEFT_CORNER, $WalkontableOverlay.CLONE_BOTTOM_LEFT_CORNER, $WalkontableOverlay.CLONE_DEBUG]; + }, + registerOverlay: function(type, overlayClass) { + if ($WalkontableOverlay.CLONE_TYPES.indexOf(type) === -1) { + throw new Error(("Unsupported overlay (" + type + ").")); + } + registeredOverlays[type] = overlayClass; + }, + createOverlay: function(type, wot) { + return new registeredOverlays[type](wot); + }, + isOverlayTypeOf: function(overlay, type) { + if (!overlay || !registeredOverlays[type]) { + return false; + } + return overlay instanceof registeredOverlays[type]; + } +}); +; +window.WalkontableOverlay = WalkontableOverlay; + +//# +},{"eventManager":41,"helpers/dom/element":45,"helpers/object":50}],12:[function(require,module,exports){ +"use strict"; +Object.defineProperties(exports, { + WalkontableDebugOverlay: {get: function() { + return WalkontableDebugOverlay; + }}, + __esModule: {value: true} +}); +var $___46__46__47__46__46__47__46__46__47__46__46__47_helpers_47_dom_47_element__, + $___95_base__; +var addClass = ($___46__46__47__46__46__47__46__46__47__46__46__47_helpers_47_dom_47_element__ = require("helpers/dom/element"), $___46__46__47__46__46__47__46__46__47__46__46__47_helpers_47_dom_47_element__ && $___46__46__47__46__46__47__46__46__47__46__46__47_helpers_47_dom_47_element__.__esModule && $___46__46__47__46__46__47__46__46__47__46__46__47_helpers_47_dom_47_element__ || {default: $___46__46__47__46__46__47__46__46__47__46__46__47_helpers_47_dom_47_element__}).addClass; +var WalkontableOverlay = ($___95_base__ = require("_base"), $___95_base__ && $___95_base__.__esModule && $___95_base__ || {default: $___95_base__}).WalkontableOverlay; +var WalkontableDebugOverlay = function WalkontableDebugOverlay(wotInstance) { + $traceurRuntime.superConstructor($WalkontableDebugOverlay).call(this, wotInstance); + this.clone = this.makeClone(WalkontableOverlay.CLONE_DEBUG); + this.clone.wtTable.holder.style.opacity = 0.4; + this.clone.wtTable.holder.style.textShadow = '0 0 2px #ff0000'; + addClass(this.clone.wtTable.holder.parentNode, 'wtDebugVisible'); +}; +var $WalkontableDebugOverlay = WalkontableDebugOverlay; +($traceurRuntime.createClass)(WalkontableDebugOverlay, {}, {}, WalkontableOverlay); +; +window.WalkontableDebugOverlay = WalkontableDebugOverlay; +WalkontableOverlay.registerOverlay(WalkontableOverlay.CLONE_DEBUG, WalkontableDebugOverlay); + +//# +},{"_base":11,"helpers/dom/element":45}],13:[function(require,module,exports){ +"use strict"; +Object.defineProperties(exports, { + WalkontableLeftOverlay: {get: function() { + return WalkontableLeftOverlay; + }}, + __esModule: {value: true} +}); +var $___46__46__47__46__46__47__46__46__47__46__46__47_helpers_47_dom_47_element__, + $___95_base__; +var $__0 = ($___46__46__47__46__46__47__46__46__47__46__46__47_helpers_47_dom_47_element__ = require("helpers/dom/element"), $___46__46__47__46__46__47__46__46__47__46__46__47_helpers_47_dom_47_element__ && $___46__46__47__46__46__47__46__46__47__46__46__47_helpers_47_dom_47_element__.__esModule && $___46__46__47__46__46__47__46__46__47__46__46__47_helpers_47_dom_47_element__ || {default: $___46__46__47__46__46__47__46__46__47__46__46__47_helpers_47_dom_47_element__}), + addClass = $__0.addClass, + getScrollbarWidth = $__0.getScrollbarWidth, + getScrollLeft = $__0.getScrollLeft, + getWindowScrollTop = $__0.getWindowScrollTop, + hasClass = $__0.hasClass, + outerWidth = $__0.outerWidth, + removeClass = $__0.removeClass, + setOverlayPosition = $__0.setOverlayPosition; +var WalkontableOverlay = ($___95_base__ = require("_base"), $___95_base__ && $___95_base__.__esModule && $___95_base__ || {default: $___95_base__}).WalkontableOverlay; +var WalkontableLeftOverlay = function WalkontableLeftOverlay(wotInstance) { + $traceurRuntime.superConstructor($WalkontableLeftOverlay).call(this, wotInstance); + this.clone = this.makeClone(WalkontableOverlay.CLONE_LEFT); +}; +var $WalkontableLeftOverlay = WalkontableLeftOverlay; +($traceurRuntime.createClass)(WalkontableLeftOverlay, { + shouldBeRendered: function() { + return this.wot.getSetting('fixedColumnsLeft') || this.wot.getSetting('rowHeaders').length ? true : false; + }, + resetFixedPosition: function() { + if (!this.needFullRender || !this.wot.wtTable.holder.parentNode) { + return; + } + var overlayRoot = this.clone.wtTable.holder.parentNode; + var headerPosition = 0; + if (this.trimmingContainer === window) { + var box = this.wot.wtTable.hider.getBoundingClientRect(); + var left = Math.ceil(box.left); + var right = Math.ceil(box.right); + var finalLeft; + var finalTop; + finalTop = this.wot.wtTable.hider.style.top; + finalTop = finalTop === '' ? 0 : finalTop; + if (left < 0 && (right - overlayRoot.offsetWidth) > 0) { + finalLeft = -left; + } else { + finalLeft = 0; + } + headerPosition = finalLeft; + finalLeft = finalLeft + 'px'; + setOverlayPosition(overlayRoot, finalLeft, finalTop); + } else { + headerPosition = this.getScrollPosition(); + } + this.adjustHeaderBordersPosition(headerPosition); + this.adjustElementsSize(); + }, + setScrollPosition: function(pos) { + if (this.mainTableScrollableElement === window) { + window.scrollTo(pos, getWindowScrollTop()); + } else { + this.mainTableScrollableElement.scrollLeft = pos; + } + }, + onScroll: function() { + this.wot.getSetting('onScrollVertically'); + }, + sumCellSizes: function(from, to) { + var sum = 0; + var defaultColumnWidth = this.wot.wtSettings.defaultColumnWidth; + while (from < to) { + sum += this.wot.wtTable.getStretchedColumnWidth(from) || defaultColumnWidth; + from++; + } + return sum; + }, + adjustElementsSize: function() { + var force = arguments[0] !== (void 0) ? arguments[0] : false; + if (this.needFullRender || force) { + this.adjustRootElementSize(); + this.adjustRootChildrenSize(); + if (!force) { + this.areElementSizesAdjusted = true; + } + } + }, + adjustRootElementSize: function() { + var masterHolder = this.wot.wtTable.holder; + var scrollbarHeight = masterHolder.clientHeight === masterHolder.offsetHeight ? 0 : getScrollbarWidth(); + var overlayRoot = this.clone.wtTable.holder.parentNode; + var overlayRootStyle = overlayRoot.style; + var tableWidth; + if (this.trimmingContainer !== window) { + overlayRootStyle.height = this.wot.wtViewport.getWorkspaceHeight() - scrollbarHeight + 'px'; + } + this.clone.wtTable.holder.style.height = overlayRootStyle.height; + tableWidth = outerWidth(this.clone.wtTable.TABLE); + overlayRootStyle.width = (tableWidth === 0 ? tableWidth : tableWidth + 4) + 'px'; + }, + adjustRootChildrenSize: function() { + var scrollbarWidth = getScrollbarWidth(); + this.clone.wtTable.hider.style.height = this.hider.style.height; + this.clone.wtTable.holder.style.height = this.clone.wtTable.holder.parentNode.style.height; + if (scrollbarWidth === 0) { + scrollbarWidth = 30; + } + this.clone.wtTable.holder.style.width = parseInt(this.clone.wtTable.holder.parentNode.style.width, 10) + scrollbarWidth + 'px'; + }, + applyToDOM: function() { + var total = this.wot.getSetting('totalColumns'); + if (!this.areElementSizesAdjusted) { + this.adjustElementsSize(); + } + if (typeof this.wot.wtViewport.columnsRenderCalculator.startPosition === 'number') { + this.spreader.style.left = this.wot.wtViewport.columnsRenderCalculator.startPosition + 'px'; + } else if (total === 0) { + this.spreader.style.left = '0'; + } else { + throw new Error('Incorrect value of the columnsRenderCalculator'); + } + this.spreader.style.right = ''; + if (this.needFullRender) { + this.syncOverlayOffset(); + } + }, + syncOverlayOffset: function() { + if (typeof this.wot.wtViewport.rowsRenderCalculator.startPosition === 'number') { + this.clone.wtTable.spreader.style.top = this.wot.wtViewport.rowsRenderCalculator.startPosition + 'px'; + } else { + this.clone.wtTable.spreader.style.top = ''; + } + }, + scrollTo: function(sourceCol, beyondRendered) { + var newX = this.getTableParentOffset(); + var sourceInstance = this.wot.cloneSource ? this.wot.cloneSource : this.wot; + var mainHolder = sourceInstance.wtTable.holder; + var scrollbarCompensation = 0; + if (beyondRendered && mainHolder.offsetWidth !== mainHolder.clientWidth) { + scrollbarCompensation = getScrollbarWidth(); + } + if (beyondRendered) { + newX += this.sumCellSizes(0, sourceCol + 1); + newX -= this.wot.wtViewport.getViewportWidth(); + } else { + newX += this.sumCellSizes(this.wot.getSetting('fixedColumnsLeft'), sourceCol); + } + newX += scrollbarCompensation; + this.setScrollPosition(newX); + }, + getTableParentOffset: function() { + if (this.trimmingContainer === window) { + return this.wot.wtTable.holderOffset.left; + } else { + return 0; + } + }, + getScrollPosition: function() { + return getScrollLeft(this.mainTableScrollableElement); + }, + adjustHeaderBordersPosition: function(position) { + var masterParent = this.wot.wtTable.holder.parentNode; + var rowHeaders = this.wot.getSetting('rowHeaders'); + var fixedColumnsLeft = this.wot.getSetting('fixedColumnsLeft'); + if (fixedColumnsLeft && !rowHeaders.length) { + addClass(masterParent, 'innerBorderLeft'); + } else if (!fixedColumnsLeft && rowHeaders.length) { + var previousState = hasClass(masterParent, 'innerBorderLeft'); + if (position) { + addClass(masterParent, 'innerBorderLeft'); + } else { + removeClass(masterParent, 'innerBorderLeft'); + } + if (!previousState && position || previousState && !position) { + this.wot.wtOverlays.adjustElementsSize(); + } + } + } +}, {}, WalkontableOverlay); +; +window.WalkontableLeftOverlay = WalkontableLeftOverlay; +WalkontableOverlay.registerOverlay(WalkontableOverlay.CLONE_LEFT, WalkontableLeftOverlay); + +//# +},{"_base":11,"helpers/dom/element":45}],14:[function(require,module,exports){ +"use strict"; +Object.defineProperties(exports, { + WalkontableTopOverlay: {get: function() { + return WalkontableTopOverlay; + }}, + __esModule: {value: true} +}); +var $___46__46__47__46__46__47__46__46__47__46__46__47_helpers_47_dom_47_element__, + $___95_base__; +var $__0 = ($___46__46__47__46__46__47__46__46__47__46__46__47_helpers_47_dom_47_element__ = require("helpers/dom/element"), $___46__46__47__46__46__47__46__46__47__46__46__47_helpers_47_dom_47_element__ && $___46__46__47__46__46__47__46__46__47__46__46__47_helpers_47_dom_47_element__.__esModule && $___46__46__47__46__46__47__46__46__47__46__46__47_helpers_47_dom_47_element__ || {default: $___46__46__47__46__46__47__46__46__47__46__46__47_helpers_47_dom_47_element__}), + addClass = $__0.addClass, + getScrollbarWidth = $__0.getScrollbarWidth, + getScrollTop = $__0.getScrollTop, + getWindowScrollLeft = $__0.getWindowScrollLeft, + hasClass = $__0.hasClass, + outerHeight = $__0.outerHeight, + removeClass = $__0.removeClass, + setOverlayPosition = $__0.setOverlayPosition; +var WalkontableOverlay = ($___95_base__ = require("_base"), $___95_base__ && $___95_base__.__esModule && $___95_base__ || {default: $___95_base__}).WalkontableOverlay; +var WalkontableTopOverlay = function WalkontableTopOverlay(wotInstance) { + $traceurRuntime.superConstructor($WalkontableTopOverlay).call(this, wotInstance); + this.clone = this.makeClone(WalkontableOverlay.CLONE_TOP); +}; +var $WalkontableTopOverlay = WalkontableTopOverlay; +($traceurRuntime.createClass)(WalkontableTopOverlay, { + shouldBeRendered: function() { + return this.wot.getSetting('fixedRowsTop') || this.wot.getSetting('columnHeaders').length ? true : false; + }, + resetFixedPosition: function() { + if (!this.needFullRender || !this.wot.wtTable.holder.parentNode) { + return; + } + var overlayRoot = this.clone.wtTable.holder.parentNode; + var headerPosition = 0; + if (this.wot.wtOverlays.leftOverlay.trimmingContainer === window) { + var box = this.wot.wtTable.hider.getBoundingClientRect(); + var top = Math.ceil(box.top); + var bottom = Math.ceil(box.bottom); + var finalLeft; + var finalTop; + finalLeft = this.wot.wtTable.hider.style.left; + finalLeft = finalLeft === '' ? 0 : finalLeft; + if (top < 0 && (bottom - overlayRoot.offsetHeight) > 0) { + finalTop = -top; + } else { + finalTop = 0; + } + headerPosition = finalTop; + finalTop = finalTop + 'px'; + setOverlayPosition(overlayRoot, finalLeft, finalTop); + } else { + headerPosition = this.getScrollPosition(); + } + this.adjustHeaderBordersPosition(headerPosition); + this.adjustElementsSize(); + }, + setScrollPosition: function(pos) { + if (this.mainTableScrollableElement === window) { + window.scrollTo(getWindowScrollLeft(), pos); + } else { + this.mainTableScrollableElement.scrollTop = pos; + } + }, + onScroll: function() { + this.wot.getSetting('onScrollHorizontally'); + }, + sumCellSizes: function(from, to) { + var sum = 0; + var defaultRowHeight = this.wot.wtSettings.settings.defaultRowHeight; + while (from < to) { + var height = this.wot.wtTable.getRowHeight(from); + sum += height === void 0 ? defaultRowHeight : height; + from++; + } + return sum; + }, + adjustElementsSize: function() { + var force = arguments[0] !== (void 0) ? arguments[0] : false; + if (this.needFullRender || force) { + this.adjustRootElementSize(); + this.adjustRootChildrenSize(); + if (!force) { + this.areElementSizesAdjusted = true; + } + } + }, + adjustRootElementSize: function() { + var masterHolder = this.wot.wtTable.holder; + var scrollbarWidth = masterHolder.clientWidth === masterHolder.offsetWidth ? 0 : getScrollbarWidth(); + var overlayRoot = this.clone.wtTable.holder.parentNode; + var overlayRootStyle = overlayRoot.style; + var tableHeight; + if (this.trimmingContainer !== window) { + overlayRootStyle.width = this.wot.wtViewport.getWorkspaceWidth() - scrollbarWidth + 'px'; + } + this.clone.wtTable.holder.style.width = overlayRootStyle.width; + tableHeight = outerHeight(this.clone.wtTable.TABLE); + overlayRootStyle.height = (tableHeight === 0 ? tableHeight : tableHeight + 4) + 'px'; + }, + adjustRootChildrenSize: function() { + var scrollbarWidth = getScrollbarWidth(); + this.clone.wtTable.hider.style.width = this.hider.style.width; + this.clone.wtTable.holder.style.width = this.clone.wtTable.holder.parentNode.style.width; + if (scrollbarWidth === 0) { + scrollbarWidth = 30; + } + this.clone.wtTable.holder.style.height = parseInt(this.clone.wtTable.holder.parentNode.style.height, 10) + scrollbarWidth + 'px'; + }, + applyToDOM: function() { + var total = this.wot.getSetting('totalRows'); + if (!this.areElementSizesAdjusted) { + this.adjustElementsSize(); + } + if (typeof this.wot.wtViewport.rowsRenderCalculator.startPosition === 'number') { + this.spreader.style.top = this.wot.wtViewport.rowsRenderCalculator.startPosition + 'px'; + } else if (total === 0) { + this.spreader.style.top = '0'; + } else { + throw new Error('Incorrect value of the rowsRenderCalculator'); + } + this.spreader.style.bottom = ''; + if (this.needFullRender) { + this.syncOverlayOffset(); + } + }, + syncOverlayOffset: function() { + if (typeof this.wot.wtViewport.columnsRenderCalculator.startPosition === 'number') { + this.clone.wtTable.spreader.style.left = this.wot.wtViewport.columnsRenderCalculator.startPosition + 'px'; + } else { + this.clone.wtTable.spreader.style.left = ''; + } + }, + scrollTo: function(sourceRow, bottomEdge) { + var newY = this.getTableParentOffset(); + var sourceInstance = this.wot.cloneSource ? this.wot.cloneSource : this.wot; + var mainHolder = sourceInstance.wtTable.holder; + var scrollbarCompensation = 0; + if (bottomEdge && mainHolder.offsetHeight !== mainHolder.clientHeight) { + scrollbarCompensation = getScrollbarWidth(); + } + if (bottomEdge) { + var fixedRowsBottom = this.wot.getSetting('fixedRowsBottom'); + var fixedRowsTop = this.wot.getSetting('fixedRowsTop'); + var totalRows = this.wot.getSetting('totalRows'); + newY += this.sumCellSizes(0, sourceRow + 1); + newY -= this.wot.wtViewport.getViewportHeight() - this.sumCellSizes(totalRows - fixedRowsBottom, totalRows); + newY += 1; + } else { + newY += this.sumCellSizes(this.wot.getSetting('fixedRowsTop'), sourceRow); + } + newY += scrollbarCompensation; + this.setScrollPosition(newY); + }, + getTableParentOffset: function() { + if (this.mainTableScrollableElement === window) { + return this.wot.wtTable.holderOffset.top; + } else { + return 0; + } + }, + getScrollPosition: function() { + return getScrollTop(this.mainTableScrollableElement); + }, + adjustHeaderBordersPosition: function(position) { + if (this.wot.getSetting('fixedRowsTop') === 0 && this.wot.getSetting('columnHeaders').length > 0) { + var masterParent = this.wot.wtTable.holder.parentNode; + var previousState = hasClass(masterParent, 'innerBorderTop'); + if (position) { + addClass(masterParent, 'innerBorderTop'); + } else { + removeClass(masterParent, 'innerBorderTop'); + } + if (!previousState && position || previousState && !position) { + this.wot.wtOverlays.adjustElementsSize(); + } + } + if (this.wot.getSetting('rowHeaders').length === 0) { + var secondHeaderCell = this.clone.wtTable.THEAD.querySelectorAll('th:nth-of-type(2)'); + if (secondHeaderCell) { + for (var i = 0; i < secondHeaderCell.length; i++) { + secondHeaderCell[i].style['border-left-width'] = 0; + } + } + } + } +}, {}, WalkontableOverlay); +; +window.WalkontableTopOverlay = WalkontableTopOverlay; +WalkontableOverlay.registerOverlay(WalkontableOverlay.CLONE_TOP, WalkontableTopOverlay); + +//# +},{"_base":11,"helpers/dom/element":45}],15:[function(require,module,exports){ +"use strict"; +Object.defineProperties(exports, { + WalkontableTopLeftCornerOverlay: {get: function() { + return WalkontableTopLeftCornerOverlay; + }}, + __esModule: {value: true} +}); +var $___46__46__47__46__46__47__46__46__47__46__46__47_helpers_47_dom_47_element__, + $___95_base__; +var $__0 = ($___46__46__47__46__46__47__46__46__47__46__46__47_helpers_47_dom_47_element__ = require("helpers/dom/element"), $___46__46__47__46__46__47__46__46__47__46__46__47_helpers_47_dom_47_element__ && $___46__46__47__46__46__47__46__46__47__46__46__47_helpers_47_dom_47_element__.__esModule && $___46__46__47__46__46__47__46__46__47__46__46__47_helpers_47_dom_47_element__ || {default: $___46__46__47__46__46__47__46__46__47__46__46__47_helpers_47_dom_47_element__}), + outerHeight = $__0.outerHeight, + outerWidth = $__0.outerWidth, + setOverlayPosition = $__0.setOverlayPosition; +var WalkontableOverlay = ($___95_base__ = require("_base"), $___95_base__ && $___95_base__.__esModule && $___95_base__ || {default: $___95_base__}).WalkontableOverlay; +var WalkontableTopLeftCornerOverlay = function WalkontableTopLeftCornerOverlay(wotInstance) { + $traceurRuntime.superConstructor($WalkontableTopLeftCornerOverlay).call(this, wotInstance); + this.clone = this.makeClone(WalkontableOverlay.CLONE_TOP_LEFT_CORNER); +}; +var $WalkontableTopLeftCornerOverlay = WalkontableTopLeftCornerOverlay; +($traceurRuntime.createClass)(WalkontableTopLeftCornerOverlay, { + shouldBeRendered: function() { + return (this.wot.getSetting('fixedRowsTop') || this.wot.getSetting('columnHeaders').length) && (this.wot.getSetting('fixedColumnsLeft') || this.wot.getSetting('rowHeaders').length) ? true : false; + }, + resetFixedPosition: function() { + if (!this.wot.wtTable.holder.parentNode) { + return; + } + var overlayRoot = this.clone.wtTable.holder.parentNode; + var tableHeight = outerHeight(this.clone.wtTable.TABLE); + var tableWidth = outerWidth(this.clone.wtTable.TABLE); + if (this.trimmingContainer === window) { + var box = this.wot.wtTable.hider.getBoundingClientRect(); + var top = Math.ceil(box.top); + var left = Math.ceil(box.left); + var bottom = Math.ceil(box.bottom); + var right = Math.ceil(box.right); + var finalLeft; + var finalTop; + if (left < 0 && (right - overlayRoot.offsetWidth) > 0) { + finalLeft = -left + 'px'; + } else { + finalLeft = '0'; + } + if (top < 0 && (bottom - overlayRoot.offsetHeight) > 0) { + finalTop = -top + 'px'; + } else { + finalTop = '0'; + } + setOverlayPosition(overlayRoot, finalLeft, finalTop); + } + overlayRoot.style.height = (tableHeight === 0 ? tableHeight : tableHeight + 4) + 'px'; + overlayRoot.style.width = (tableWidth === 0 ? tableWidth : tableWidth + 4) + 'px'; + } +}, {}, WalkontableOverlay); +; +window.WalkontableTopLeftCornerOverlay = WalkontableTopLeftCornerOverlay; +WalkontableOverlay.registerOverlay(WalkontableOverlay.CLONE_TOP_LEFT_CORNER, WalkontableTopLeftCornerOverlay); + +//# +},{"_base":11,"helpers/dom/element":45}],16:[function(require,module,exports){ +"use strict"; +Object.defineProperties(exports, { + WalkontableOverlays: {get: function() { + return WalkontableOverlays; + }}, + __esModule: {value: true} +}); +var $___46__46__47__46__46__47__46__46__47_helpers_47_dom_47_element__, + $___46__46__47__46__46__47__46__46__47_helpers_47_unicode__, + $___46__46__47__46__46__47__46__46__47_eventManager__; +var $__0 = ($___46__46__47__46__46__47__46__46__47_helpers_47_dom_47_element__ = require("helpers/dom/element"), $___46__46__47__46__46__47__46__46__47_helpers_47_dom_47_element__ && $___46__46__47__46__46__47__46__46__47_helpers_47_dom_47_element__.__esModule && $___46__46__47__46__46__47__46__46__47_helpers_47_dom_47_element__ || {default: $___46__46__47__46__46__47__46__46__47_helpers_47_dom_47_element__}), + getScrollableElement = $__0.getScrollableElement, + getScrollbarWidth = $__0.getScrollbarWidth, + getScrollLeft = $__0.getScrollLeft, + getScrollTop = $__0.getScrollTop; +var isKey = ($___46__46__47__46__46__47__46__46__47_helpers_47_unicode__ = require("helpers/unicode"), $___46__46__47__46__46__47__46__46__47_helpers_47_unicode__ && $___46__46__47__46__46__47__46__46__47_helpers_47_unicode__.__esModule && $___46__46__47__46__46__47__46__46__47_helpers_47_unicode__ || {default: $___46__46__47__46__46__47__46__46__47_helpers_47_unicode__}).isKey; +var EventManager = ($___46__46__47__46__46__47__46__46__47_eventManager__ = require("eventManager"), $___46__46__47__46__46__47__46__46__47_eventManager__ && $___46__46__47__46__46__47__46__46__47_eventManager__.__esModule && $___46__46__47__46__46__47__46__46__47_eventManager__ || {default: $___46__46__47__46__46__47__46__46__47_eventManager__}).EventManager; +var WalkontableOverlays = function WalkontableOverlays(wotInstance) { + this.wot = wotInstance; + this.instance = this.wot; + this.eventManager = new EventManager(this.wot); + this.wot.update('scrollbarWidth', getScrollbarWidth()); + this.wot.update('scrollbarHeight', getScrollbarWidth()); + this.mainTableScrollableElement = getScrollableElement(this.wot.wtTable.TABLE); + this.topOverlay = WalkontableOverlay.createOverlay(WalkontableOverlay.CLONE_TOP, this.wot); + if (typeof WalkontableBottomOverlay === 'undefined') { + this.bottomOverlay = {needFullRender: false}; + } else { + this.bottomOverlay = WalkontableOverlay.createOverlay(WalkontableOverlay.CLONE_BOTTOM, this.wot); + } + this.leftOverlay = WalkontableOverlay.createOverlay(WalkontableOverlay.CLONE_LEFT, this.wot); + if (this.topOverlay.needFullRender && this.leftOverlay.needFullRender) { + this.topLeftCornerOverlay = WalkontableOverlay.createOverlay(WalkontableOverlay.CLONE_TOP_LEFT_CORNER, this.wot); + } + if (this.bottomOverlay.needFullRender && this.leftOverlay.needFullRender && typeof WalkontableBottomLeftCornerOverlay !== 'undefined') { + this.bottomLeftCornerOverlay = WalkontableOverlay.createOverlay(WalkontableOverlay.CLONE_BOTTOM_LEFT_CORNER, this.wot); + } else { + this.bottomLeftCornerOverlay = {needFullRender: false}; + } + if (this.wot.getSetting('debug')) { + this.debug = WalkontableOverlay.createOverlay(WalkontableOverlay.CLONE_DEBUG, this.wot); + } + this.destroyed = false; + this.keyPressed = false; + this.spreaderLastSize = { + width: null, + height: null + }; + this.overlayScrollPositions = { + master: { + top: 0, + left: 0 + }, + top: { + top: null, + left: 0 + }, + bottom: { + top: null, + left: 0 + }, + left: { + top: 0, + left: null + } + }; + this.verticalScrolling = false; + this.horizontalScrolling = false; + this.delegatedScrollCallback = false; + this.registerListeners(); +}; +($traceurRuntime.createClass)(WalkontableOverlays, { + refreshAll: function() { + if (!this.wot.drawn) { + return; + } + if (!this.wot.wtTable.holder.parentNode) { + this.destroy(); + return; + } + this.wot.draw(true); + if (this.verticalScrolling) { + this.leftOverlay.onScroll(); + } + if (this.horizontalScrolling) { + this.topOverlay.onScroll(); + } + this.verticalScrolling = false; + this.horizontalScrolling = false; + }, + registerListeners: function() { + var $__3 = this; + this.eventManager.addEventListener(document.documentElement, 'keydown', (function(event) { + return $__3.onKeyDown(event); + })); + this.eventManager.addEventListener(document.documentElement, 'keyup', (function() { + return $__3.onKeyUp(); + })); + this.eventManager.addEventListener(document, 'visibilitychange', (function() { + return $__3.onKeyUp(); + })); + this.eventManager.addEventListener(this.mainTableScrollableElement, 'scroll', (function(event) { + return $__3.onTableScroll(event); + })); + if (this.topOverlay.needFullRender) { + this.eventManager.addEventListener(this.topOverlay.clone.wtTable.holder, 'scroll', (function(event) { + return $__3.onTableScroll(event); + })); + this.eventManager.addEventListener(this.topOverlay.clone.wtTable.holder, 'wheel', (function(event) { + return $__3.onTableScroll(event); + })); + } + if (this.bottomOverlay.needFullRender) { + this.eventManager.addEventListener(this.bottomOverlay.clone.wtTable.holder, 'scroll', (function(event) { + return $__3.onTableScroll(event); + })); + this.eventManager.addEventListener(this.bottomOverlay.clone.wtTable.holder, 'wheel', (function(event) { + return $__3.onTableScroll(event); + })); + } + if (this.leftOverlay.needFullRender) { + this.eventManager.addEventListener(this.leftOverlay.clone.wtTable.holder, 'scroll', (function(event) { + return $__3.onTableScroll(event); + })); + this.eventManager.addEventListener(this.leftOverlay.clone.wtTable.holder, 'wheel', (function(event) { + return $__3.onTableScroll(event); + })); + } + if (this.topOverlay.trimmingContainer !== window && this.leftOverlay.trimmingContainer !== window) { + this.eventManager.addEventListener(window, 'wheel', (function(event) { + var overlay; + var deltaY = event.wheelDeltaY || event.deltaY; + var deltaX = event.wheelDeltaX || event.deltaX; + if ($__3.topOverlay.clone.wtTable.holder.contains(event.realTarget)) { + overlay = 'top'; + } else if ($__3.bottomOverlay.clone && $__3.bottomOverlay.clone.wtTable.holder.contains(event.realTarget)) { + overlay = 'bottom'; + } else if ($__3.leftOverlay.clone.wtTable.holder.contains(event.realTarget)) { + overlay = 'left'; + } + if (overlay == 'top' && deltaY !== 0) { + event.preventDefault(); + } else if (overlay == 'left' && deltaX !== 0) { + event.preventDefault(); + } else if (overlay == 'bottom' && deltaY !== 0) { + event.preventDefault(); + } + })); + } + }, + onTableScroll: function(event) { + if (Handsontable.mobileBrowser) { + return; + } + if (this.keyPressed && this.mainTableScrollableElement !== window && !event.target.contains(this.mainTableScrollableElement)) { + return; + } + if (event.type === 'scroll') { + this.syncScrollPositions(event); + } else { + this.translateMouseWheelToScroll(event); + } + }, + onKeyDown: function(event) { + this.keyPressed = isKey(event.keyCode, 'ARROW_UP|ARROW_RIGHT|ARROW_DOWN|ARROW_LEFT'); + }, + onKeyUp: function() { + this.keyPressed = false; + }, + translateMouseWheelToScroll: function(event) { + var topOverlay = this.topOverlay.clone.wtTable.holder; + var bottomOverlay = this.bottomOverlay.clone ? this.bottomOverlay.clone.wtTable.holder : null; + var leftOverlay = this.leftOverlay.clone.wtTable.holder; + var eventMockup = {type: 'wheel'}; + var tempElem = event.target; + var deltaY = event.wheelDeltaY || (-1) * event.deltaY; + var deltaX = event.wheelDeltaX || (-1) * event.deltaX; + var parentHolder; + while (tempElem != document && tempElem != null) { + if (tempElem.className.indexOf('wtHolder') > -1) { + parentHolder = tempElem; + break; + } + tempElem = tempElem.parentNode; + } + eventMockup.target = parentHolder; + if (parentHolder == topOverlay) { + this.syncScrollPositions(eventMockup, (-0.2) * deltaY); + } else if (parentHolder == bottomOverlay) { + this.syncScrollPositions(eventMockup, (-0.2) * deltaY); + } else if (parentHolder == leftOverlay) { + this.syncScrollPositions(eventMockup, (-0.2) * deltaX); + } + return false; + }, + syncScrollPositions: function(event) { + var fakeScrollValue = arguments[1] !== (void 0) ? arguments[1] : null; + if (this.destroyed) { + return; + } + if (arguments.length === 0) { + this.syncScrollWithMaster(); + return; + } + var master = this.mainTableScrollableElement; + var target = event.target; + var tempScrollValue = 0; + var scrollValueChanged = false; + var topOverlay; + var leftOverlay; + var bottomOverlay; + var delegatedScroll = false; + if (this.topOverlay.needFullRender) { + topOverlay = this.topOverlay.clone.wtTable.holder; + } + if (this.bottomOverlay.needFullRender) { + bottomOverlay = this.bottomOverlay.clone.wtTable.holder; + } + if (this.leftOverlay.needFullRender) { + leftOverlay = this.leftOverlay.clone.wtTable.holder; + } + if (target === document) { + target = window; + } + if (target === master) { + tempScrollValue = getScrollLeft(target); + if (this.overlayScrollPositions.master.left !== tempScrollValue) { + this.horizontalScrolling = true; + this.overlayScrollPositions.master.left = tempScrollValue; + scrollValueChanged = true; + if (topOverlay) { + topOverlay.scrollLeft = tempScrollValue; + delegatedScroll = (this.mainTableScrollableElement !== window); + } + if (bottomOverlay) { + bottomOverlay.scrollLeft = tempScrollValue; + delegatedScroll = (this.mainTableScrollableElement !== window); + } + } + tempScrollValue = getScrollTop(target); + if (this.overlayScrollPositions.master.top !== tempScrollValue) { + this.verticalScrolling = true; + this.overlayScrollPositions.master.top = tempScrollValue; + scrollValueChanged = true; + if (leftOverlay) { + leftOverlay.scrollTop = tempScrollValue; + delegatedScroll = (this.mainTableScrollableElement !== window); + } + } + } else if (target === bottomOverlay) { + tempScrollValue = getScrollLeft(target); + if (this.overlayScrollPositions.bottom.left !== tempScrollValue) { + this.horizontalScrolling = true; + this.overlayScrollPositions.bottom.left = tempScrollValue; + scrollValueChanged = true; + master.scrollLeft = tempScrollValue; + } + if (fakeScrollValue !== null) { + scrollValueChanged = true; + master.scrollTop += fakeScrollValue; + } + } else if (target === topOverlay) { + tempScrollValue = getScrollLeft(target); + if (this.overlayScrollPositions.top.left !== tempScrollValue) { + this.horizontalScrolling = true; + this.overlayScrollPositions.top.left = tempScrollValue; + scrollValueChanged = true; + master.scrollLeft = tempScrollValue; + } + if (fakeScrollValue !== null) { + scrollValueChanged = true; + master.scrollTop += fakeScrollValue; + } + } else if (target === leftOverlay) { + tempScrollValue = getScrollTop(target); + if (this.overlayScrollPositions.left.top !== tempScrollValue) { + this.verticalScrolling = true; + this.overlayScrollPositions.left.top = tempScrollValue; + scrollValueChanged = true; + master.scrollTop = tempScrollValue; + } + if (fakeScrollValue !== null) { + scrollValueChanged = true; + master.scrollLeft += fakeScrollValue; + } + } + if (!this.keyPressed && scrollValueChanged && event.type === 'scroll') { + if (this.delegatedScrollCallback) { + this.delegatedScrollCallback = false; + } else { + this.refreshAll(); + } + if (delegatedScroll) { + this.delegatedScrollCallback = true; + } + } + }, + syncScrollWithMaster: function() { + var master = this.topOverlay.mainTableScrollableElement; + if (this.topOverlay.needFullRender) { + this.topOverlay.clone.wtTable.holder.scrollLeft = master.scrollLeft; + } + if (this.leftOverlay.needFullRender) { + this.leftOverlay.clone.wtTable.holder.scrollTop = master.scrollTop; + } + }, + destroy: function() { + this.eventManager.destroy(); + this.topOverlay.destroy(); + if (this.bottomOverlay.clone) { + this.bottomOverlay.destroy(); + } + this.leftOverlay.destroy(); + if (this.topLeftCornerOverlay) { + this.topLeftCornerOverlay.destroy(); + } + if (this.bottomLeftCornerOverlay && this.bottomLeftCornerOverlay.clone) { + this.bottomLeftCornerOverlay.destroy(); + } + if (this.debug) { + this.debug.destroy(); + } + this.destroyed = true; + }, + refresh: function() { + var fastDraw = arguments[0] !== (void 0) ? arguments[0] : false; + if (this.topOverlay.areElementSizesAdjusted && this.leftOverlay.areElementSizesAdjusted) { + var container = this.wot.wtTable.wtRootElement.parentNode || this.wot.wtTable.wtRootElement; + var width = container.clientWidth; + var height = container.clientHeight; + if (width !== this.spreaderLastSize.width || height !== this.spreaderLastSize.height) { + this.spreaderLastSize.width = width; + this.spreaderLastSize.height = height; + this.adjustElementsSize(); + } + } + if (this.bottomOverlay.clone) { + this.bottomOverlay.refresh(fastDraw); + } + this.leftOverlay.refresh(fastDraw); + this.topOverlay.refresh(fastDraw); + if (this.topLeftCornerOverlay) { + this.topLeftCornerOverlay.refresh(fastDraw); + } + if (this.bottomLeftCornerOverlay && this.bottomLeftCornerOverlay.clone) { + this.bottomLeftCornerOverlay.refresh(fastDraw); + } + if (this.debug) { + this.debug.refresh(fastDraw); + } + }, + adjustElementsSize: function() { + var force = arguments[0] !== (void 0) ? arguments[0] : false; + var totalColumns = this.wot.getSetting('totalColumns'); + var totalRows = this.wot.getSetting('totalRows'); + var headerRowSize = this.wot.wtViewport.getRowHeaderWidth(); + var headerColumnSize = this.wot.wtViewport.getColumnHeaderHeight(); + var hiderStyle = this.wot.wtTable.hider.style; + hiderStyle.width = (headerRowSize + this.leftOverlay.sumCellSizes(0, totalColumns)) + 'px'; + hiderStyle.height = (headerColumnSize + this.topOverlay.sumCellSizes(0, totalRows) + 1) + 'px'; + this.topOverlay.adjustElementsSize(force); + this.leftOverlay.adjustElementsSize(force); + if (this.bottomOverlay.clone) { + this.bottomOverlay.adjustElementsSize(force); + } + }, + applyToDOM: function() { + if (!this.topOverlay.areElementSizesAdjusted || !this.leftOverlay.areElementSizesAdjusted) { + this.adjustElementsSize(); + } + this.topOverlay.applyToDOM(); + if (this.bottomOverlay.clone) { + this.bottomOverlay.applyToDOM(); + } + this.leftOverlay.applyToDOM(); + } +}, {}); +; +window.WalkontableOverlays = WalkontableOverlays; + +//# +},{"eventManager":41,"helpers/dom/element":45,"helpers/unicode":53}],17:[function(require,module,exports){ +"use strict"; +Object.defineProperties(exports, { + WalkontableScroll: {get: function() { + return WalkontableScroll; + }}, + __esModule: {value: true} +}); +var WalkontableScroll = function WalkontableScroll(wotInstance) { + this.wot = wotInstance; + this.instance = wotInstance; +}; +($traceurRuntime.createClass)(WalkontableScroll, {scrollViewport: function(coords) { + if (!this.wot.drawn) { + return; + } + var totalRows = this.wot.getSetting('totalRows'); + var totalColumns = this.wot.getSetting('totalColumns'); + var fixedRowsTop = this.instance.getSetting('fixedRowsTop'); + var fixedRowsBottom = this.instance.getSetting('fixedRowsBottom'); + var fixedColumnsLeft = this.instance.getSetting('fixedColumnsLeft'); + if (coords.row < 0 || coords.row > totalRows - 1) { + throw new Error('row ' + coords.row + ' does not exist'); + } + if (coords.col < 0 || coords.col > totalColumns - 1) { + throw new Error('column ' + coords.col + ' does not exist'); + } + if (coords.row > this.instance.wtTable.getLastVisibleRow() && coords.row < totalRows - fixedRowsBottom) { + this.wot.wtOverlays.topOverlay.scrollTo(coords.row, true); + } else if (coords.row >= fixedRowsTop && coords.row < this.instance.wtTable.getFirstVisibleRow()) { + this.wot.wtOverlays.topOverlay.scrollTo(coords.row); + } + if (coords.col > this.instance.wtTable.getLastVisibleColumn()) { + this.wot.wtOverlays.leftOverlay.scrollTo(coords.col, true); + } else if (coords.col >= fixedColumnsLeft && coords.col < this.instance.wtTable.getFirstVisibleColumn()) { + this.wot.wtOverlays.leftOverlay.scrollTo(coords.col); + } + }}, {}); +; +window.WalkontableScroll = WalkontableScroll; + +//# +},{}],18:[function(require,module,exports){ +"use strict"; +Object.defineProperties(exports, { + WalkontableSelection: {get: function() { + return WalkontableSelection; + }}, + __esModule: {value: true} +}); +var $___46__46__47__46__46__47__46__46__47_helpers_47_dom_47_element__, + $__border__, + $__cell_47_coords__, + $__cell_47_range__; +var addClass = ($___46__46__47__46__46__47__46__46__47_helpers_47_dom_47_element__ = require("helpers/dom/element"), $___46__46__47__46__46__47__46__46__47_helpers_47_dom_47_element__ && $___46__46__47__46__46__47__46__46__47_helpers_47_dom_47_element__.__esModule && $___46__46__47__46__46__47__46__46__47_helpers_47_dom_47_element__ || {default: $___46__46__47__46__46__47__46__46__47_helpers_47_dom_47_element__}).addClass; +var WalkontableBorder = ($__border__ = require("border"), $__border__ && $__border__.__esModule && $__border__ || {default: $__border__}).WalkontableBorder; +var WalkontableCellCoords = ($__cell_47_coords__ = require("cell/coords"), $__cell_47_coords__ && $__cell_47_coords__.__esModule && $__cell_47_coords__ || {default: $__cell_47_coords__}).WalkontableCellCoords; +var WalkontableCellRange = ($__cell_47_range__ = require("cell/range"), $__cell_47_range__ && $__cell_47_range__.__esModule && $__cell_47_range__ || {default: $__cell_47_range__}).WalkontableCellRange; +var WalkontableSelection = function WalkontableSelection(settings, cellRange) { + this.settings = settings; + this.cellRange = cellRange || null; + this.instanceBorders = {}; +}; +($traceurRuntime.createClass)(WalkontableSelection, { + getBorder: function(wotInstance) { + if (this.instanceBorders[wotInstance.guid]) { + return this.instanceBorders[wotInstance.guid]; + } + this.instanceBorders[wotInstance.guid] = new WalkontableBorder(wotInstance, this.settings); + }, + isEmpty: function() { + return this.cellRange === null; + }, + add: function(coords) { + if (this.isEmpty()) { + this.cellRange = new WalkontableCellRange(coords, coords, coords); + } else { + this.cellRange.expand(coords); + } + }, + replace: function(oldCoords, newCoords) { + if (!this.isEmpty()) { + if (this.cellRange.from.isEqual(oldCoords)) { + this.cellRange.from = newCoords; + return true; + } + if (this.cellRange.to.isEqual(oldCoords)) { + this.cellRange.to = newCoords; + return true; + } + } + return false; + }, + clear: function() { + this.cellRange = null; + }, + getCorners: function() { + var topLeft = this.cellRange.getTopLeftCorner(); + var bottomRight = this.cellRange.getBottomRightCorner(); + return [topLeft.row, topLeft.col, bottomRight.row, bottomRight.col]; + }, + addClassAtCoords: function(wotInstance, sourceRow, sourceColumn, className) { + var TD = wotInstance.wtTable.getCell(new WalkontableCellCoords(sourceRow, sourceColumn)); + if (typeof TD === 'object') { + addClass(TD, className); + } + }, + draw: function(wotInstance) { + if (this.isEmpty()) { + if (this.settings.border) { + var border = this.getBorder(wotInstance); + if (border) { + border.disappear(); + } + } + return; + } + var renderedRows = wotInstance.wtTable.getRenderedRowsCount(); + var renderedColumns = wotInstance.wtTable.getRenderedColumnsCount(); + var corners = this.getCorners(); + var sourceRow, + sourceCol, + TH; + for (var column = 0; column < renderedColumns; column++) { + sourceCol = wotInstance.wtTable.columnFilter.renderedToSource(column); + if (sourceCol >= corners[1] && sourceCol <= corners[3]) { + TH = wotInstance.wtTable.getColumnHeader(sourceCol); + if (TH && this.settings.highlightColumnClassName) { + addClass(TH, this.settings.highlightColumnClassName); + } + } + } + for (var row = 0; row < renderedRows; row++) { + sourceRow = wotInstance.wtTable.rowFilter.renderedToSource(row); + if (sourceRow >= corners[0] && sourceRow <= corners[2]) { + TH = wotInstance.wtTable.getRowHeader(sourceRow); + if (TH && this.settings.highlightRowClassName) { + addClass(TH, this.settings.highlightRowClassName); + } + } + for (var column$__5 = 0; column$__5 < renderedColumns; column$__5++) { + sourceCol = wotInstance.wtTable.columnFilter.renderedToSource(column$__5); + if (sourceRow >= corners[0] && sourceRow <= corners[2] && sourceCol >= corners[1] && sourceCol <= corners[3]) { + if (this.settings.className) { + this.addClassAtCoords(wotInstance, sourceRow, sourceCol, this.settings.className); + } + } else if (sourceRow >= corners[0] && sourceRow <= corners[2]) { + if (this.settings.highlightRowClassName) { + this.addClassAtCoords(wotInstance, sourceRow, sourceCol, this.settings.highlightRowClassName); + } + } else if (sourceCol >= corners[1] && sourceCol <= corners[3]) { + if (this.settings.highlightColumnClassName) { + this.addClassAtCoords(wotInstance, sourceRow, sourceCol, this.settings.highlightColumnClassName); + } + } + } + } + wotInstance.getSetting('onBeforeDrawBorders', corners, this.settings.className); + if (this.settings.border) { + var border$__6 = this.getBorder(wotInstance); + if (border$__6) { + border$__6.appear(corners); + } + } + } +}, {}); +; +window.WalkontableSelection = WalkontableSelection; + +//# +},{"border":2,"cell/coords":5,"cell/range":6,"helpers/dom/element":45}],19:[function(require,module,exports){ +"use strict"; +Object.defineProperties(exports, { + WalkontableSettings: {get: function() { + return WalkontableSettings; + }}, + __esModule: {value: true} +}); +var $___46__46__47__46__46__47__46__46__47_helpers_47_dom_47_element__; +var fastInnerText = ($___46__46__47__46__46__47__46__46__47_helpers_47_dom_47_element__ = require("helpers/dom/element"), $___46__46__47__46__46__47__46__46__47_helpers_47_dom_47_element__ && $___46__46__47__46__46__47__46__46__47_helpers_47_dom_47_element__.__esModule && $___46__46__47__46__46__47__46__46__47_helpers_47_dom_47_element__ || {default: $___46__46__47__46__46__47__46__46__47_helpers_47_dom_47_element__}).fastInnerText; +var WalkontableSettings = function WalkontableSettings(wotInstance, settings) { + var $__1 = this; + this.wot = wotInstance; + this.instance = wotInstance; + this.defaults = { + table: void 0, + debug: false, + externalRowCalculator: false, + stretchH: 'none', + currentRowClassName: null, + currentColumnClassName: null, + data: void 0, + fixedColumnsLeft: 0, + fixedRowsTop: 0, + fixedRowsBottom: 0, + minSpareRows: 0, + rowHeaders: function() { + return []; + }, + columnHeaders: function() { + return []; + }, + totalRows: void 0, + totalColumns: void 0, + cellRenderer: (function(row, column, TD) { + var cellData = $__1.getSetting('data', row, column); + fastInnerText(TD, cellData === void 0 || cellData === null ? '' : cellData); + }), + columnWidth: function(col) { + return; + }, + rowHeight: function(row) { + return; + }, + defaultRowHeight: 23, + defaultColumnWidth: 50, + selections: null, + hideBorderOnMouseDownOver: false, + viewportRowCalculatorOverride: null, + viewportColumnCalculatorOverride: null, + onCellMouseDown: null, + onCellMouseOver: null, + onCellDblClick: null, + onCellCornerMouseDown: null, + onCellCornerDblClick: null, + beforeDraw: null, + onDraw: null, + onBeforeDrawBorders: null, + onScrollVertically: null, + onScrollHorizontally: null, + onBeforeTouchScroll: null, + onAfterMomentumScroll: null, + scrollbarWidth: 10, + scrollbarHeight: 10, + renderAllRows: false, + groups: false + }; + this.settings = {}; + for (var i in this.defaults) { + if (this.defaults.hasOwnProperty(i)) { + if (settings[i] !== void 0) { + this.settings[i] = settings[i]; + } else if (this.defaults[i] === void 0) { + throw new Error('A required setting "' + i + '" was not provided'); + } else { + this.settings[i] = this.defaults[i]; + } + } + } +}; +($traceurRuntime.createClass)(WalkontableSettings, { + update: function(settings, value) { + if (value === void 0) { + for (var i in settings) { + if (settings.hasOwnProperty(i)) { + this.settings[i] = settings[i]; + } + } + } else { + this.settings[settings] = value; + } + return this.wot; + }, + getSetting: function(key, param1, param2, param3, param4) { + if (typeof this.settings[key] === 'function') { + return this.settings[key](param1, param2, param3, param4); + } else if (param1 !== void 0 && Array.isArray(this.settings[key])) { + return this.settings[key][param1]; + } else { + return this.settings[key]; + } + }, + has: function(key) { + return !!this.settings[key]; + } +}, {}); +; +window.WalkontableSettings = WalkontableSettings; + +//# +},{"helpers/dom/element":45}],20:[function(require,module,exports){ +"use strict"; +Object.defineProperties(exports, { + WalkontableTable: {get: function() { + return WalkontableTable; + }}, + __esModule: {value: true} +}); +var $___46__46__47__46__46__47__46__46__47_helpers_47_dom_47_element__, + $__cell_47_coords__, + $__cell_47_range__, + $__filter_47_column__, + $__filter_47_row__, + $__tableRenderer__; +var $__0 = ($___46__46__47__46__46__47__46__46__47_helpers_47_dom_47_element__ = require("helpers/dom/element"), $___46__46__47__46__46__47__46__46__47_helpers_47_dom_47_element__ && $___46__46__47__46__46__47__46__46__47_helpers_47_dom_47_element__.__esModule && $___46__46__47__46__46__47__46__46__47_helpers_47_dom_47_element__ || {default: $___46__46__47__46__46__47__46__46__47_helpers_47_dom_47_element__}), + getStyle = $__0.getStyle, + getTrimmingContainer = $__0.getTrimmingContainer, + hasClass = $__0.hasClass, + index = $__0.index, + offset = $__0.offset, + removeClass = $__0.removeClass, + removeTextNodes = $__0.removeTextNodes, + overlayContainsElement = $__0.overlayContainsElement; +var WalkontableCellCoords = ($__cell_47_coords__ = require("cell/coords"), $__cell_47_coords__ && $__cell_47_coords__.__esModule && $__cell_47_coords__ || {default: $__cell_47_coords__}).WalkontableCellCoords; +var WalkontableCellRange = ($__cell_47_range__ = require("cell/range"), $__cell_47_range__ && $__cell_47_range__.__esModule && $__cell_47_range__ || {default: $__cell_47_range__}).WalkontableCellRange; +var WalkontableColumnFilter = ($__filter_47_column__ = require("filter/column"), $__filter_47_column__ && $__filter_47_column__.__esModule && $__filter_47_column__ || {default: $__filter_47_column__}).WalkontableColumnFilter; +var WalkontableRowFilter = ($__filter_47_row__ = require("filter/row"), $__filter_47_row__ && $__filter_47_row__.__esModule && $__filter_47_row__ || {default: $__filter_47_row__}).WalkontableRowFilter; +var WalkontableTableRenderer = ($__tableRenderer__ = require("tableRenderer"), $__tableRenderer__ && $__tableRenderer__.__esModule && $__tableRenderer__ || {default: $__tableRenderer__}).WalkontableTableRenderer; +var WalkontableTable = function WalkontableTable(wotInstance, table) { + this.wot = wotInstance; + this.instance = this.wot; + this.TABLE = table; + this.TBODY = null; + this.THEAD = null; + this.COLGROUP = null; + this.tableOffset = 0; + this.holderOffset = 0; + removeTextNodes(this.TABLE); + this.spreader = this.createSpreader(this.TABLE); + this.hider = this.createHider(this.spreader); + this.holder = this.createHolder(this.hider); + this.wtRootElement = this.holder.parentNode; + this.alignOverlaysWithTrimmingContainer(); + this.fixTableDomTree(); + this.colgroupChildrenLength = this.COLGROUP.childNodes.length; + this.theadChildrenLength = this.THEAD.firstChild ? this.THEAD.firstChild.childNodes.length : 0; + this.tbodyChildrenLength = this.TBODY.childNodes.length; + this.rowFilter = null; + this.columnFilter = null; +}; +($traceurRuntime.createClass)(WalkontableTable, { + fixTableDomTree: function() { + this.TBODY = this.TABLE.querySelector('tbody'); + if (!this.TBODY) { + this.TBODY = document.createElement('tbody'); + this.TABLE.appendChild(this.TBODY); + } + this.THEAD = this.TABLE.querySelector('thead'); + if (!this.THEAD) { + this.THEAD = document.createElement('thead'); + this.TABLE.insertBefore(this.THEAD, this.TBODY); + } + this.COLGROUP = this.TABLE.querySelector('colgroup'); + if (!this.COLGROUP) { + this.COLGROUP = document.createElement('colgroup'); + this.TABLE.insertBefore(this.COLGROUP, this.THEAD); + } + if (this.wot.getSetting('columnHeaders').length && !this.THEAD.childNodes.length) { + this.THEAD.appendChild(document.createElement('TR')); + } + }, + createSpreader: function(table) { + var parent = table.parentNode; + var spreader; + if (!parent || parent.nodeType !== 1 || !hasClass(parent, 'wtHolder')) { + spreader = document.createElement('div'); + spreader.className = 'wtSpreader'; + if (parent) { + parent.insertBefore(spreader, table); + } + spreader.appendChild(table); + } + spreader.style.position = 'relative'; + return spreader; + }, + createHider: function(spreader) { + var parent = spreader.parentNode; + var hider; + if (!parent || parent.nodeType !== 1 || !hasClass(parent, 'wtHolder')) { + hider = document.createElement('div'); + hider.className = 'wtHider'; + if (parent) { + parent.insertBefore(hider, spreader); + } + hider.appendChild(spreader); + } + return hider; + }, + createHolder: function(hider) { + var parent = hider.parentNode; + var holder; + if (!parent || parent.nodeType !== 1 || !hasClass(parent, 'wtHolder')) { + holder = document.createElement('div'); + holder.style.position = 'relative'; + holder.className = 'wtHolder'; + if (parent) { + parent.insertBefore(holder, hider); + } + if (!this.isWorkingOnClone()) { + holder.parentNode.className += 'ht_master handsontable'; + } + holder.appendChild(hider); + } + return holder; + }, + alignOverlaysWithTrimmingContainer: function() { + var trimmingElement = getTrimmingContainer(this.wtRootElement); + if (!this.isWorkingOnClone()) { + this.holder.parentNode.style.position = 'relative'; + if (trimmingElement === window) { + this.holder.style.overflow = 'visible'; + this.wtRootElement.style.overflow = 'visible'; + } else { + this.holder.style.width = getStyle(trimmingElement, 'width'); + this.holder.style.height = getStyle(trimmingElement, 'height'); + this.holder.style.overflow = ''; + } + } + }, + isWorkingOnClone: function() { + return !!this.wot.cloneSource; + }, + draw: function(fastDraw) { + var totalRows = this.instance.getSetting('totalRows'); + if (!this.isWorkingOnClone()) { + this.holderOffset = offset(this.holder); + fastDraw = this.wot.wtViewport.createRenderCalculators(fastDraw); + } + if (fastDraw) { + if (!this.isWorkingOnClone()) { + this.wot.wtViewport.createVisibleCalculators(); + } + if (this.wot.wtOverlays) { + this.wot.wtOverlays.refresh(true); + } + } else { + if (this.isWorkingOnClone()) { + this.tableOffset = this.wot.cloneSource.wtTable.tableOffset; + } else { + this.tableOffset = offset(this.TABLE); + } + var startRow; + if (WalkontableOverlay.isOverlayTypeOf(this.wot.cloneOverlay, WalkontableOverlay.CLONE_DEBUG) || WalkontableOverlay.isOverlayTypeOf(this.wot.cloneOverlay, WalkontableOverlay.CLONE_TOP) || WalkontableOverlay.isOverlayTypeOf(this.wot.cloneOverlay, WalkontableOverlay.CLONE_TOP_LEFT_CORNER)) { + startRow = 0; + } else if (WalkontableOverlay.isOverlayTypeOf(this.instance.cloneOverlay, WalkontableOverlay.CLONE_BOTTOM) || WalkontableOverlay.isOverlayTypeOf(this.instance.cloneOverlay, WalkontableOverlay.CLONE_BOTTOM_LEFT_CORNER)) { + startRow = totalRows - this.wot.getSetting('fixedRowsBottom'); + } else { + startRow = this.wot.wtViewport.rowsRenderCalculator.startRow; + } + var startColumn; + if (WalkontableOverlay.isOverlayTypeOf(this.wot.cloneOverlay, WalkontableOverlay.CLONE_DEBUG) || WalkontableOverlay.isOverlayTypeOf(this.wot.cloneOverlay, WalkontableOverlay.CLONE_LEFT) || WalkontableOverlay.isOverlayTypeOf(this.wot.cloneOverlay, WalkontableOverlay.CLONE_TOP_LEFT_CORNER) || WalkontableOverlay.isOverlayTypeOf(this.wot.cloneOverlay, WalkontableOverlay.CLONE_BOTTOM_LEFT_CORNER)) { + startColumn = 0; + } else { + startColumn = this.wot.wtViewport.columnsRenderCalculator.startColumn; + } + this.rowFilter = new WalkontableRowFilter(startRow, totalRows, this.wot.getSetting('columnHeaders').length); + this.columnFilter = new WalkontableColumnFilter(startColumn, this.wot.getSetting('totalColumns'), this.wot.getSetting('rowHeaders').length); + this._doDraw(); + this.alignOverlaysWithTrimmingContainer(); + } + this.refreshSelections(fastDraw); + if (!this.isWorkingOnClone()) { + this.wot.wtOverlays.topOverlay.resetFixedPosition(); + if (this.wot.wtOverlays.bottomOverlay.clone) { + this.wot.wtOverlays.bottomOverlay.resetFixedPosition(); + } + this.wot.wtOverlays.leftOverlay.resetFixedPosition(); + if (this.wot.wtOverlays.topLeftCornerOverlay) { + this.wot.wtOverlays.topLeftCornerOverlay.resetFixedPosition(); + } + if (this.instance.wtOverlays.bottomLeftCornerOverlay && this.instance.wtOverlays.bottomLeftCornerOverlay.clone) { + this.wot.wtOverlays.bottomLeftCornerOverlay.resetFixedPosition(); + } + } + this.wot.drawn = true; + return this; + }, + _doDraw: function() { + var wtRenderer = new WalkontableTableRenderer(this); + wtRenderer.render(); + }, + removeClassFromCells: function(className) { + var nodes = this.TABLE.querySelectorAll('.' + className); + for (var i = 0, + len = nodes.length; i < len; i++) { + removeClass(nodes[i], className); + } + }, + refreshSelections: function(fastDraw) { + if (!this.wot.selections) { + return; + } + var len = this.wot.selections.length; + if (fastDraw) { + for (var i = 0; i < len; i++) { + if (this.wot.selections[i].settings.className) { + this.removeClassFromCells(this.wot.selections[i].settings.className); + } + if (this.wot.selections[i].settings.highlightRowClassName) { + this.removeClassFromCells(this.wot.selections[i].settings.highlightRowClassName); + } + if (this.wot.selections[i].settings.highlightColumnClassName) { + this.removeClassFromCells(this.wot.selections[i].settings.highlightColumnClassName); + } + } + } + for (var i$__7 = 0; i$__7 < len; i$__7++) { + this.wot.selections[i$__7].draw(this.wot, fastDraw); + } + }, + getCell: function(coords) { + if (this.isRowBeforeRenderedRows(coords.row)) { + return -1; + } else if (this.isRowAfterRenderedRows(coords.row)) { + return -2; + } + var TR = this.TBODY.childNodes[this.rowFilter.sourceToRendered(coords.row)]; + if (TR) { + return TR.childNodes[this.columnFilter.sourceColumnToVisibleRowHeadedColumn(coords.col)]; + } + }, + getColumnHeader: function(col) { + var level = arguments[1] !== (void 0) ? arguments[1] : 0; + var TR = this.THEAD.childNodes[level]; + if (TR) { + return TR.childNodes[this.columnFilter.sourceColumnToVisibleRowHeadedColumn(col)]; + } + }, + getRowHeader: function(row) { + if (this.columnFilter.sourceColumnToVisibleRowHeadedColumn(0) === 0) { + return null; + } + var TR = this.TBODY.childNodes[this.rowFilter.sourceToRendered(row)]; + if (TR) { + return TR.childNodes[0]; + } + }, + getCoords: function(TD) { + var TR = TD.parentNode; + var row = index(TR); + if (TR.parentNode === this.THEAD) { + row = this.rowFilter.visibleColHeadedRowToSourceRow(row); + } else { + row = this.rowFilter.renderedToSource(row); + } + var col = this.columnFilter.visibleRowHeadedColumnToSourceColumn(TD.cellIndex); + return new WalkontableCellCoords(row, col); + }, + getTrForRow: function(row) { + return this.TBODY.childNodes[this.rowFilter.sourceToRendered(row)]; + }, + getFirstRenderedRow: function() { + return this.wot.wtViewport.rowsRenderCalculator.startRow; + }, + getFirstVisibleRow: function() { + return this.wot.wtViewport.rowsVisibleCalculator.startRow; + }, + getFirstRenderedColumn: function() { + return this.wot.wtViewport.columnsRenderCalculator.startColumn; + }, + getFirstVisibleColumn: function() { + return this.wot.wtViewport.columnsVisibleCalculator.startColumn; + }, + getLastRenderedRow: function() { + return this.wot.wtViewport.rowsRenderCalculator.endRow; + }, + getLastVisibleRow: function() { + return this.wot.wtViewport.rowsVisibleCalculator.endRow; + }, + getLastRenderedColumn: function() { + return this.wot.wtViewport.columnsRenderCalculator.endColumn; + }, + getLastVisibleColumn: function() { + return this.wot.wtViewport.columnsVisibleCalculator.endColumn; + }, + isRowBeforeRenderedRows: function(row) { + return (this.rowFilter.sourceToRendered(row) < 0 && row >= 0); + }, + isRowAfterViewport: function(row) { + return (this.rowFilter.sourceToRendered(row) > this.getLastVisibleRow()); + }, + isRowAfterRenderedRows: function(row) { + return (this.rowFilter.sourceToRendered(row) > this.getLastRenderedRow()); + }, + isColumnBeforeViewport: function(column) { + return this.columnFilter.sourceToRendered(column) < 0 && column >= 0; + }, + isColumnAfterViewport: function(column) { + return (this.columnFilter.sourceToRendered(column) > this.getLastVisibleColumn()); + }, + isLastRowFullyVisible: function() { + return this.getLastVisibleRow() === this.getLastRenderedRow(); + }, + isLastColumnFullyVisible: function() { + return this.getLastVisibleColumn() === this.getLastRenderedColumn(); + }, + getRenderedColumnsCount: function() { + if (WalkontableOverlay.isOverlayTypeOf(this.wot.cloneOverlay, WalkontableOverlay.CLONE_DEBUG)) { + return this.wot.getSetting('totalColumns'); + } else if (WalkontableOverlay.isOverlayTypeOf(this.wot.cloneOverlay, WalkontableOverlay.CLONE_LEFT) || WalkontableOverlay.isOverlayTypeOf(this.wot.cloneOverlay, WalkontableOverlay.CLONE_TOP_LEFT_CORNER) || WalkontableOverlay.isOverlayTypeOf(this.wot.cloneOverlay, WalkontableOverlay.CLONE_BOTTOM_LEFT_CORNER)) { + return this.wot.getSetting('fixedColumnsLeft'); + } else { + return this.wot.wtViewport.columnsRenderCalculator.count; + } + }, + getRenderedRowsCount: function() { + if (WalkontableOverlay.isOverlayTypeOf(this.wot.cloneOverlay, WalkontableOverlay.CLONE_DEBUG)) { + return this.wot.getSetting('totalRows'); + } else if (WalkontableOverlay.isOverlayTypeOf(this.wot.cloneOverlay, WalkontableOverlay.CLONE_TOP) || WalkontableOverlay.isOverlayTypeOf(this.wot.cloneOverlay, WalkontableOverlay.CLONE_TOP_LEFT_CORNER)) { + return this.wot.getSetting('fixedRowsTop'); + } else if (WalkontableOverlay.isOverlayTypeOf(this.wot.cloneOverlay, WalkontableOverlay.CLONE_BOTTOM) || WalkontableOverlay.isOverlayTypeOf(this.wot.cloneOverlay, WalkontableOverlay.CLONE_BOTTOM_LEFT_CORNER)) { + return this.instance.getSetting('fixedRowsBottom'); + } + return this.wot.wtViewport.rowsRenderCalculator.count; + }, + getVisibleRowsCount: function() { + return this.wot.wtViewport.rowsVisibleCalculator.count; + }, + allRowsInViewport: function() { + return this.wot.getSetting('totalRows') == this.getVisibleRowsCount(); + }, + getRowHeight: function(sourceRow) { + var height = this.wot.wtSettings.settings.rowHeight(sourceRow); + var oversizedHeight = this.wot.wtViewport.oversizedRows[sourceRow]; + if (oversizedHeight !== void 0) { + height = height === void 0 ? oversizedHeight : Math.max(height, oversizedHeight); + } + return height; + }, + getColumnHeaderHeight: function(level) { + var height = this.wot.wtSettings.settings.defaultRowHeight; + var oversizedHeight = this.wot.wtViewport.oversizedColumnHeaders[level]; + if (oversizedHeight !== void 0) { + height = height ? Math.max(height, oversizedHeight) : oversizedHeight; + } + return height; + }, + getVisibleColumnsCount: function() { + return this.wot.wtViewport.columnsVisibleCalculator.count; + }, + allColumnsInViewport: function() { + return this.wot.getSetting('totalColumns') == this.getVisibleColumnsCount(); + }, + getColumnWidth: function(sourceColumn) { + var width = this.wot.wtSettings.settings.columnWidth; + if (typeof width === 'function') { + width = width(sourceColumn); + } else if (typeof width === 'object') { + width = width[sourceColumn]; + } + return width || this.wot.wtSettings.settings.defaultColumnWidth; + }, + getStretchedColumnWidth: function(sourceColumn) { + var columnWidth = this.getColumnWidth(sourceColumn); + var width = [void 0, null].indexOf(columnWidth) === -1 ? columnWidth : this.instance.wtSettings.settings.defaultColumnWidth; + var calculator = this.wot.wtViewport.columnsRenderCalculator; + if (calculator) { + var stretchedWidth = calculator.getStretchedColumnWidth(sourceColumn, width); + if (stretchedWidth) { + width = stretchedWidth; + } + } + return width; + } +}, {}); +; +window.WalkontableTable = WalkontableTable; + +//# +},{"cell/coords":5,"cell/range":6,"filter/column":9,"filter/row":10,"helpers/dom/element":45,"tableRenderer":21}],21:[function(require,module,exports){ +"use strict"; +Object.defineProperties(exports, { + WalkontableTableRenderer: {get: function() { + return WalkontableTableRenderer; + }}, + __esModule: {value: true} +}); +var $___46__46__47__46__46__47__46__46__47_helpers_47_dom_47_element__; +var $__0 = ($___46__46__47__46__46__47__46__46__47_helpers_47_dom_47_element__ = require("helpers/dom/element"), $___46__46__47__46__46__47__46__46__47_helpers_47_dom_47_element__ && $___46__46__47__46__46__47__46__46__47_helpers_47_dom_47_element__.__esModule && $___46__46__47__46__46__47__46__46__47_helpers_47_dom_47_element__ || {default: $___46__46__47__46__46__47__46__46__47_helpers_47_dom_47_element__}), + addClass = $__0.addClass, + empty = $__0.empty, + getScrollbarWidth = $__0.getScrollbarWidth, + hasClass = $__0.hasClass, + innerHeight = $__0.innerHeight; +var WalkontableTableRenderer = function WalkontableTableRenderer(wtTable) { + this.wtTable = wtTable; + this.wot = wtTable.instance; + this.instance = wtTable.instance; + this.rowFilter = wtTable.rowFilter; + this.columnFilter = wtTable.columnFilter; + this.TABLE = wtTable.TABLE; + this.THEAD = wtTable.THEAD; + this.TBODY = wtTable.TBODY; + this.COLGROUP = wtTable.COLGROUP; + this.rowHeaders = []; + this.rowHeaderCount = 0; + this.columnHeaders = []; + this.columnHeaderCount = 0; + this.fixedRowsTop = 0; + this.fixedRowsBottom = 0; +}; +($traceurRuntime.createClass)(WalkontableTableRenderer, { + render: function() { + if (!this.wtTable.isWorkingOnClone()) { + this.wot.getSetting('beforeDraw', true); + } + this.rowHeaders = this.wot.getSetting('rowHeaders'); + this.rowHeaderCount = this.rowHeaders.length; + this.fixedRowsTop = this.wot.getSetting('fixedRowsTop'); + this.fixedRowsBottom = this.wot.getSetting('fixedRowsBottom'); + this.columnHeaders = this.wot.getSetting('columnHeaders'); + this.columnHeaderCount = this.columnHeaders.length; + var columnsToRender = this.wtTable.getRenderedColumnsCount(); + var rowsToRender = this.wtTable.getRenderedRowsCount(); + var totalColumns = this.wot.getSetting('totalColumns'); + var totalRows = this.wot.getSetting('totalRows'); + var workspaceWidth; + var adjusted = false; + if (WalkontableOverlay.isOverlayTypeOf(this.wot.cloneOverlay, WalkontableOverlay.CLONE_BOTTOM) || WalkontableOverlay.isOverlayTypeOf(this.wot.cloneOverlay, WalkontableOverlay.CLONE_BOTTOM_LEFT_CORNER)) { + this.columnHeaders = []; + this.columnHeaderCount = 0; + } + if (totalColumns > 0) { + this.adjustAvailableNodes(); + adjusted = true; + this.renderColumnHeaders(); + this.renderRows(totalRows, rowsToRender, columnsToRender); + if (!this.wtTable.isWorkingOnClone()) { + workspaceWidth = this.wot.wtViewport.getWorkspaceWidth(); + this.wot.wtViewport.containerWidth = null; + } + this.adjustColumnHeaderHeights(); + this.adjustColumnWidths(columnsToRender); + this.markOversizedColumns(); + } + if (!adjusted) { + this.adjustAvailableNodes(); + } + this.removeRedundantRows(rowsToRender); + if (!this.wtTable.isWorkingOnClone()) { + this.markOversizedRows(); + this.wot.wtViewport.createVisibleCalculators(); + this.wot.wtOverlays.refresh(false); + this.wot.wtOverlays.applyToDOM(); + if (workspaceWidth !== this.wot.wtViewport.getWorkspaceWidth()) { + this.wot.wtViewport.containerWidth = null; + var firstRendered = this.wtTable.getFirstRenderedColumn(); + var lastRendered = this.wtTable.getLastRenderedColumn(); + for (var i = firstRendered; i < lastRendered; i++) { + var width = this.wtTable.getStretchedColumnWidth(i); + var renderedIndex = this.columnFilter.sourceToRendered(i); + this.COLGROUP.childNodes[renderedIndex + this.rowHeaderCount].style.width = width + 'px'; + } + } + this.wot.getSetting('onDraw', true); + } else if (WalkontableOverlay.isOverlayTypeOf(this.wot.cloneOverlay, WalkontableOverlay.CLONE_BOTTOM)) { + var masterOverlay = this.wot.cloneOverlay.instance; + this.wot.cloneOverlay.markOversizedFixedBottomRows(); + masterOverlay.wtOverlays.adjustElementsSize(); + } + }, + removeRedundantRows: function(renderedRowsCount) { + while (this.wtTable.tbodyChildrenLength > renderedRowsCount) { + this.TBODY.removeChild(this.TBODY.lastChild); + this.wtTable.tbodyChildrenLength--; + } + }, + renderRows: function(totalRows, rowsToRender, columnsToRender) { + var lastTD, + TR; + var visibleRowIndex = 0; + var sourceRowIndex = this.rowFilter.renderedToSource(visibleRowIndex); + var isWorkingOnClone = this.wtTable.isWorkingOnClone(); + while (sourceRowIndex < totalRows && sourceRowIndex >= 0) { + if (visibleRowIndex > 1000) { + console.error('Security brake: Too much TRs. Please define height for your table, which will enforce scrollbars.'); + } + if (rowsToRender !== void 0 && visibleRowIndex === rowsToRender) { + break; + } + TR = this.getOrCreateTrForRow(visibleRowIndex, TR); + this.renderRowHeaders(sourceRowIndex, TR); + this.adjustColumns(TR, columnsToRender + this.rowHeaderCount); + lastTD = this.renderCells(sourceRowIndex, TR, columnsToRender); + if (!isWorkingOnClone || WalkontableOverlay.isOverlayTypeOf(this.wot.cloneOverlay, WalkontableOverlay.CLONE_BOTTOM)) { + this.resetOversizedRow(sourceRowIndex); + } + if (TR.firstChild) { + var height = this.wot.wtTable.getRowHeight(sourceRowIndex); + if (height) { + height--; + TR.firstChild.style.height = height + 'px'; + } else { + TR.firstChild.style.height = ''; + } + } + visibleRowIndex++; + sourceRowIndex = this.rowFilter.renderedToSource(visibleRowIndex); + } + }, + resetOversizedRow: function(sourceRow) { + if (this.wot.getSetting('externalRowCalculator')) { + return; + } + if (this.wot.wtViewport.oversizedRows && this.wot.wtViewport.oversizedRows[sourceRow]) { + this.wot.wtViewport.oversizedRows[sourceRow] = void 0; + } + }, + markOversizedRows: function() { + if (this.wot.getSetting('externalRowCalculator')) { + return; + } + var rowCount = this.instance.wtTable.TBODY.childNodes.length; + var expectedTableHeight = rowCount * this.instance.wtSettings.settings.defaultRowHeight; + var actualTableHeight = innerHeight(this.instance.wtTable.TBODY) - 1; + var previousRowHeight; + var rowInnerHeight; + var sourceRowIndex; + var currentTr; + var rowHeader; + var totalRows = this.instance.getSetting('totalRows'); + if (expectedTableHeight === actualTableHeight && !this.instance.getSetting('fixedRowsBottom')) { + return; + } + while (rowCount) { + rowCount--; + sourceRowIndex = this.instance.wtTable.rowFilter.renderedToSource(rowCount); + previousRowHeight = this.instance.wtTable.getRowHeight(sourceRowIndex); + currentTr = this.instance.wtTable.getTrForRow(sourceRowIndex); + rowHeader = currentTr.querySelector('th'); + if (rowHeader) { + rowInnerHeight = innerHeight(rowHeader); + } else { + rowInnerHeight = innerHeight(currentTr) - 1; + } + if ((!previousRowHeight && this.instance.wtSettings.settings.defaultRowHeight < rowInnerHeight || previousRowHeight < rowInnerHeight)) { + this.instance.wtViewport.oversizedRows[sourceRowIndex] = ++rowInnerHeight; + } + } + }, + markOversizedColumns: function() { + var overlayName = this.wot.getOverlayName(); + if (!this.columnHeaderCount || this.wot.wtViewport.isMarkedOversizedColumn[overlayName] || this.wtTable.isWorkingOnClone()) { + return; + } + var columnCount = this.wtTable.getRenderedColumnsCount(); + for (var i = 0; i < this.columnHeaderCount; i++) { + for (var renderedColumnIndex = (-1) * this.rowHeaderCount; renderedColumnIndex < columnCount; renderedColumnIndex++) { + this.markIfOversizedColumnHeader(renderedColumnIndex); + } + } + this.wot.wtViewport.isMarkedOversizedColumn[overlayName] = true; + }, + adjustColumnHeaderHeights: function() { + var columnHeaders = this.wot.getSetting('columnHeaders'); + var childs = this.wot.wtTable.THEAD.childNodes; + var oversizedCols = this.wot.wtViewport.oversizedColumnHeaders; + for (var i = 0, + len = columnHeaders.length; i < len; i++) { + if (oversizedCols[i]) { + if (childs[i].childNodes.length === 0) { + return; + } + childs[i].childNodes[0].style.height = oversizedCols[i] + 'px'; + } + } + }, + markIfOversizedColumnHeader: function(col) { + var sourceColIndex = this.wot.wtTable.columnFilter.renderedToSource(col); + var level = this.columnHeaderCount; + var defaultRowHeight = this.wot.wtSettings.settings.defaultRowHeight; + var previousColHeaderHeight; + var currentHeader; + var currentHeaderHeight; + while (level) { + level--; + previousColHeaderHeight = this.wot.wtTable.getColumnHeaderHeight(level); + currentHeader = this.wot.wtTable.getColumnHeader(sourceColIndex, level); + if (!currentHeader) { + continue; + } + currentHeaderHeight = innerHeight(currentHeader); + if (!previousColHeaderHeight && defaultRowHeight < currentHeaderHeight || previousColHeaderHeight < currentHeaderHeight) { + this.wot.wtViewport.oversizedColumnHeaders[level] = currentHeaderHeight; + } + } + }, + renderCells: function(sourceRowIndex, TR, columnsToRender) { + var TD; + var sourceColIndex; + for (var visibleColIndex = 0; visibleColIndex < columnsToRender; visibleColIndex++) { + sourceColIndex = this.columnFilter.renderedToSource(visibleColIndex); + if (visibleColIndex === 0) { + TD = TR.childNodes[this.columnFilter.sourceColumnToVisibleRowHeadedColumn(sourceColIndex)]; + } else { + TD = TD.nextSibling; + } + if (TD.nodeName == 'TH') { + TD = replaceThWithTd(TD, TR); + } + if (!hasClass(TD, 'hide')) { + TD.className = ''; + } + TD.removeAttribute('style'); + this.wot.wtSettings.settings.cellRenderer(sourceRowIndex, sourceColIndex, TD); + } + return TD; + }, + adjustColumnWidths: function(columnsToRender) { + var scrollbarCompensation = 0; + var sourceInstance = this.wot.cloneSource ? this.wot.cloneSource : this.wot; + var mainHolder = sourceInstance.wtTable.holder; + if (mainHolder.offsetHeight < mainHolder.scrollHeight) { + scrollbarCompensation = getScrollbarWidth(); + } + this.wot.wtViewport.columnsRenderCalculator.refreshStretching(this.wot.wtViewport.getViewportWidth() - scrollbarCompensation); + for (var renderedColIndex = 0; renderedColIndex < columnsToRender; renderedColIndex++) { + var width = this.wtTable.getStretchedColumnWidth(this.columnFilter.renderedToSource(renderedColIndex)); + this.COLGROUP.childNodes[renderedColIndex + this.rowHeaderCount].style.width = width + 'px'; + } + }, + appendToTbody: function(TR) { + this.TBODY.appendChild(TR); + this.wtTable.tbodyChildrenLength++; + }, + getOrCreateTrForRow: function(rowIndex, currentTr) { + var TR; + if (rowIndex >= this.wtTable.tbodyChildrenLength) { + TR = this.createRow(); + this.appendToTbody(TR); + } else if (rowIndex === 0) { + TR = this.TBODY.firstChild; + } else { + TR = currentTr.nextSibling; + } + if (TR.className) { + TR.removeAttribute('class'); + } + return TR; + }, + createRow: function() { + var TR = document.createElement('TR'); + for (var visibleColIndex = 0; visibleColIndex < this.rowHeaderCount; visibleColIndex++) { + TR.appendChild(document.createElement('TH')); + } + return TR; + }, + renderRowHeader: function(row, col, TH) { + TH.className = ''; + TH.removeAttribute('style'); + this.rowHeaders[col](row, TH, col); + }, + renderRowHeaders: function(row, TR) { + for (var TH = TR.firstChild, + visibleColIndex = 0; visibleColIndex < this.rowHeaderCount; visibleColIndex++) { + if (!TH) { + TH = document.createElement('TH'); + TR.appendChild(TH); + } else if (TH.nodeName == 'TD') { + TH = replaceTdWithTh(TH, TR); + } + this.renderRowHeader(row, visibleColIndex, TH); + TH = TH.nextSibling; + } + }, + adjustAvailableNodes: function() { + this.adjustColGroups(); + this.adjustThead(); + }, + renderColumnHeaders: function() { + var overlayName = this.wot.getOverlayName(); + if (!this.columnHeaderCount) { + return; + } + var columnCount = this.wtTable.getRenderedColumnsCount(); + for (var i = 0; i < this.columnHeaderCount; i++) { + var TR = this.getTrForColumnHeaders(i); + for (var renderedColumnIndex = (-1) * this.rowHeaderCount; renderedColumnIndex < columnCount; renderedColumnIndex++) { + var sourceCol = this.columnFilter.renderedToSource(renderedColumnIndex); + this.renderColumnHeader(i, sourceCol, TR.childNodes[renderedColumnIndex + this.rowHeaderCount]); + } + } + }, + adjustColGroups: function() { + var columnCount = this.wtTable.getRenderedColumnsCount(); + while (this.wtTable.colgroupChildrenLength < columnCount + this.rowHeaderCount) { + this.COLGROUP.appendChild(document.createElement('COL')); + this.wtTable.colgroupChildrenLength++; + } + while (this.wtTable.colgroupChildrenLength > columnCount + this.rowHeaderCount) { + this.COLGROUP.removeChild(this.COLGROUP.lastChild); + this.wtTable.colgroupChildrenLength--; + } + if (this.rowHeaderCount) { + addClass(this.COLGROUP.childNodes[0], 'rowHeader'); + } + }, + adjustThead: function() { + var columnCount = this.wtTable.getRenderedColumnsCount(); + var TR = this.THEAD.firstChild; + if (this.columnHeaders.length) { + for (var i = 0, + len = this.columnHeaders.length; i < len; i++) { + TR = this.THEAD.childNodes[i]; + if (!TR) { + TR = document.createElement('TR'); + this.THEAD.appendChild(TR); + } + this.theadChildrenLength = TR.childNodes.length; + while (this.theadChildrenLength < columnCount + this.rowHeaderCount) { + TR.appendChild(document.createElement('TH')); + this.theadChildrenLength++; + } + while (this.theadChildrenLength > columnCount + this.rowHeaderCount) { + TR.removeChild(TR.lastChild); + this.theadChildrenLength--; + } + } + var theadChildrenLength = this.THEAD.childNodes.length; + if (theadChildrenLength > this.columnHeaders.length) { + for (var i$__2 = this.columnHeaders.length; i$__2 < theadChildrenLength; i$__2++) { + this.THEAD.removeChild(this.THEAD.lastChild); + } + } + } else if (TR) { + empty(TR); + } + }, + getTrForColumnHeaders: function(index) { + return this.THEAD.childNodes[index]; + }, + renderColumnHeader: function(row, col, TH) { + TH.className = ''; + TH.removeAttribute('style'); + return this.columnHeaders[row](col, TH, row); + }, + adjustColumns: function(TR, desiredCount) { + var count = TR.childNodes.length; + while (count < desiredCount) { + var TD = document.createElement('TD'); + TR.appendChild(TD); + count++; + } + while (count > desiredCount) { + TR.removeChild(TR.lastChild); + count--; + } + }, + removeRedundantColumns: function(columnsToRender) { + while (this.wtTable.tbodyChildrenLength > columnsToRender) { + this.TBODY.removeChild(this.TBODY.lastChild); + this.wtTable.tbodyChildrenLength--; + } + } +}, {}); +function replaceTdWithTh(TD, TR) { + var TH = document.createElement('TH'); + TR.insertBefore(TH, TD); + TR.removeChild(TD); + return TH; +} +function replaceThWithTd(TH, TR) { + var TD = document.createElement('TD'); + TR.insertBefore(TD, TH); + TR.removeChild(TH); + return TD; +} +; +window.WalkontableTableRenderer = WalkontableTableRenderer; + +//# +},{"helpers/dom/element":45}],22:[function(require,module,exports){ +"use strict"; +Object.defineProperties(exports, { + WalkontableViewport: {get: function() { + return WalkontableViewport; + }}, + __esModule: {value: true} +}); +var $___46__46__47__46__46__47__46__46__47_helpers_47_dom_47_element__, + $___46__46__47__46__46__47__46__46__47_eventManager__, + $__calculator_47_viewportColumns__, + $__calculator_47_viewportRows__; +var $__0 = ($___46__46__47__46__46__47__46__46__47_helpers_47_dom_47_element__ = require("helpers/dom/element"), $___46__46__47__46__46__47__46__46__47_helpers_47_dom_47_element__ && $___46__46__47__46__46__47__46__46__47_helpers_47_dom_47_element__.__esModule && $___46__46__47__46__46__47__46__46__47_helpers_47_dom_47_element__ || {default: $___46__46__47__46__46__47__46__46__47_helpers_47_dom_47_element__}), + getScrollbarWidth = $__0.getScrollbarWidth, + getScrollTop = $__0.getScrollTop, + getStyle = $__0.getStyle, + offset = $__0.offset, + outerHeight = $__0.outerHeight, + outerWidth = $__0.outerWidth; +var EventManager = ($___46__46__47__46__46__47__46__46__47_eventManager__ = require("eventManager"), $___46__46__47__46__46__47__46__46__47_eventManager__ && $___46__46__47__46__46__47__46__46__47_eventManager__.__esModule && $___46__46__47__46__46__47__46__46__47_eventManager__ || {default: $___46__46__47__46__46__47__46__46__47_eventManager__}).EventManager; +var WalkontableViewportColumnsCalculator = ($__calculator_47_viewportColumns__ = require("calculator/viewportColumns"), $__calculator_47_viewportColumns__ && $__calculator_47_viewportColumns__.__esModule && $__calculator_47_viewportColumns__ || {default: $__calculator_47_viewportColumns__}).WalkontableViewportColumnsCalculator; +var WalkontableViewportRowsCalculator = ($__calculator_47_viewportRows__ = require("calculator/viewportRows"), $__calculator_47_viewportRows__ && $__calculator_47_viewportRows__.__esModule && $__calculator_47_viewportRows__ || {default: $__calculator_47_viewportRows__}).WalkontableViewportRowsCalculator; +var WalkontableViewport = function WalkontableViewport(wotInstance) { + var $__4 = this; + this.wot = wotInstance; + this.instance = this.wot; + this.oversizedRows = []; + this.oversizedColumnHeaders = []; + this.isMarkedOversizedColumn = {}; + this.clientHeight = 0; + this.containerWidth = NaN; + this.rowHeaderWidth = NaN; + this.rowsVisibleCalculator = null; + this.columnsVisibleCalculator = null; + this.eventManager = new EventManager(this.wot); + this.eventManager.addEventListener(window, 'resize', (function() { + $__4.clientHeight = $__4.getWorkspaceHeight(); + })); +}; +($traceurRuntime.createClass)(WalkontableViewport, { + getWorkspaceHeight: function() { + var trimmingContainer = this.instance.wtOverlays.topOverlay.trimmingContainer; + var elemHeight; + var height = 0; + if (trimmingContainer === window) { + height = document.documentElement.clientHeight; + } else { + elemHeight = outerHeight(trimmingContainer); + height = (elemHeight > 0 && trimmingContainer.clientHeight > 0) ? trimmingContainer.clientHeight : Infinity; + } + return height; + }, + getWorkspaceWidth: function() { + var width; + var totalColumns = this.instance.getSetting('totalColumns'); + var trimmingContainer = this.instance.wtOverlays.leftOverlay.trimmingContainer; + var overflow; + var stretchSetting = this.instance.getSetting('stretchH'); + var docOffsetWidth = document.documentElement.offsetWidth; + if (Handsontable.freezeOverlays) { + width = Math.min(docOffsetWidth - this.getWorkspaceOffset().left, docOffsetWidth); + } else { + width = Math.min(this.getContainerFillWidth(), docOffsetWidth - this.getWorkspaceOffset().left, docOffsetWidth); + } + if (trimmingContainer === window && totalColumns > 0 && this.sumColumnWidths(0, totalColumns - 1) > width) { + return document.documentElement.clientWidth; + } + if (trimmingContainer !== window) { + overflow = getStyle(this.instance.wtOverlays.leftOverlay.trimmingContainer, 'overflow'); + if (overflow == 'scroll' || overflow == 'hidden' || overflow == 'auto') { + return Math.max(width, trimmingContainer.clientWidth); + } + } + if (stretchSetting === 'none' || !stretchSetting) { + return Math.max(width, outerWidth(this.instance.wtTable.TABLE)); + } else { + return width; + } + }, + hasVerticalScroll: function() { + return this.getWorkspaceActualHeight() > this.getWorkspaceHeight(); + }, + hasHorizontalScroll: function() { + return this.getWorkspaceActualWidth() > this.getWorkspaceWidth(); + }, + sumColumnWidths: function(from, length) { + var sum = 0; + while (from < length) { + sum += this.wot.wtTable.getColumnWidth(from); + from++; + } + return sum; + }, + getContainerFillWidth: function() { + if (this.containerWidth) { + return this.containerWidth; + } + var mainContainer = this.instance.wtTable.holder; + var fillWidth; + var dummyElement; + dummyElement = document.createElement('div'); + dummyElement.style.width = '100%'; + dummyElement.style.height = '1px'; + mainContainer.appendChild(dummyElement); + fillWidth = dummyElement.offsetWidth; + this.containerWidth = fillWidth; + mainContainer.removeChild(dummyElement); + return fillWidth; + }, + getWorkspaceOffset: function() { + return offset(this.wot.wtTable.TABLE); + }, + getWorkspaceActualHeight: function() { + return outerHeight(this.wot.wtTable.TABLE); + }, + getWorkspaceActualWidth: function() { + return outerWidth(this.wot.wtTable.TABLE) || outerWidth(this.wot.wtTable.TBODY) || outerWidth(this.wot.wtTable.THEAD); + }, + getColumnHeaderHeight: function() { + if (isNaN(this.columnHeaderHeight)) { + this.columnHeaderHeight = outerHeight(this.wot.wtTable.THEAD); + } + return this.columnHeaderHeight; + }, + getViewportHeight: function() { + var containerHeight = this.getWorkspaceHeight(); + var columnHeaderHeight; + if (containerHeight === Infinity) { + return containerHeight; + } + columnHeaderHeight = this.getColumnHeaderHeight(); + if (columnHeaderHeight > 0) { + containerHeight -= columnHeaderHeight; + } + return containerHeight; + }, + getRowHeaderWidth: function() { + if (this.wot.cloneSource) { + return this.wot.cloneSource.wtViewport.getRowHeaderWidth(); + } + if (isNaN(this.rowHeaderWidth)) { + var rowHeaders = this.instance.getSetting('rowHeaders'); + if (rowHeaders.length) { + var TH = this.instance.wtTable.TABLE.querySelector('TH'); + this.rowHeaderWidth = 0; + for (var i = 0, + len = rowHeaders.length; i < len; i++) { + if (TH) { + this.rowHeaderWidth += outerWidth(TH); + TH = TH.nextSibling; + } else { + this.rowHeaderWidth += 50; + } + } + } else { + this.rowHeaderWidth = 0; + } + } + return this.rowHeaderWidth; + }, + getViewportWidth: function() { + var containerWidth = this.getWorkspaceWidth(); + var rowHeaderWidth; + if (containerWidth === Infinity) { + return containerWidth; + } + rowHeaderWidth = this.getRowHeaderWidth(); + if (rowHeaderWidth > 0) { + return containerWidth - rowHeaderWidth; + } + return containerWidth; + }, + createRowsCalculator: function() { + var visible = arguments[0] !== (void 0) ? arguments[0] : false; + var $__4 = this; + var height; + var pos; + var fixedRowsTop; + var scrollbarHeight; + var fixedRowsBottom; + var fixedRowsHeight; + var totalRows; + this.rowHeaderWidth = NaN; + if (this.wot.wtSettings.settings.renderAllRows) { + height = Infinity; + } else { + height = this.getViewportHeight(); + } + pos = getScrollTop(this.wot.wtOverlays.mainTableScrollableElement) - this.wot.wtOverlays.topOverlay.getTableParentOffset(); + if (pos < 0) { + pos = 0; + } + fixedRowsTop = this.wot.getSetting('fixedRowsTop'); + fixedRowsBottom = this.wot.getSetting('fixedRowsBottom'); + totalRows = this.wot.getSetting('totalRows'); + if (fixedRowsTop) { + fixedRowsHeight = this.wot.wtOverlays.topOverlay.sumCellSizes(0, fixedRowsTop); + pos += fixedRowsHeight; + height -= fixedRowsHeight; + } + if (fixedRowsBottom && this.wot.wtOverlays.bottomOverlay.clone) { + fixedRowsHeight = this.wot.wtOverlays.bottomOverlay.sumCellSizes(totalRows - fixedRowsBottom, totalRows); + height -= fixedRowsHeight; + } + if (this.wot.wtTable.holder.clientHeight === this.wot.wtTable.holder.offsetHeight) { + scrollbarHeight = 0; + } else { + scrollbarHeight = getScrollbarWidth(); + } + return new WalkontableViewportRowsCalculator(height, pos, this.wot.getSetting('totalRows'), (function(sourceRow) { + return $__4.wot.wtTable.getRowHeight(sourceRow); + }), visible ? null : this.wot.wtSettings.settings.viewportRowCalculatorOverride, visible, scrollbarHeight); + }, + createColumnsCalculator: function() { + var visible = arguments[0] !== (void 0) ? arguments[0] : false; + var $__4 = this; + var width = this.getViewportWidth(); + var pos; + var fixedColumnsLeft; + this.columnHeaderHeight = NaN; + pos = this.wot.wtOverlays.leftOverlay.getScrollPosition() - this.wot.wtOverlays.leftOverlay.getTableParentOffset(); + if (pos < 0) { + pos = 0; + } + fixedColumnsLeft = this.wot.getSetting('fixedColumnsLeft'); + if (fixedColumnsLeft) { + var fixedColumnsWidth = this.wot.wtOverlays.leftOverlay.sumCellSizes(0, fixedColumnsLeft); + pos += fixedColumnsWidth; + width -= fixedColumnsWidth; + } + if (this.wot.wtTable.holder.clientWidth !== this.wot.wtTable.holder.offsetWidth) { + width -= getScrollbarWidth(); + } + return new WalkontableViewportColumnsCalculator(width, pos, this.wot.getSetting('totalColumns'), (function(sourceCol) { + return $__4.wot.wtTable.getColumnWidth(sourceCol); + }), visible ? null : this.wot.wtSettings.settings.viewportColumnCalculatorOverride, visible, this.wot.getSetting('stretchH')); + }, + createRenderCalculators: function() { + var fastDraw = arguments[0] !== (void 0) ? arguments[0] : false; + if (fastDraw) { + var proposedRowsVisibleCalculator = this.createRowsCalculator(true); + var proposedColumnsVisibleCalculator = this.createColumnsCalculator(true); + if (!(this.areAllProposedVisibleRowsAlreadyRendered(proposedRowsVisibleCalculator) && this.areAllProposedVisibleColumnsAlreadyRendered(proposedColumnsVisibleCalculator))) { + fastDraw = false; + } + } + if (!fastDraw) { + this.rowsRenderCalculator = this.createRowsCalculator(); + this.columnsRenderCalculator = this.createColumnsCalculator(); + } + this.rowsVisibleCalculator = null; + this.columnsVisibleCalculator = null; + return fastDraw; + }, + createVisibleCalculators: function() { + this.rowsVisibleCalculator = this.createRowsCalculator(true); + this.columnsVisibleCalculator = this.createColumnsCalculator(true); + }, + areAllProposedVisibleRowsAlreadyRendered: function(proposedRowsVisibleCalculator) { + if (this.rowsVisibleCalculator) { + if (proposedRowsVisibleCalculator.startRow < this.rowsRenderCalculator.startRow || (proposedRowsVisibleCalculator.startRow === this.rowsRenderCalculator.startRow && proposedRowsVisibleCalculator.startRow > 0)) { + return false; + } else if (proposedRowsVisibleCalculator.endRow > this.rowsRenderCalculator.endRow || (proposedRowsVisibleCalculator.endRow === this.rowsRenderCalculator.endRow && proposedRowsVisibleCalculator.endRow < this.wot.getSetting('totalRows') - 1)) { + return false; + } else { + return true; + } + } + return false; + }, + areAllProposedVisibleColumnsAlreadyRendered: function(proposedColumnsVisibleCalculator) { + if (this.columnsVisibleCalculator) { + if (proposedColumnsVisibleCalculator.startColumn < this.columnsRenderCalculator.startColumn || (proposedColumnsVisibleCalculator.startColumn === this.columnsRenderCalculator.startColumn && proposedColumnsVisibleCalculator.startColumn > 0)) { + return false; + } else if (proposedColumnsVisibleCalculator.endColumn > this.columnsRenderCalculator.endColumn || (proposedColumnsVisibleCalculator.endColumn === this.columnsRenderCalculator.endColumn && proposedColumnsVisibleCalculator.endColumn < this.wot.getSetting('totalColumns') - 1)) { + return false; + } else { + return true; + } + } + return false; + } +}, {}); +; +window.WalkontableViewport = WalkontableViewport; + +//# +},{"calculator/viewportColumns":3,"calculator/viewportRows":4,"eventManager":41,"helpers/dom/element":45}],23:[function(require,module,exports){ +"use strict"; +var $__shims_47_classes__, + $__es6collections__, + $__pluginHooks__, + $__core__, + $__renderers_47__95_cellDecorator__, + $__cellTypes__, + $___46__46__47_plugins_47_jqueryHandsontable__, + $__helpers_47_array__, + $__helpers_47_browser__, + $__helpers_47_data__, + $__helpers_47_function__, + $__helpers_47_mixed__, + $__helpers_47_number__, + $__helpers_47_object__, + $__helpers_47_setting__, + $__helpers_47_string__, + $__helpers_47_unicode__, + $__helpers_47_dom_47_element__, + $__helpers_47_dom_47_event__; +Handsontable = function Handsontable(rootElement, userSettings) { + var instance = new Handsontable.Core(rootElement, userSettings || {}); + instance.init(); + return instance; +}; +($__shims_47_classes__ = require("shims/classes"), $__shims_47_classes__ && $__shims_47_classes__.__esModule && $__shims_47_classes__ || {default: $__shims_47_classes__}); +($__es6collections__ = require("es6collections"), $__es6collections__ && $__es6collections__.__esModule && $__es6collections__ || {default: $__es6collections__}); +var Hooks = ($__pluginHooks__ = require("pluginHooks"), $__pluginHooks__ && $__pluginHooks__.__esModule && $__pluginHooks__ || {default: $__pluginHooks__}).Hooks; +if (!Handsontable.hooks) { + Handsontable.hooks = new Hooks(); +} +($__core__ = require("core"), $__core__ && $__core__.__esModule && $__core__ || {default: $__core__}); +($__renderers_47__95_cellDecorator__ = require("renderers/_cellDecorator"), $__renderers_47__95_cellDecorator__ && $__renderers_47__95_cellDecorator__.__esModule && $__renderers_47__95_cellDecorator__ || {default: $__renderers_47__95_cellDecorator__}); +($__cellTypes__ = require("cellTypes"), $__cellTypes__ && $__cellTypes__.__esModule && $__cellTypes__ || {default: $__cellTypes__}); +($___46__46__47_plugins_47_jqueryHandsontable__ = require("plugins/jqueryHandsontable"), $___46__46__47_plugins_47_jqueryHandsontable__ && $___46__46__47_plugins_47_jqueryHandsontable__.__esModule && $___46__46__47_plugins_47_jqueryHandsontable__ || {default: $___46__46__47_plugins_47_jqueryHandsontable__}); +var arrayHelpers = ($__helpers_47_array__ = require("helpers/array"), $__helpers_47_array__ && $__helpers_47_array__.__esModule && $__helpers_47_array__ || {default: $__helpers_47_array__}); +var browserHelpers = ($__helpers_47_browser__ = require("helpers/browser"), $__helpers_47_browser__ && $__helpers_47_browser__.__esModule && $__helpers_47_browser__ || {default: $__helpers_47_browser__}); +var dataHelpers = ($__helpers_47_data__ = require("helpers/data"), $__helpers_47_data__ && $__helpers_47_data__.__esModule && $__helpers_47_data__ || {default: $__helpers_47_data__}); +var functionHelpers = ($__helpers_47_function__ = require("helpers/function"), $__helpers_47_function__ && $__helpers_47_function__.__esModule && $__helpers_47_function__ || {default: $__helpers_47_function__}); +var mixedHelpers = ($__helpers_47_mixed__ = require("helpers/mixed"), $__helpers_47_mixed__ && $__helpers_47_mixed__.__esModule && $__helpers_47_mixed__ || {default: $__helpers_47_mixed__}); +var numberHelpers = ($__helpers_47_number__ = require("helpers/number"), $__helpers_47_number__ && $__helpers_47_number__.__esModule && $__helpers_47_number__ || {default: $__helpers_47_number__}); +var objectHelpers = ($__helpers_47_object__ = require("helpers/object"), $__helpers_47_object__ && $__helpers_47_object__.__esModule && $__helpers_47_object__ || {default: $__helpers_47_object__}); +var settingHelpers = ($__helpers_47_setting__ = require("helpers/setting"), $__helpers_47_setting__ && $__helpers_47_setting__.__esModule && $__helpers_47_setting__ || {default: $__helpers_47_setting__}); +var stringHelpers = ($__helpers_47_string__ = require("helpers/string"), $__helpers_47_string__ && $__helpers_47_string__.__esModule && $__helpers_47_string__ || {default: $__helpers_47_string__}); +var unicodeHelpers = ($__helpers_47_unicode__ = require("helpers/unicode"), $__helpers_47_unicode__ && $__helpers_47_unicode__.__esModule && $__helpers_47_unicode__ || {default: $__helpers_47_unicode__}); +var domHelpers = ($__helpers_47_dom_47_element__ = require("helpers/dom/element"), $__helpers_47_dom_47_element__ && $__helpers_47_dom_47_element__.__esModule && $__helpers_47_dom_47_element__ || {default: $__helpers_47_dom_47_element__}); +var domEventHelpers = ($__helpers_47_dom_47_event__ = require("helpers/dom/event"), $__helpers_47_dom_47_event__ && $__helpers_47_dom_47_event__.__esModule && $__helpers_47_dom_47_event__ || {default: $__helpers_47_dom_47_event__}); +var HELPERS = [arrayHelpers, browserHelpers, dataHelpers, functionHelpers, mixedHelpers, numberHelpers, objectHelpers, settingHelpers, stringHelpers, unicodeHelpers]; +var DOM = [domHelpers, domEventHelpers]; +Handsontable.buildDate = 'Fri Dec 04 2015 11:56:12 GMT+0100 (CET)'; +Handsontable.packageName = 'handsontable'; +Handsontable.version = '0.20.2'; +var baseVersion = '@@baseVersion'; +if (!/^@@/.test(baseVersion)) { + Handsontable.baseVersion = baseVersion; +} +Handsontable.plugins = {}; +Handsontable.helper = {}; +Handsontable.dom = {}; +Handsontable.Dom = Handsontable.dom; +arrayHelpers.arrayEach(HELPERS, (function(helper) { + arrayHelpers.arrayEach(Object.getOwnPropertyNames(helper), (function(key) { + if (key.charAt(0) !== '_') { + Handsontable.helper[key] = helper[key]; + } + })); +})); +arrayHelpers.arrayEach(DOM, (function(helper) { + arrayHelpers.arrayEach(Object.getOwnPropertyNames(helper), (function(key) { + if (key.charAt(0) !== '_') { + Handsontable.dom[key] = helper[key]; + } + })); +})); + +//# +},{"cellTypes":24,"core":25,"es6collections":"es6collections","helpers/array":42,"helpers/browser":43,"helpers/data":44,"helpers/dom/element":45,"helpers/dom/event":46,"helpers/function":47,"helpers/mixed":48,"helpers/number":49,"helpers/object":50,"helpers/setting":51,"helpers/string":52,"helpers/unicode":53,"pluginHooks":56,"plugins/jqueryHandsontable":1,"renderers/_cellDecorator":89,"shims/classes":96}],24:[function(require,module,exports){ +"use strict"; +var $__helpers_47_browser__, + $__editors__, + $__renderers__, + $__editors_47_autocompleteEditor__, + $__editors_47_checkboxEditor__, + $__editors_47_dateEditor__, + $__editors_47_dropdownEditor__, + $__editors_47_handsontableEditor__, + $__editors_47_mobileTextEditor__, + $__editors_47_numericEditor__, + $__editors_47_passwordEditor__, + $__editors_47_selectEditor__, + $__editors_47_textEditor__, + $__renderers_47_autocompleteRenderer__, + $__renderers_47_checkboxRenderer__, + $__renderers_47_htmlRenderer__, + $__renderers_47_numericRenderer__, + $__renderers_47_passwordRenderer__, + $__renderers_47_textRenderer__, + $__validators_47_autocompleteValidator__, + $__validators_47_dateValidator__, + $__validators_47_numericValidator__; +var isMobileBrowser = ($__helpers_47_browser__ = require("helpers/browser"), $__helpers_47_browser__ && $__helpers_47_browser__.__esModule && $__helpers_47_browser__ || {default: $__helpers_47_browser__}).isMobileBrowser; +var getEditorConstructor = ($__editors__ = require("editors"), $__editors__ && $__editors__.__esModule && $__editors__ || {default: $__editors__}).getEditorConstructor; +var getRenderer = ($__renderers__ = require("renderers"), $__renderers__ && $__renderers__.__esModule && $__renderers__ || {default: $__renderers__}).getRenderer; +var AutocompleteEditor = ($__editors_47_autocompleteEditor__ = require("editors/autocompleteEditor"), $__editors_47_autocompleteEditor__ && $__editors_47_autocompleteEditor__.__esModule && $__editors_47_autocompleteEditor__ || {default: $__editors_47_autocompleteEditor__}).AutocompleteEditor; +var CheckboxEditor = ($__editors_47_checkboxEditor__ = require("editors/checkboxEditor"), $__editors_47_checkboxEditor__ && $__editors_47_checkboxEditor__.__esModule && $__editors_47_checkboxEditor__ || {default: $__editors_47_checkboxEditor__}).CheckboxEditor; +var DateEditor = ($__editors_47_dateEditor__ = require("editors/dateEditor"), $__editors_47_dateEditor__ && $__editors_47_dateEditor__.__esModule && $__editors_47_dateEditor__ || {default: $__editors_47_dateEditor__}).DateEditor; +var DropdownEditor = ($__editors_47_dropdownEditor__ = require("editors/dropdownEditor"), $__editors_47_dropdownEditor__ && $__editors_47_dropdownEditor__.__esModule && $__editors_47_dropdownEditor__ || {default: $__editors_47_dropdownEditor__}).DropdownEditor; +var HandsontableEditor = ($__editors_47_handsontableEditor__ = require("editors/handsontableEditor"), $__editors_47_handsontableEditor__ && $__editors_47_handsontableEditor__.__esModule && $__editors_47_handsontableEditor__ || {default: $__editors_47_handsontableEditor__}).HandsontableEditor; +var MobileTextEditor = ($__editors_47_mobileTextEditor__ = require("editors/mobileTextEditor"), $__editors_47_mobileTextEditor__ && $__editors_47_mobileTextEditor__.__esModule && $__editors_47_mobileTextEditor__ || {default: $__editors_47_mobileTextEditor__}).MobileTextEditor; +var NumericEditor = ($__editors_47_numericEditor__ = require("editors/numericEditor"), $__editors_47_numericEditor__ && $__editors_47_numericEditor__.__esModule && $__editors_47_numericEditor__ || {default: $__editors_47_numericEditor__}).NumericEditor; +var PasswordEditor = ($__editors_47_passwordEditor__ = require("editors/passwordEditor"), $__editors_47_passwordEditor__ && $__editors_47_passwordEditor__.__esModule && $__editors_47_passwordEditor__ || {default: $__editors_47_passwordEditor__}).PasswordEditor; +var SelectEditor = ($__editors_47_selectEditor__ = require("editors/selectEditor"), $__editors_47_selectEditor__ && $__editors_47_selectEditor__.__esModule && $__editors_47_selectEditor__ || {default: $__editors_47_selectEditor__}).SelectEditor; +var TextEditor = ($__editors_47_textEditor__ = require("editors/textEditor"), $__editors_47_textEditor__ && $__editors_47_textEditor__.__esModule && $__editors_47_textEditor__ || {default: $__editors_47_textEditor__}).TextEditor; +var AutocompleteRenderer = ($__renderers_47_autocompleteRenderer__ = require("renderers/autocompleteRenderer"), $__renderers_47_autocompleteRenderer__ && $__renderers_47_autocompleteRenderer__.__esModule && $__renderers_47_autocompleteRenderer__ || {default: $__renderers_47_autocompleteRenderer__}).AutocompleteRenderer; +var CheckboxRenderer = ($__renderers_47_checkboxRenderer__ = require("renderers/checkboxRenderer"), $__renderers_47_checkboxRenderer__ && $__renderers_47_checkboxRenderer__.__esModule && $__renderers_47_checkboxRenderer__ || {default: $__renderers_47_checkboxRenderer__}).CheckboxRenderer; +var HtmlRenderer = ($__renderers_47_htmlRenderer__ = require("renderers/htmlRenderer"), $__renderers_47_htmlRenderer__ && $__renderers_47_htmlRenderer__.__esModule && $__renderers_47_htmlRenderer__ || {default: $__renderers_47_htmlRenderer__}).HtmlRenderer; +var NumericRenderer = ($__renderers_47_numericRenderer__ = require("renderers/numericRenderer"), $__renderers_47_numericRenderer__ && $__renderers_47_numericRenderer__.__esModule && $__renderers_47_numericRenderer__ || {default: $__renderers_47_numericRenderer__}).NumericRenderer; +var PasswordRenderer = ($__renderers_47_passwordRenderer__ = require("renderers/passwordRenderer"), $__renderers_47_passwordRenderer__ && $__renderers_47_passwordRenderer__.__esModule && $__renderers_47_passwordRenderer__ || {default: $__renderers_47_passwordRenderer__}).PasswordRenderer; +var TextRenderer = ($__renderers_47_textRenderer__ = require("renderers/textRenderer"), $__renderers_47_textRenderer__ && $__renderers_47_textRenderer__.__esModule && $__renderers_47_textRenderer__ || {default: $__renderers_47_textRenderer__}).TextRenderer; +var AutocompleteValidator = ($__validators_47_autocompleteValidator__ = require("validators/autocompleteValidator"), $__validators_47_autocompleteValidator__ && $__validators_47_autocompleteValidator__.__esModule && $__validators_47_autocompleteValidator__ || {default: $__validators_47_autocompleteValidator__}).AutocompleteValidator; +var DateValidator = ($__validators_47_dateValidator__ = require("validators/dateValidator"), $__validators_47_dateValidator__ && $__validators_47_dateValidator__.__esModule && $__validators_47_dateValidator__ || {default: $__validators_47_dateValidator__}).DateValidator; +var NumericValidator = ($__validators_47_numericValidator__ = require("validators/numericValidator"), $__validators_47_numericValidator__ && $__validators_47_numericValidator__.__esModule && $__validators_47_numericValidator__ || {default: $__validators_47_numericValidator__}).NumericValidator; +Handsontable.mobileBrowser = isMobileBrowser(); +Handsontable.AutocompleteCell = { + editor: getEditorConstructor('autocomplete'), + renderer: getRenderer('autocomplete'), + validator: Handsontable.AutocompleteValidator +}; +Handsontable.CheckboxCell = { + editor: getEditorConstructor('checkbox'), + renderer: getRenderer('checkbox') +}; +Handsontable.TextCell = { + editor: Handsontable.mobileBrowser ? getEditorConstructor('mobile') : getEditorConstructor('text'), + renderer: getRenderer('text') +}; +Handsontable.NumericCell = { + editor: getEditorConstructor('numeric'), + renderer: getRenderer('numeric'), + validator: Handsontable.NumericValidator, + dataType: 'number' +}; +Handsontable.DateCell = { + editor: getEditorConstructor('date'), + validator: Handsontable.DateValidator, + renderer: getRenderer('autocomplete') +}; +Handsontable.HandsontableCell = { + editor: getEditorConstructor('handsontable'), + renderer: getRenderer('autocomplete') +}; +Handsontable.PasswordCell = { + editor: getEditorConstructor('password'), + renderer: getRenderer('password'), + copyable: false +}; +Handsontable.DropdownCell = { + editor: getEditorConstructor('dropdown'), + renderer: getRenderer('autocomplete'), + validator: Handsontable.AutocompleteValidator +}; +Handsontable.cellTypes = { + text: Handsontable.TextCell, + date: Handsontable.DateCell, + numeric: Handsontable.NumericCell, + checkbox: Handsontable.CheckboxCell, + autocomplete: Handsontable.AutocompleteCell, + handsontable: Handsontable.HandsontableCell, + password: Handsontable.PasswordCell, + dropdown: Handsontable.DropdownCell +}; +Handsontable.cellLookup = {validator: { + numeric: Handsontable.NumericValidator, + autocomplete: Handsontable.AutocompleteValidator + }}; + +//# +},{"editors":29,"editors/autocompleteEditor":31,"editors/checkboxEditor":32,"editors/dateEditor":33,"editors/dropdownEditor":34,"editors/handsontableEditor":35,"editors/mobileTextEditor":36,"editors/numericEditor":37,"editors/passwordEditor":38,"editors/selectEditor":39,"editors/textEditor":40,"helpers/browser":43,"renderers":88,"renderers/autocompleteRenderer":90,"renderers/checkboxRenderer":91,"renderers/htmlRenderer":92,"renderers/numericRenderer":93,"renderers/passwordRenderer":94,"renderers/textRenderer":95,"validators/autocompleteValidator":100,"validators/dateValidator":101,"validators/numericValidator":102}],25:[function(require,module,exports){ +"use strict"; +var $__numeral__, + $__helpers_47_dom_47_element__, + $__helpers_47_setting__, + $__dataMap__, + $__editorManager__, + $__eventManager__, + $__helpers_47_object__, + $__helpers_47_array__, + $__plugins__, + $__renderers__, + $__helpers_47_string__, + $__helpers_47_number__, + $__tableView__, + $__dataSource__, + $__helpers_47_data__, + $__3rdparty_47_walkontable_47_src_47_cell_47_coords__, + $__3rdparty_47_walkontable_47_src_47_cell_47_range__, + $__3rdparty_47_walkontable_47_src_47_selection__, + $__3rdparty_47_walkontable_47_src_47_calculator_47_viewportColumns__; +var numeral = ($__numeral__ = require("numeral"), $__numeral__ && $__numeral__.__esModule && $__numeral__ || {default: $__numeral__}).default; +var $__1 = ($__helpers_47_dom_47_element__ = require("helpers/dom/element"), $__helpers_47_dom_47_element__ && $__helpers_47_dom_47_element__.__esModule && $__helpers_47_dom_47_element__ || {default: $__helpers_47_dom_47_element__}), + addClass = $__1.addClass, + empty = $__1.empty, + isChildOfWebComponentTable = $__1.isChildOfWebComponentTable, + removeClass = $__1.removeClass; +var columnFactory = ($__helpers_47_setting__ = require("helpers/setting"), $__helpers_47_setting__ && $__helpers_47_setting__.__esModule && $__helpers_47_setting__ || {default: $__helpers_47_setting__}).columnFactory; +var DataMap = ($__dataMap__ = require("dataMap"), $__dataMap__ && $__dataMap__.__esModule && $__dataMap__ || {default: $__dataMap__}).DataMap; +var EditorManager = ($__editorManager__ = require("editorManager"), $__editorManager__ && $__editorManager__.__esModule && $__editorManager__ || {default: $__editorManager__}).EditorManager; +var eventManagerObject = ($__eventManager__ = require("eventManager"), $__eventManager__ && $__eventManager__.__esModule && $__eventManager__ || {default: $__eventManager__}).eventManager; +var $__6 = ($__helpers_47_object__ = require("helpers/object"), $__helpers_47_object__ && $__helpers_47_object__.__esModule && $__helpers_47_object__ || {default: $__helpers_47_object__}), + extend = $__6.extend, + duckSchema = $__6.duckSchema, + isObjectEquals = $__6.isObjectEquals, + deepClone = $__6.deepClone; +var arrayFlatten = ($__helpers_47_array__ = require("helpers/array"), $__helpers_47_array__ && $__helpers_47_array__.__esModule && $__helpers_47_array__ || {default: $__helpers_47_array__}).arrayFlatten; +var getPlugin = ($__plugins__ = require("plugins"), $__plugins__ && $__plugins__.__esModule && $__plugins__ || {default: $__plugins__}).getPlugin; +var getRenderer = ($__renderers__ = require("renderers"), $__renderers__ && $__renderers__.__esModule && $__renderers__ || {default: $__renderers__}).getRenderer; +var randomString = ($__helpers_47_string__ = require("helpers/string"), $__helpers_47_string__ && $__helpers_47_string__.__esModule && $__helpers_47_string__ || {default: $__helpers_47_string__}).randomString; +var rangeEach = ($__helpers_47_number__ = require("helpers/number"), $__helpers_47_number__ && $__helpers_47_number__.__esModule && $__helpers_47_number__ || {default: $__helpers_47_number__}).rangeEach; +var TableView = ($__tableView__ = require("tableView"), $__tableView__ && $__tableView__.__esModule && $__tableView__ || {default: $__tableView__}).TableView; +var DataSource = ($__dataSource__ = require("dataSource"), $__dataSource__ && $__dataSource__.__esModule && $__dataSource__ || {default: $__dataSource__}).DataSource; +var $__14 = ($__helpers_47_data__ = require("helpers/data"), $__helpers_47_data__ && $__helpers_47_data__.__esModule && $__helpers_47_data__ || {default: $__helpers_47_data__}), + translateRowsToColumns = $__14.translateRowsToColumns, + cellMethodLookupFactory = $__14.cellMethodLookupFactory, + spreadsheetColumnLabel = $__14.spreadsheetColumnLabel; +var WalkontableCellCoords = ($__3rdparty_47_walkontable_47_src_47_cell_47_coords__ = require("3rdparty/walkontable/src/cell/coords"), $__3rdparty_47_walkontable_47_src_47_cell_47_coords__ && $__3rdparty_47_walkontable_47_src_47_cell_47_coords__.__esModule && $__3rdparty_47_walkontable_47_src_47_cell_47_coords__ || {default: $__3rdparty_47_walkontable_47_src_47_cell_47_coords__}).WalkontableCellCoords; +var WalkontableCellRange = ($__3rdparty_47_walkontable_47_src_47_cell_47_range__ = require("3rdparty/walkontable/src/cell/range"), $__3rdparty_47_walkontable_47_src_47_cell_47_range__ && $__3rdparty_47_walkontable_47_src_47_cell_47_range__.__esModule && $__3rdparty_47_walkontable_47_src_47_cell_47_range__ || {default: $__3rdparty_47_walkontable_47_src_47_cell_47_range__}).WalkontableCellRange; +var WalkontableSelection = ($__3rdparty_47_walkontable_47_src_47_selection__ = require("3rdparty/walkontable/src/selection"), $__3rdparty_47_walkontable_47_src_47_selection__ && $__3rdparty_47_walkontable_47_src_47_selection__.__esModule && $__3rdparty_47_walkontable_47_src_47_selection__ || {default: $__3rdparty_47_walkontable_47_src_47_selection__}).WalkontableSelection; +var WalkontableViewportColumnsCalculator = ($__3rdparty_47_walkontable_47_src_47_calculator_47_viewportColumns__ = require("3rdparty/walkontable/src/calculator/viewportColumns"), $__3rdparty_47_walkontable_47_src_47_calculator_47_viewportColumns__ && $__3rdparty_47_walkontable_47_src_47_calculator_47_viewportColumns__.__esModule && $__3rdparty_47_walkontable_47_src_47_calculator_47_viewportColumns__ || {default: $__3rdparty_47_walkontable_47_src_47_calculator_47_viewportColumns__}).WalkontableViewportColumnsCalculator; +Handsontable.activeGuid = null; +Handsontable.Core = function Core(rootElement, userSettings) { + var priv, + datamap, + dataSource, + grid, + selection, + editorManager, + instance = this, + GridSettings = function() {}, + eventManager = eventManagerObject(instance); + extend(GridSettings.prototype, DefaultSettings.prototype); + extend(GridSettings.prototype, userSettings); + extend(GridSettings.prototype, expandType(userSettings)); + this.rootElement = rootElement; + this.isHotTableEnv = isChildOfWebComponentTable(this.rootElement); + Handsontable.eventManager.isHotTableEnv = this.isHotTableEnv; + this.container = document.createElement('DIV'); + this.renderCall = false; + rootElement.insertBefore(this.container, rootElement.firstChild); + this.guid = 'ht_' + randomString(); + if (!this.rootElement.id || this.rootElement.id.substring(0, 3) === 'ht_') { + this.rootElement.id = this.guid; + } + priv = { + cellSettings: [], + columnSettings: [], + columnsSettingConflicts: ['data', 'width'], + settings: new GridSettings(), + selRange: null, + isPopulated: null, + scrollable: null, + firstRun: true + }; + grid = { + alter: function(action, index, amount, source, keepEmptyRows) { + var delta; + amount = amount || 1; + switch (action) { + case 'insert_row': + if (instance.getSettings().maxRows === instance.countSourceRows()) { + return; + } + delta = datamap.createRow(index, amount); + if (delta) { + if (selection.isSelected() && priv.selRange.from.row >= index) { + priv.selRange.from.row = priv.selRange.from.row + delta; + selection.transformEnd(delta, 0); + } else { + selection.refreshBorders(); + } + } + break; + case 'insert_col': + delta = datamap.createCol(index, amount); + if (delta) { + if (Array.isArray(instance.getSettings().colHeaders)) { + var spliceArray = [index, 0]; + spliceArray.length += delta; + Array.prototype.splice.apply(instance.getSettings().colHeaders, spliceArray); + } + if (selection.isSelected() && priv.selRange.from.col >= index) { + priv.selRange.from.col = priv.selRange.from.col + delta; + selection.transformEnd(0, delta); + } else { + selection.refreshBorders(); + } + } + break; + case 'remove_row': + datamap.removeRow(index, amount); + priv.cellSettings.splice(index, amount); + var totalRows = instance.countRows(); + var fixedRowsTop = instance.getSettings().fixedRowsTop; + if (fixedRowsTop >= index + 1) { + instance.getSettings().fixedRowsTop -= Math.min(amount, fixedRowsTop - index); + } + var fixedRowsBottom = instance.getSettings().fixedRowsBottom; + if (fixedRowsBottom && totalRows - fixedRowsBottom <= index + 1) { + instance.getSettings().fixedRowsBottom -= Math.min(amount, fixedRowsBottom - index); + } + grid.adjustRowsAndCols(); + selection.refreshBorders(); + break; + case 'remove_col': + datamap.removeCol(index, amount); + for (var row = 0, + len = datamap.getAll().length; row < len; row++) { + if (row in priv.cellSettings) { + priv.cellSettings[row].splice(index, amount); + } + } + var fixedColumnsLeft = instance.getSettings().fixedColumnsLeft; + if (fixedColumnsLeft >= index + 1) { + instance.getSettings().fixedColumnsLeft -= Math.min(amount, fixedColumnsLeft - index); + } + if (Array.isArray(instance.getSettings().colHeaders)) { + if (typeof index == 'undefined') { + index = -1; + } + instance.getSettings().colHeaders.splice(index, amount); + } + grid.adjustRowsAndCols(); + selection.refreshBorders(); + break; + default: + throw new Error('There is no such action "' + action + '"'); + break; + } + if (!keepEmptyRows) { + grid.adjustRowsAndCols(); + } + }, + adjustRowsAndCols: function() { + if (priv.settings.minRows) { + var rows = instance.countRows(); + if (rows < priv.settings.minRows) { + for (var r = 0, + minRows = priv.settings.minRows; r < minRows - rows; r++) { + datamap.createRow(instance.countRows(), 1, true); + } + } + } + if (priv.settings.minSpareRows) { + var emptyRows = instance.countEmptyRows(true); + if (emptyRows < priv.settings.minSpareRows) { + for (; emptyRows < priv.settings.minSpareRows && instance.countRows() < priv.settings.maxRows; emptyRows++) { + datamap.createRow(instance.countRows(), 1, true); + } + } + } + { + var emptyCols; + if (priv.settings.minCols || priv.settings.minSpareCols) { + emptyCols = instance.countEmptyCols(true); + } + if (priv.settings.minCols && !priv.settings.columns && instance.countCols() < priv.settings.minCols) { + for (; instance.countCols() < priv.settings.minCols; emptyCols++) { + datamap.createCol(instance.countCols(), 1, true); + } + } + if (priv.settings.minSpareCols && !priv.settings.columns && instance.dataType === 'array' && emptyCols < priv.settings.minSpareCols) { + for (; emptyCols < priv.settings.minSpareCols && instance.countCols() < priv.settings.maxCols; emptyCols++) { + datamap.createCol(instance.countCols(), 1, true); + } + } + } + var rowCount = instance.countRows(); + var colCount = instance.countCols(); + if (rowCount === 0 || colCount === 0) { + selection.deselect(); + } + if (selection.isSelected()) { + var selectionChanged = false; + var fromRow = priv.selRange.from.row; + var fromCol = priv.selRange.from.col; + var toRow = priv.selRange.to.row; + var toCol = priv.selRange.to.col; + if (fromRow > rowCount - 1) { + fromRow = rowCount - 1; + selectionChanged = true; + if (toRow > fromRow) { + toRow = fromRow; + } + } else if (toRow > rowCount - 1) { + toRow = rowCount - 1; + selectionChanged = true; + if (fromRow > toRow) { + fromRow = toRow; + } + } + if (fromCol > colCount - 1) { + fromCol = colCount - 1; + selectionChanged = true; + if (toCol > fromCol) { + toCol = fromCol; + } + } else if (toCol > colCount - 1) { + toCol = colCount - 1; + selectionChanged = true; + if (fromCol > toCol) { + fromCol = toCol; + } + } + if (selectionChanged) { + instance.selectCell(fromRow, fromCol, toRow, toCol); + } + } + if (instance.view) { + instance.view.wt.wtOverlays.adjustElementsSize(); + } + }, + populateFromArray: function(start, input, end, source, method, direction, deltas) { + var r, + rlen, + c, + clen, + setData = [], + current = {}; + rlen = input.length; + if (rlen === 0) { + return false; + } + var repeatCol, + repeatRow, + cmax, + rmax, + baseEnd = { + row: end === null ? null : end.row, + col: end === null ? null : end.col + }; + switch (method) { + case 'shift_down': + repeatCol = end ? end.col - start.col + 1 : 0; + repeatRow = end ? end.row - start.row + 1 : 0; + input = translateRowsToColumns(input); + for (c = 0, clen = input.length, cmax = Math.max(clen, repeatCol); c < cmax; c++) { + if (c < clen) { + for (r = 0, rlen = input[c].length; r < repeatRow - rlen; r++) { + input[c].push(input[c][r % rlen]); + } + input[c].unshift(start.col + c, start.row, 0); + instance.spliceCol.apply(instance, input[c]); + } else { + input[c % clen][0] = start.col + c; + instance.spliceCol.apply(instance, input[c % clen]); + } + } + break; + case 'shift_right': + repeatCol = end ? end.col - start.col + 1 : 0; + repeatRow = end ? end.row - start.row + 1 : 0; + for (r = 0, rlen = input.length, rmax = Math.max(rlen, repeatRow); r < rmax; r++) { + if (r < rlen) { + for (c = 0, clen = input[r].length; c < repeatCol - clen; c++) { + input[r].push(input[r][c % clen]); + } + input[r].unshift(start.row + r, start.col, 0); + instance.spliceRow.apply(instance, input[r]); + } else { + input[r % rlen][0] = start.row + r; + instance.spliceRow.apply(instance, input[r % rlen]); + } + } + break; + case 'overwrite': + default: + current.row = start.row; + current.col = start.col; + var selected = { + row: (end && start) ? (end.row - start.row + 1) : 1, + col: (end && start) ? (end.col - start.col + 1) : 1 + }; + var skippedRow = 0; + var skippedColumn = 0; + var pushData = true; + var cellMeta; + var getInputValue = function getInputValue(row) { + var col = arguments[1] !== (void 0) ? arguments[1] : null; + var rowValue = input[row % input.length]; + if (col !== null) { + return rowValue[col % rowValue.length]; + } + return rowValue; + }; + var rowInputLength = input.length; + var rowSelectionLength = end ? end.row - start.row + 1 : 0; + if (end) { + rlen = rowSelectionLength; + } else { + rlen = Math.max(rowInputLength, rowSelectionLength); + } + for (r = 0; r < rlen; r++) { + if ((end && current.row > end.row && rowSelectionLength > rowInputLength) || (!priv.settings.allowInsertRow && current.row > instance.countRows() - 1) || (current.row >= priv.settings.maxRows)) { + break; + } + var logicalRow = r - skippedRow; + var colInputLength = getInputValue(logicalRow).length; + var colSelectionLength = end ? end.col - start.col + 1 : 0; + if (end) { + clen = colSelectionLength; + } else { + clen = Math.max(colInputLength, colSelectionLength); + } + current.col = start.col; + cellMeta = instance.getCellMeta(current.row, current.col); + if ((source === 'paste' || source === 'autofill') && cellMeta.skipRowOnPaste) { + skippedRow++; + current.row++; + rlen++; + continue; + } + skippedColumn = 0; + for (c = 0; c < clen; c++) { + if ((end && current.col > end.col && colSelectionLength > colInputLength) || (!priv.settings.allowInsertColumn && current.col > instance.countCols() - 1) || (current.col >= priv.settings.maxCols)) { + break; + } + cellMeta = instance.getCellMeta(current.row, current.col); + if ((source === 'paste' || source === 'autofill') && cellMeta.skipColumnOnPaste) { + skippedColumn++; + current.col++; + clen++; + continue; + } + if (cellMeta.readOnly) { + current.col++; + continue; + } + var logicalColumn = c - skippedColumn; + var value = getInputValue(logicalRow, logicalColumn); + var orgValue = instance.getDataAtCell(current.row, current.col); + var index = { + row: logicalRow, + col: logicalColumn + }; + if (source === 'autofill') { + var result = instance.runHooks('beforeAutofillInsidePopulate', index, direction, input, deltas, {}, selected); + if (result) { + value = typeof(result.value) === 'undefined' ? value : result.value; + } + } + if (value !== null && typeof value === 'object') { + if (orgValue === null || typeof orgValue !== 'object') { + pushData = false; + } else { + var orgValueSchema = duckSchema(orgValue[0] || orgValue); + var valueSchema = duckSchema(value[0] || value); + if (isObjectEquals(orgValueSchema, valueSchema)) { + value = deepClone(value); + } else { + pushData = false; + } + } + } else if (orgValue !== null && typeof orgValue === 'object') { + pushData = false; + } + if (pushData) { + setData.push([current.row, current.col, value]); + } + pushData = true; + current.col++; + } + current.row++; + } + instance.setDataAtCell(setData, null, null, source || 'populateFromArray'); + break; + } + } + }; + this.selection = selection = { + inProgress: false, + selectedHeader: { + cols: false, + rows: false + }, + setSelectedHeaders: function(rows, cols) { + instance.selection.selectedHeader.rows = rows; + instance.selection.selectedHeader.cols = cols; + }, + begin: function() { + instance.selection.inProgress = true; + }, + finish: function() { + var sel = instance.getSelected(); + Handsontable.hooks.run(instance, 'afterSelectionEnd', sel[0], sel[1], sel[2], sel[3]); + Handsontable.hooks.run(instance, 'afterSelectionEndByProp', sel[0], instance.colToProp(sel[1]), sel[2], instance.colToProp(sel[3])); + instance.selection.inProgress = false; + }, + isInProgress: function() { + return instance.selection.inProgress; + }, + setRangeStart: function(coords, keepEditorOpened) { + Handsontable.hooks.run(instance, 'beforeSetRangeStart', coords); + priv.selRange = new WalkontableCellRange(coords, coords, coords); + selection.setRangeEnd(coords, null, keepEditorOpened); + }, + setRangeEnd: function(coords, scrollToCell, keepEditorOpened) { + if (priv.selRange === null) { + return; + } + var disableVisualSelection, + isHeaderSelected = false, + areCoordsPositive = true; + var firstVisibleRow = instance.view.wt.wtTable.getFirstVisibleRow(); + var firstVisibleColumn = instance.view.wt.wtTable.getFirstVisibleColumn(); + var newRangeCoords = { + row: null, + col: null + }; + Handsontable.hooks.run(instance, 'beforeSetRangeEnd', coords); + instance.selection.begin(); + newRangeCoords.row = coords.row < 0 ? firstVisibleRow : coords.row; + newRangeCoords.col = coords.col < 0 ? firstVisibleColumn : coords.col; + priv.selRange.to = new WalkontableCellCoords(newRangeCoords.row, newRangeCoords.col); + if (!priv.settings.multiSelect) { + priv.selRange.from = coords; + } + instance.view.wt.selections.current.clear(); + disableVisualSelection = instance.getCellMeta(priv.selRange.highlight.row, priv.selRange.highlight.col).disableVisualSelection; + if (typeof disableVisualSelection === 'string') { + disableVisualSelection = [disableVisualSelection]; + } + if (disableVisualSelection === false || Array.isArray(disableVisualSelection) && disableVisualSelection.indexOf('current') === -1) { + instance.view.wt.selections.current.add(priv.selRange.highlight); + } + instance.view.wt.selections.area.clear(); + if ((disableVisualSelection === false || Array.isArray(disableVisualSelection) && disableVisualSelection.indexOf('area') === -1) && selection.isMultiple()) { + instance.view.wt.selections.area.add(priv.selRange.from); + instance.view.wt.selections.area.add(priv.selRange.to); + } + if (priv.settings.currentRowClassName || priv.settings.currentColClassName) { + instance.view.wt.selections.highlight.clear(); + instance.view.wt.selections.highlight.add(priv.selRange.from); + instance.view.wt.selections.highlight.add(priv.selRange.to); + } + Handsontable.hooks.run(instance, 'afterSelection', priv.selRange.from.row, priv.selRange.from.col, priv.selRange.to.row, priv.selRange.to.col); + Handsontable.hooks.run(instance, 'afterSelectionByProp', priv.selRange.from.row, datamap.colToProp(priv.selRange.from.col), priv.selRange.to.row, datamap.colToProp(priv.selRange.to.col)); + if ((priv.selRange.from.row === 0 && priv.selRange.to.row === instance.countRows() - 1 && instance.countRows() > 1) || (priv.selRange.from.col === 0 && priv.selRange.to.col === instance.countCols() - 1 && instance.countCols() > 1)) { + isHeaderSelected = true; + } + if (coords.row < 0 || coords.col < 0) { + areCoordsPositive = false; + } + if (scrollToCell !== false && !isHeaderSelected && areCoordsPositive) { + if (priv.selRange.from && !selection.isMultiple()) { + instance.view.scrollViewport(priv.selRange.from); + } else { + instance.view.scrollViewport(coords); + } + } + selection.refreshBorders(null, keepEditorOpened); + }, + refreshBorders: function(revertOriginal, keepEditor) { + if (!keepEditor) { + editorManager.destroyEditor(revertOriginal); + } + instance.view.render(); + if (selection.isSelected() && !keepEditor) { + editorManager.prepareEditor(); + } + }, + isMultiple: function() { + var isMultiple = !(priv.selRange.to.col === priv.selRange.from.col && priv.selRange.to.row === priv.selRange.from.row), + modifier = Handsontable.hooks.run(instance, 'afterIsMultipleSelection', isMultiple); + if (isMultiple) { + return modifier; + } + }, + transformStart: function(rowDelta, colDelta, force, keepEditorOpened) { + var delta = new WalkontableCellCoords(rowDelta, colDelta), + rowTransformDir = 0, + colTransformDir = 0, + totalRows, + totalCols, + coords, + fixedRowsBottom; + instance.runHooks('modifyTransformStart', delta); + totalRows = instance.countRows(); + totalCols = instance.countCols(); + fixedRowsBottom = instance.getSettings().fixedRowsBottom; + if (priv.selRange.highlight.row + rowDelta > totalRows - 1) { + if (force && priv.settings.minSpareRows > 0 && !(fixedRowsBottom && priv.selRange.highlight.row >= totalRows - fixedRowsBottom - 1)) { + instance.alter('insert_row', totalRows); + totalRows = instance.countRows(); + } else if (priv.settings.autoWrapCol) { + delta.row = 1 - totalRows; + delta.col = priv.selRange.highlight.col + delta.col == totalCols - 1 ? 1 - totalCols : 1; + } + } else if (priv.settings.autoWrapCol && priv.selRange.highlight.row + delta.row < 0 && priv.selRange.highlight.col + delta.col >= 0) { + delta.row = totalRows - 1; + delta.col = priv.selRange.highlight.col + delta.col == 0 ? totalCols - 1 : -1; + } + if (priv.selRange.highlight.col + delta.col > totalCols - 1) { + if (force && priv.settings.minSpareCols > 0) { + instance.alter('insert_col', totalCols); + totalCols = instance.countCols(); + } else if (priv.settings.autoWrapRow) { + delta.row = priv.selRange.highlight.row + delta.row == totalRows - 1 ? 1 - totalRows : 1; + delta.col = 1 - totalCols; + } + } else if (priv.settings.autoWrapRow && priv.selRange.highlight.col + delta.col < 0 && priv.selRange.highlight.row + delta.row >= 0) { + delta.row = priv.selRange.highlight.row + delta.row == 0 ? totalRows - 1 : -1; + delta.col = totalCols - 1; + } + coords = new WalkontableCellCoords(priv.selRange.highlight.row + delta.row, priv.selRange.highlight.col + delta.col); + if (coords.row < 0) { + rowTransformDir = -1; + coords.row = 0; + } else if (coords.row > 0 && coords.row >= totalRows) { + rowTransformDir = 1; + coords.row = totalRows - 1; + } + if (coords.col < 0) { + colTransformDir = -1; + coords.col = 0; + } else if (coords.col > 0 && coords.col >= totalCols) { + colTransformDir = 1; + coords.col = totalCols - 1; + } + instance.runHooks('afterModifyTransformStart', coords, rowTransformDir, colTransformDir); + selection.setRangeStart(coords, keepEditorOpened); + }, + transformEnd: function(rowDelta, colDelta) { + var delta = new WalkontableCellCoords(rowDelta, colDelta), + rowTransformDir = 0, + colTransformDir = 0, + totalRows, + totalCols, + coords; + instance.runHooks('modifyTransformEnd', delta); + totalRows = instance.countRows(); + totalCols = instance.countCols(); + coords = new WalkontableCellCoords(priv.selRange.to.row + delta.row, priv.selRange.to.col + delta.col); + if (coords.row < 0) { + rowTransformDir = -1; + coords.row = 0; + } else if (coords.row > 0 && coords.row >= totalRows) { + rowTransformDir = 1; + coords.row = totalRows - 1; + } + if (coords.col < 0) { + colTransformDir = -1; + coords.col = 0; + } else if (coords.col > 0 && coords.col >= totalCols) { + colTransformDir = 1; + coords.col = totalCols - 1; + } + instance.runHooks('afterModifyTransformEnd', coords, rowTransformDir, colTransformDir); + selection.setRangeEnd(coords, true); + }, + isSelected: function() { + return (priv.selRange !== null); + }, + inInSelection: function(coords) { + if (!selection.isSelected()) { + return false; + } + return priv.selRange.includes(coords); + }, + deselect: function() { + if (!selection.isSelected()) { + return; + } + instance.selection.inProgress = false; + priv.selRange = null; + instance.view.wt.selections.current.clear(); + instance.view.wt.selections.area.clear(); + if (priv.settings.currentRowClassName || priv.settings.currentColClassName) { + instance.view.wt.selections.highlight.clear(); + } + editorManager.destroyEditor(); + selection.refreshBorders(); + Handsontable.hooks.run(instance, 'afterDeselect'); + }, + selectAll: function() { + if (!priv.settings.multiSelect) { + return; + } + selection.setRangeStart(new WalkontableCellCoords(0, 0)); + selection.setRangeEnd(new WalkontableCellCoords(instance.countRows() - 1, instance.countCols() - 1), false); + }, + empty: function() { + if (!selection.isSelected()) { + return; + } + var topLeft = priv.selRange.getTopLeftCorner(); + var bottomRight = priv.selRange.getBottomRightCorner(); + var r, + c, + changes = []; + for (r = topLeft.row; r <= bottomRight.row; r++) { + for (c = topLeft.col; c <= bottomRight.col; c++) { + if (!instance.getCellMeta(r, c).readOnly) { + changes.push([r, c, '']); + } + } + } + instance.setDataAtCell(changes); + } + }; + this.init = function() { + dataSource = new DataSource(instance, priv.settings.data); + Handsontable.hooks.run(instance, 'beforeInit'); + if (Handsontable.mobileBrowser) { + addClass(instance.rootElement, 'mobile'); + } + this.updateSettings(priv.settings, true); + this.view = new TableView(this); + editorManager = new EditorManager(instance, priv, selection, datamap); + this.forceFullRender = true; + Handsontable.hooks.run(instance, 'init'); + this.view.render(); + if (typeof priv.firstRun === 'object') { + Handsontable.hooks.run(instance, 'afterChange', priv.firstRun[0], priv.firstRun[1]); + priv.firstRun = false; + } + Handsontable.hooks.run(instance, 'afterInit'); + }; + function ValidatorsQueue() { + var resolved = false; + return { + validatorsInQueue: 0, + valid: true, + addValidatorToQueue: function() { + this.validatorsInQueue++; + resolved = false; + }, + removeValidatorFormQueue: function() { + this.validatorsInQueue = this.validatorsInQueue - 1 < 0 ? 0 : this.validatorsInQueue - 1; + this.checkIfQueueIsEmpty(); + }, + onQueueEmpty: function(valid) {}, + checkIfQueueIsEmpty: function() { + if (this.validatorsInQueue == 0 && resolved == false) { + resolved = true; + this.onQueueEmpty(this.valid); + } + } + }; + } + function validateChanges(changes, source, callback) { + var waitingForValidator = new ValidatorsQueue(); + waitingForValidator.onQueueEmpty = resolve; + for (var i = changes.length - 1; i >= 0; i--) { + if (changes[i] === null) { + changes.splice(i, 1); + } else { + var row = changes[i][0]; + var col = datamap.propToCol(changes[i][1]); + var logicalCol = instance.runHooks('modifyCol', col); + var cellProperties = instance.getCellMeta(row, logicalCol); + if (cellProperties.type === 'numeric' && typeof changes[i][3] === 'string') { + if (changes[i][3].length > 0 && (/^-?[\d\s]*(\.|\,)?\d*$/.test(changes[i][3]) || cellProperties.format)) { + var len = changes[i][3].length; + if (typeof cellProperties.language == 'undefined') { + numeral.language('en'); + } else if (changes[i][3].indexOf('.') === len - 3 && changes[i][3].indexOf(',') === -1) { + numeral.language('en'); + } else { + numeral.language(cellProperties.language); + } + if (numeral.validate(changes[i][3])) { + changes[i][3] = numeral().unformat(changes[i][3]); + } + } + } + if (instance.getCellValidator(cellProperties)) { + waitingForValidator.addValidatorToQueue(); + instance.validateCell(changes[i][3], cellProperties, (function(i, cellProperties) { + return function(result) { + if (typeof result !== 'boolean') { + throw new Error('Validation error: result is not boolean'); + } + if (result === false && cellProperties.allowInvalid === false) { + changes.splice(i, 1); + cellProperties.valid = true; + --i; + } + waitingForValidator.removeValidatorFormQueue(); + }; + })(i, cellProperties), source); + } + } + } + waitingForValidator.checkIfQueueIsEmpty(); + function resolve() { + var beforeChangeResult; + if (changes.length) { + beforeChangeResult = Handsontable.hooks.run(instance, 'beforeChange', changes, source); + if (typeof beforeChangeResult === 'function') { + console.warn('Your beforeChange callback returns a function. It\'s not supported since Handsontable 0.12.1 (and the returned function will not be executed).'); + } else if (beforeChangeResult === false) { + changes.splice(0, changes.length); + } + } + callback(); + } + } + function applyChanges(changes, source) { + var i = changes.length - 1; + if (i < 0) { + return; + } + for (; 0 <= i; i--) { + if (changes[i] === null) { + changes.splice(i, 1); + continue; + } + if (changes[i][2] == null && changes[i][3] == null) { + continue; + } + if (priv.settings.allowInsertRow) { + while (changes[i][0] > instance.countRows() - 1) { + datamap.createRow(); + } + } + if (instance.dataType === 'array' && priv.settings.allowInsertColumn) { + while (datamap.propToCol(changes[i][1]) > instance.countCols() - 1) { + datamap.createCol(); + } + } + datamap.set(changes[i][0], changes[i][1], changes[i][3]); + } + instance.forceFullRender = true; + grid.adjustRowsAndCols(); + Handsontable.hooks.run(instance, 'beforeChangeRender', changes, source); + selection.refreshBorders(null, true); + instance.view.wt.wtOverlays.adjustElementsSize(); + Handsontable.hooks.run(instance, 'afterChange', changes, source || 'edit'); + } + this.validateCell = function(value, cellProperties, callback, source) { + var validator = instance.getCellValidator(cellProperties); + function done(valid) { + var col = cellProperties.physicalCol, + row = cellProperties.physicalRow, + td = instance.getCell(row, col, true); + if (td) { + instance.view.wt.wtSettings.settings.cellRenderer(row, col, td); + } + callback(valid); + } + if (Object.prototype.toString.call(validator) === '[object RegExp]') { + validator = (function(validator) { + return function(value, callback) { + callback(validator.test(value)); + }; + })(validator); + } + if (typeof validator == 'function') { + value = Handsontable.hooks.run(instance, 'beforeValidate', value, cellProperties.row, cellProperties.prop, source); + instance._registerTimeout(setTimeout(function() { + validator.call(cellProperties, value, function(valid) { + valid = Handsontable.hooks.run(instance, 'afterValidate', valid, value, cellProperties.row, cellProperties.prop, source); + cellProperties.valid = valid; + done(valid); + Handsontable.hooks.run(instance, 'postAfterValidate', valid, value, cellProperties.row, cellProperties.prop, source); + }); + }, 0)); + } else { + cellProperties.valid = true; + done(cellProperties.valid); + } + }; + function setDataInputToArray(row, propOrCol, value) { + if (typeof row === 'object') { + return row; + } else { + return [[row, propOrCol, value]]; + } + } + this.setDataAtCell = function(row, col, value, source) { + var input = setDataInputToArray(row, col, value), + i, + ilen, + changes = [], + prop; + for (i = 0, ilen = input.length; i < ilen; i++) { + if (typeof input[i] !== 'object') { + throw new Error('Method `setDataAtCell` accepts row number or changes array of arrays as its first parameter'); + } + if (typeof input[i][1] !== 'number') { + throw new Error('Method `setDataAtCell` accepts row and column number as its parameters. If you want to use object property name, use method `setDataAtRowProp`'); + } + prop = datamap.colToProp(input[i][1]); + changes.push([input[i][0], prop, datamap.get(input[i][0], prop), input[i][2]]); + } + if (!source && typeof row === 'object') { + source = col; + } + validateChanges(changes, source, function() { + applyChanges(changes, source); + }); + }; + this.setDataAtRowProp = function(row, prop, value, source) { + var input = setDataInputToArray(row, prop, value), + i, + ilen, + changes = []; + for (i = 0, ilen = input.length; i < ilen; i++) { + changes.push([input[i][0], input[i][1], datamap.get(input[i][0], input[i][1]), input[i][2]]); + } + if (!source && typeof row === 'object') { + source = prop; + } + validateChanges(changes, source, function() { + applyChanges(changes, source); + }); + }; + this.listen = function() { + Handsontable.activeGuid = instance.guid; + }; + this.unlisten = function() { + Handsontable.activeGuid = null; + }; + this.isListening = function() { + return Handsontable.activeGuid === instance.guid; + }; + this.destroyEditor = function(revertOriginal) { + selection.refreshBorders(revertOriginal); + }; + this.populateFromArray = function(row, col, input, endRow, endCol, source, method, direction, deltas) { + var c; + if (!(typeof input === 'object' && typeof input[0] === 'object')) { + throw new Error('populateFromArray parameter `input` must be an array of arrays'); + } + c = typeof endRow === 'number' ? new WalkontableCellCoords(endRow, endCol) : null; + return grid.populateFromArray(new WalkontableCellCoords(row, col), input, c, source, method, direction, deltas); + }; + this.spliceCol = function(col, index, amount) { + return datamap.spliceCol.apply(datamap, arguments); + }; + this.spliceRow = function(row, index, amount) { + return datamap.spliceRow.apply(datamap, arguments); + }; + this.getSelected = function() { + if (selection.isSelected()) { + return [priv.selRange.from.row, priv.selRange.from.col, priv.selRange.to.row, priv.selRange.to.col]; + } + }; + this.getSelectedRange = function() { + if (selection.isSelected()) { + return priv.selRange; + } + }; + this.render = function() { + if (instance.view) { + instance.renderCall = true; + instance.forceFullRender = true; + selection.refreshBorders(null, true); + } + }; + this.loadData = function(data) { + if (typeof data === 'object' && data !== null) { + if (!(data.push && data.splice)) { + data = [data]; + } + } else if (data === null) { + data = []; + var row; + for (var r = 0, + rlen = priv.settings.startRows; r < rlen; r++) { + row = []; + for (var c = 0, + clen = priv.settings.startCols; c < clen; c++) { + row.push(null); + } + data.push(row); + } + } else { + throw new Error('loadData only accepts array of objects or array of arrays (' + typeof data + ' given)'); + } + priv.isPopulated = false; + GridSettings.prototype.data = data; + if (Array.isArray(priv.settings.dataSchema) || Array.isArray(data[0])) { + instance.dataType = 'array'; + } else if (typeof priv.settings.dataSchema === 'function') { + instance.dataType = 'function'; + } else { + instance.dataType = 'object'; + } + datamap = new DataMap(instance, priv, GridSettings); + dataSource.data = data; + dataSource.dataType = instance.dataType; + dataSource.colToProp = datamap.colToProp.bind(datamap); + dataSource.propToCol = datamap.propToCol.bind(datamap); + clearCellSettingCache(); + grid.adjustRowsAndCols(); + Handsontable.hooks.run(instance, 'afterLoadData', priv.firstRun); + if (priv.firstRun) { + priv.firstRun = [null, 'loadData']; + } else { + Handsontable.hooks.run(instance, 'afterChange', null, 'loadData'); + instance.render(); + } + priv.isPopulated = true; + function clearCellSettingCache() { + priv.cellSettings.length = 0; + } + }; + this.getData = function(r, c, r2, c2) { + if (typeof r === 'undefined') { + return datamap.getAll(); + } else { + return datamap.getRange(new WalkontableCellCoords(r, c), new WalkontableCellCoords(r2, c2), datamap.DESTINATION_RENDERER); + } + }; + this.getCopyableText = function(startRow, startCol, endRow, endCol) { + return datamap.getCopyableText(new WalkontableCellCoords(startRow, startCol), new WalkontableCellCoords(endRow, endCol)); + }; + this.getCopyableData = function(row, column) { + return datamap.getCopyable(row, datamap.colToProp(column)); + }; + this.getSchema = function() { + return datamap.getSchema(); + }; + this.updateSettings = function(settings, init) { + var i, + clen; + if (typeof settings.rows !== 'undefined') { + throw new Error('"rows" setting is no longer supported. do you mean startRows, minRows or maxRows?'); + } + if (typeof settings.cols !== 'undefined') { + throw new Error('"cols" setting is no longer supported. do you mean startCols, minCols or maxCols?'); + } + for (i in settings) { + if (i === 'data') { + continue; + } else { + if (Handsontable.hooks.getRegistered().indexOf(i) > -1) { + if (typeof settings[i] === 'function' || Array.isArray(settings[i])) { + instance.addHook(i, settings[i]); + } + } else { + if (!init && settings.hasOwnProperty(i)) { + GridSettings.prototype[i] = settings[i]; + } + } + } + } + if (settings.data === void 0 && priv.settings.data === void 0) { + instance.loadData(null); + } else if (settings.data !== void 0) { + instance.loadData(settings.data); + } else if (settings.columns !== void 0) { + datamap.createMap(); + } + clen = instance.countCols(); + priv.cellSettings.length = 0; + if (clen > 0) { + var proto, + column; + for (i = 0; i < clen; i++) { + priv.columnSettings[i] = columnFactory(GridSettings, priv.columnsSettingConflicts); + proto = priv.columnSettings[i].prototype; + if (GridSettings.prototype.columns) { + column = GridSettings.prototype.columns[i]; + extend(proto, column); + extend(proto, expandType(column)); + } + } + } + if (typeof settings.cell !== 'undefined') { + for (i in settings.cell) { + if (settings.cell.hasOwnProperty(i)) { + var cell = settings.cell[i]; + instance.setCellMetaObject(cell.row, cell.col, cell); + } + } + } + Handsontable.hooks.run(instance, 'afterCellMetaReset'); + if (typeof settings.className !== 'undefined') { + if (GridSettings.prototype.className) { + removeClass(instance.rootElement, GridSettings.prototype.className); + } + if (settings.className) { + addClass(instance.rootElement, settings.className); + } + } + if (typeof settings.height != 'undefined') { + var height = settings.height; + if (typeof height == 'function') { + height = height(); + } + instance.rootElement.style.height = height + 'px'; + } + if (typeof settings.width != 'undefined') { + var width = settings.width; + if (typeof width == 'function') { + width = width(); + } + instance.rootElement.style.width = width + 'px'; + } + if (height) { + instance.rootElement.style.overflow = 'hidden'; + } + if (!init) { + Handsontable.hooks.run(instance, 'afterUpdateSettings'); + } + grid.adjustRowsAndCols(); + if (instance.view && !priv.firstRun) { + instance.forceFullRender = true; + selection.refreshBorders(null, true); + } + }; + this.getValue = function() { + var sel = instance.getSelected(); + if (GridSettings.prototype.getValue) { + if (typeof GridSettings.prototype.getValue === 'function') { + return GridSettings.prototype.getValue.call(instance); + } else if (sel) { + return instance.getData()[sel[0]][GridSettings.prototype.getValue]; + } + } else if (sel) { + return instance.getDataAtCell(sel[0], sel[1]); + } + }; + function expandType(obj) { + if (!obj.hasOwnProperty('type')) { + return; + } + var type, + expandedType = {}; + if (typeof obj.type === 'object') { + type = obj.type; + } else if (typeof obj.type === 'string') { + type = Handsontable.cellTypes[obj.type]; + if (type === void 0) { + throw new Error('You declared cell type "' + obj.type + '" as a string that is not mapped to a known object. Cell type must be an object or a string mapped to an object in Handsontable.cellTypes'); + } + } + for (var i in type) { + if (type.hasOwnProperty(i) && !obj.hasOwnProperty(i)) { + expandedType[i] = type[i]; + } + } + return expandedType; + } + this.getSettings = function() { + return priv.settings; + }; + this.clear = function() { + selection.selectAll(); + selection.empty(); + }; + this.alter = function(action, index, amount, source, keepEmptyRows) { + grid.alter(action, index, amount, source, keepEmptyRows); + }; + this.getCell = function(row, col, topmost) { + return instance.view.getCellAtCoords(new WalkontableCellCoords(row, col), topmost); + }; + this.getCoords = function(elem) { + return this.view.wt.wtTable.getCoords.call(this.view.wt.wtTable, elem); + }; + this.colToProp = function(col) { + return datamap.colToProp(col); + }; + this.propToCol = function(prop) { + return datamap.propToCol(prop); + }; + this.getDataAtCell = function(row, col) { + return datamap.get(row, datamap.colToProp(col)); + }; + this.getDataAtRowProp = function(row, prop) { + return datamap.get(row, prop); + }; + this.getDataAtCol = function(col) { + var out = []; + return out.concat.apply(out, datamap.getRange(new WalkontableCellCoords(0, col), new WalkontableCellCoords(priv.settings.data.length - 1, col), datamap.DESTINATION_RENDERER)); + }; + this.getDataAtProp = function(prop) { + var out = [], + range; + range = datamap.getRange(new WalkontableCellCoords(0, datamap.propToCol(prop)), new WalkontableCellCoords(priv.settings.data.length - 1, datamap.propToCol(prop)), datamap.DESTINATION_RENDERER); + return out.concat.apply(out, range); + }; + this.getSourceData = function(r, c, r2, c2) { + var data; + if (r === void 0) { + data = dataSource.getData(); + } else { + data = dataSource.getByRange(new WalkontableCellCoords(r, c), new WalkontableCellCoords(r2, c2)); + } + return data; + }; + this.getSourceDataAtCol = function(column) { + return dataSource.getAtColumn(column); + }; + this.getSourceDataAtRow = function(row) { + return dataSource.getAtRow(row); + }; + this.getSourceDataAtCell = function(row, column) { + return dataSource.getAtCell(row, column); + }; + this.getDataAtRow = function(row) { + var data = datamap.getRange(new WalkontableCellCoords(row, 0), new WalkontableCellCoords(row, this.countCols() - 1), datamap.DESTINATION_RENDERER); + return data[0]; + }; + this.getDataType = function(rowFrom, columnFrom, rowTo, columnTo) { + var $__19 = this; + var previousType = null; + var currentType = null; + if (rowFrom === void 0) { + rowFrom = 0; + rowTo = this.countRows(); + columnFrom = 0; + columnTo = this.countCols(); + } + if (rowTo === void 0) { + rowTo = rowFrom; + } + if (columnTo === void 0) { + columnTo = columnFrom; + } + var type = 'mixed'; + rangeEach(Math.min(rowFrom, rowTo), Math.max(rowFrom, rowTo), (function(row) { + var isTypeEqual = true; + rangeEach(Math.min(columnFrom, columnTo), Math.max(columnFrom, columnTo), (function(column) { + var cellType = $__19.getCellMeta(row, column); + currentType = cellType.type; + if (previousType) { + isTypeEqual = previousType === currentType; + } else { + previousType = currentType; + } + return isTypeEqual; + })); + type = isTypeEqual ? currentType : 'mixed'; + return isTypeEqual; + })); + return type; + }; + this.removeCellMeta = function(row, col, key) { + var cellMeta = instance.getCellMeta(row, col); + if (cellMeta[key] != undefined) { + delete priv.cellSettings[row][col][key]; + } + }; + this.setCellMetaObject = function(row, col, prop) { + if (typeof prop === 'object') { + for (var key in prop) { + if (prop.hasOwnProperty(key)) { + var value = prop[key]; + this.setCellMeta(row, col, key, value); + } + } + } + }; + this.setCellMeta = function(row, col, key, val) { + if (!priv.cellSettings[row]) { + priv.cellSettings[row] = []; + } + if (!priv.cellSettings[row][col]) { + priv.cellSettings[row][col] = new priv.columnSettings[col](); + } + priv.cellSettings[row][col][key] = val; + Handsontable.hooks.run(instance, 'afterSetCellMeta', row, col, key, val); + }; + this.getCellsMeta = function() { + return arrayFlatten(priv.cellSettings); + }; + this.getCellMeta = function(row, col) { + var prop = datamap.colToProp(col), + cellProperties; + var physicalRow = row; + var physicalCol = col; + row = translateRowIndex(row); + col = translateColIndex(col); + if (!priv.columnSettings[col]) { + priv.columnSettings[col] = columnFactory(GridSettings, priv.columnsSettingConflicts); + } + if (!priv.cellSettings[row]) { + priv.cellSettings[row] = []; + } + if (!priv.cellSettings[row][col]) { + priv.cellSettings[row][col] = new priv.columnSettings[col](); + } + cellProperties = priv.cellSettings[row][col]; + cellProperties.row = row; + cellProperties.col = col; + cellProperties.physicalRow = physicalRow; + cellProperties.physicalCol = physicalCol; + cellProperties.prop = prop; + cellProperties.instance = instance; + Handsontable.hooks.run(instance, 'beforeGetCellMeta', row, col, cellProperties); + extend(cellProperties, expandType(cellProperties)); + if (cellProperties.cells) { + var settings = cellProperties.cells.call(cellProperties, row, col, prop); + if (settings) { + extend(cellProperties, settings); + extend(cellProperties, expandType(settings)); + } + } + Handsontable.hooks.run(instance, 'afterGetCellMeta', row, col, cellProperties); + return cellProperties; + }; + this.isColumnModificationAllowed = function() { + return !(instance.dataType === 'object' || instance.getSettings().columns); + }; + function translateRowIndex(row) { + return Handsontable.hooks.run(instance, 'modifyRow', row); + } + function translateColIndex(col) { + return Handsontable.hooks.run(instance, 'modifyCol', col); + } + var rendererLookup = cellMethodLookupFactory('renderer'); + this.getCellRenderer = function(row, col) { + var renderer = rendererLookup.call(this, row, col); + return getRenderer(renderer); + }; + this.getCellEditor = cellMethodLookupFactory('editor'); + this.getCellValidator = cellMethodLookupFactory('validator'); + this.validateCells = function(callback) { + var waitingForValidator = new ValidatorsQueue(); + waitingForValidator.onQueueEmpty = callback; + var i = instance.countRows() - 1; + while (i >= 0) { + var j = instance.countCols() - 1; + while (j >= 0) { + waitingForValidator.addValidatorToQueue(); + instance.validateCell(instance.getDataAtCell(i, j), instance.getCellMeta(i, j), function(result) { + if (typeof result !== 'boolean') { + throw new Error('Validation error: result is not boolean'); + } + if (result === false) { + waitingForValidator.valid = false; + } + waitingForValidator.removeValidatorFormQueue(); + }, 'validateCells'); + j--; + } + i--; + } + waitingForValidator.checkIfQueueIsEmpty(); + }; + this.getRowHeader = function(row) { + var rowHeader = priv.settings.rowHeaders; + if (row !== void 0) { + row = Handsontable.hooks.run(instance, 'modifyRowHeader', row); + } + if (row === void 0) { + rowHeader = []; + rangeEach(instance.countRows() - 1, (function(i) { + rowHeader.push(instance.getRowHeader(i)); + })); + } else if (Array.isArray(rowHeader) && rowHeader[row] !== void 0) { + rowHeader = rowHeader[row]; + } else if (typeof rowHeader === 'function') { + rowHeader = rowHeader(row); + } else if (rowHeader && typeof rowHeader !== 'string' && typeof rowHeader !== 'number') { + rowHeader = row + 1; + } + return rowHeader; + }; + this.hasRowHeaders = function() { + return !!priv.settings.rowHeaders; + }; + this.hasColHeaders = function() { + if (priv.settings.colHeaders !== void 0 && priv.settings.colHeaders !== null) { + return !!priv.settings.colHeaders; + } + for (var i = 0, + ilen = instance.countCols(); i < ilen; i++) { + if (instance.getColHeader(i)) { + return true; + } + } + return false; + }; + this.getColHeader = function(col) { + col = Handsontable.hooks.run(instance, 'modifyColHeader', col); + if (col === void 0) { + var out = []; + for (var i = 0, + ilen = instance.countCols(); i < ilen; i++) { + out.push(instance.getColHeader(i)); + } + return out; + } else { + var baseCol = col; + col = Handsontable.hooks.run(instance, 'modifyCol', col); + if (priv.settings.columns && priv.settings.columns[col] && priv.settings.columns[col].title) { + return priv.settings.columns[col].title; + } else if (Array.isArray(priv.settings.colHeaders) && priv.settings.colHeaders[col] !== void 0) { + return priv.settings.colHeaders[col]; + } else if (typeof priv.settings.colHeaders === 'function') { + return priv.settings.colHeaders(col); + } else if (priv.settings.colHeaders && typeof priv.settings.colHeaders !== 'string' && typeof priv.settings.colHeaders !== 'number') { + return spreadsheetColumnLabel(baseCol); + } else { + return priv.settings.colHeaders; + } + } + }; + this._getColWidthFromSettings = function(col) { + var cellProperties = instance.getCellMeta(0, col); + var width = cellProperties.width; + if (width === void 0 || width === priv.settings.width) { + width = cellProperties.colWidths; + } + if (width !== void 0 && width !== null) { + switch (typeof width) { + case 'object': + width = width[col]; + break; + case 'function': + width = width(col); + break; + } + if (typeof width === 'string') { + width = parseInt(width, 10); + } + } + return width; + }; + this.getColWidth = function(col) { + var width = instance._getColWidthFromSettings(col); + width = Handsontable.hooks.run(instance, 'modifyColWidth', width, col); + if (width === void 0) { + width = WalkontableViewportColumnsCalculator.DEFAULT_WIDTH; + } + return width; + }; + this._getRowHeightFromSettings = function(row) { + var height = priv.settings.rowHeights; + if (height !== void 0 && height !== null) { + switch (typeof height) { + case 'object': + height = height[row]; + break; + case 'function': + height = height(row); + break; + } + if (typeof height === 'string') { + height = parseInt(height, 10); + } + } + return height; + }; + this.getRowHeight = function(row) { + var height = instance._getRowHeightFromSettings(row); + height = Handsontable.hooks.run(instance, 'modifyRowHeight', height, row); + return height; + }; + this.countSourceRows = function() { + return instance.getSourceData() ? instance.getSourceData().length : 0; + }; + this.countRows = function() { + return datamap.getLength(); + }; + this.countCols = function() { + if (instance.dataType === 'object' || instance.dataType === 'function') { + if (priv.settings.columns && priv.settings.columns.length) { + return priv.settings.columns.length; + } else { + return datamap.colToPropCache.length; + } + } else if (instance.dataType === 'array') { + if (priv.settings.columns && priv.settings.columns.length) { + return priv.settings.columns.length; + } else if (priv.settings.data && priv.settings.data[0] && priv.settings.data[0].length) { + return priv.settings.data[0].length; + } else { + return 0; + } + } + }; + this.getColspanOffset = function(col, level) { + var colspanSum = 0; + if (instance.colspanArray) { + for (var i = 0; i < col; i++) { + colspanSum += instance.colspanArray[level][i] - 1 || 0; + } + return colspanSum; + } + var colspanSum = 0; + var TRindex = instance.view.wt.wtTable.THEAD.childNodes.length - level - 1; + var TR = instance.view.wt.wtTable.THEAD.querySelector('tr:nth-child(' + parseInt(TRindex + 1, 10) + ')'); + var rowHeadersCount = instance.view.wt.wtSettings.settings.rowHeaders().length; + for (var i = rowHeadersCount; i < rowHeadersCount + col; i++) { + if (TR.childNodes[i].hasAttribute('colspan')) { + colspanSum += parseInt(TR.childNodes[i].getAttribute('colspan'), 10) - 1; + } + } + return colspanSum; + }; + this.getHeaderColspan = function(col, level) { + var TRindex = instance.view.wt.wtTable.THEAD.childNodes.length - level - 1; + var rowHeadersCount = instance.view.wt.wtSettings.settings.rowHeaders().length; + var TR = instance.view.wt.wtTable.THEAD.querySelector('tr:nth-child(' + parseInt(TRindex + 1, 10) + ')'); + var offsettedColIndex = rowHeadersCount + col - instance.view.wt.wtViewport.columnsRenderCalculator.startColumn; + if (TR.childNodes[offsettedColIndex].hasAttribute('colspan')) { + return parseInt(TR.childNodes[offsettedColIndex].getAttribute('colspan'), 10); + } + return 0; + }; + this.rowOffset = function() { + return instance.view.wt.wtTable.getFirstRenderedRow(); + }; + this.colOffset = function() { + return instance.view.wt.wtTable.getFirstRenderedColumn(); + }; + this.countRenderedRows = function() { + return instance.view.wt.drawn ? instance.view.wt.wtTable.getRenderedRowsCount() : -1; + }; + this.countVisibleRows = function() { + return instance.view.wt.drawn ? instance.view.wt.wtTable.getVisibleRowsCount() : -1; + }; + this.countRenderedCols = function() { + return instance.view.wt.drawn ? instance.view.wt.wtTable.getRenderedColumnsCount() : -1; + }; + this.countVisibleCols = function() { + return instance.view.wt.drawn ? instance.view.wt.wtTable.getVisibleColumnsCount() : -1; + }; + this.countEmptyRows = function(ending) { + var i = instance.countRows() - 1, + empty = 0, + row; + while (i >= 0) { + row = Handsontable.hooks.run(this, 'modifyRow', i); + if (instance.isEmptyRow(row)) { + empty++; + } else if (ending) { + break; + } + i--; + } + return empty; + }; + this.countEmptyCols = function(ending) { + if (instance.countRows() < 1) { + return 0; + } + var i = instance.countCols() - 1, + empty = 0; + while (i >= 0) { + if (instance.isEmptyCol(i)) { + empty++; + } else if (ending) { + break; + } + i--; + } + return empty; + }; + this.isEmptyRow = function(row) { + return priv.settings.isEmptyRow.call(instance, row); + }; + this.isEmptyCol = function(col) { + return priv.settings.isEmptyCol.call(instance, col); + }; + this.selectCell = function(row, col, endRow, endCol, scrollToCell, changeListener) { + var coords; + changeListener = typeof changeListener === 'undefined' || changeListener === true; + if (typeof row !== 'number' || row < 0 || row >= instance.countRows()) { + return false; + } + if (typeof col !== 'number' || col < 0 || col >= instance.countCols()) { + return false; + } + if (typeof endRow !== 'undefined') { + if (typeof endRow !== 'number' || endRow < 0 || endRow >= instance.countRows()) { + return false; + } + if (typeof endCol !== 'number' || endCol < 0 || endCol >= instance.countCols()) { + return false; + } + } + coords = new WalkontableCellCoords(row, col); + priv.selRange = new WalkontableCellRange(coords, coords, coords); + if (changeListener) { + instance.listen(); + } + if (typeof endRow === 'undefined') { + selection.setRangeEnd(priv.selRange.from, scrollToCell); + } else { + selection.setRangeEnd(new WalkontableCellCoords(endRow, endCol), scrollToCell); + } + instance.selection.finish(); + return true; + }; + this.selectCellByProp = function(row, prop, endRow, endProp, scrollToCell) { + arguments[1] = datamap.propToCol(arguments[1]); + if (typeof arguments[3] !== 'undefined') { + arguments[3] = datamap.propToCol(arguments[3]); + } + return instance.selectCell.apply(instance, arguments); + }; + this.deselectCell = function() { + selection.deselect(); + }; + this.destroy = function() { + instance._clearTimeouts(); + if (instance.view) { + instance.view.destroy(); + } + if (dataSource) { + dataSource.destroy(); + } + dataSource = null; + empty(instance.rootElement); + eventManager.destroy(); + Handsontable.hooks.run(instance, 'afterDestroy'); + Handsontable.hooks.destroy(instance); + for (var i in instance) { + if (instance.hasOwnProperty(i)) { + if (typeof instance[i] === 'function') { + instance[i] = postMortem; + } else if (i !== 'guid') { + instance[i] = null; + } + } + } + priv = null; + datamap = null; + grid = null; + selection = null; + editorManager = null; + instance = null; + GridSettings = null; + }; + function postMortem() { + throw new Error('This method cannot be called because this Handsontable instance has been destroyed'); + } + this.getActiveEditor = function() { + return editorManager.getActiveEditor(); + }; + this.getPlugin = function(pluginName) { + return getPlugin(this, pluginName); + }; + this.getInstance = function() { + return instance; + }; + this.addHook = function(key, callback) { + Handsontable.hooks.add(key, callback, instance); + }; + this.hasHook = function(key) { + return Handsontable.hooks.has(key, instance); + }; + this.addHookOnce = function(key, callback) { + Handsontable.hooks.once(key, callback, instance); + }; + this.removeHook = function(key, callback) { + Handsontable.hooks.remove(key, callback, instance); + }; + this.runHooks = function(key, p1, p2, p3, p4, p5, p6) { + return Handsontable.hooks.run(instance, key, p1, p2, p3, p4, p5, p6); + }; + this.timeouts = []; + this._registerTimeout = function(handle) { + this.timeouts.push(handle); + }; + this._clearTimeouts = function() { + for (var i = 0, + ilen = this.timeouts.length; i < ilen; i++) { + clearTimeout(this.timeouts[i]); + } + }; + this.version = Handsontable.version; + Handsontable.hooks.run(instance, 'construct'); +}; +var DefaultSettings = function() {}; +DefaultSettings.prototype = { + data: void 0, + dataSchema: void 0, + width: void 0, + height: void 0, + startRows: 5, + startCols: 5, + rowHeaders: null, + colHeaders: null, + colWidths: void 0, + rowHeights: void 0, + columns: void 0, + cells: void 0, + cell: [], + comments: false, + customBorders: false, + minRows: 0, + minCols: 0, + maxRows: Infinity, + maxCols: Infinity, + minSpareRows: 0, + minSpareCols: 0, + allowInsertRow: true, + allowInsertColumn: true, + allowRemoveRow: true, + allowRemoveColumn: true, + multiSelect: true, + fillHandle: true, + fixedRowsTop: 0, + fixedRowsBottom: 0, + fixedColumnsLeft: 0, + outsideClickDeselects: true, + enterBeginsEditing: true, + enterMoves: { + row: 1, + col: 0 + }, + tabMoves: { + row: 0, + col: 1 + }, + autoWrapRow: false, + autoWrapCol: false, + copyRowsLimit: 1000, + copyColsLimit: 1000, + pasteMode: 'overwrite', + persistentState: false, + currentRowClassName: void 0, + currentColClassName: void 0, + className: void 0, + tableClassName: void 0, + stretchH: 'none', + isEmptyRow: function(row) { + var col, + colLen, + value, + meta; + for (col = 0, colLen = this.countCols(); col < colLen; col++) { + value = this.getDataAtCell(row, col); + if (value !== '' && value !== null && typeof value !== 'undefined') { + if (typeof value === 'object') { + meta = this.getCellMeta(row, col); + return isObjectEquals(this.getSchema()[meta.prop], value); + } + return false; + } + } + return true; + }, + isEmptyCol: function(col) { + var row, + rowLen, + value; + for (row = 0, rowLen = this.countRows(); row < rowLen; row++) { + value = this.getDataAtCell(row, col); + if (value !== '' && value !== null && typeof value !== 'undefined') { + return false; + } + } + return true; + }, + observeDOMVisibility: true, + allowInvalid: true, + invalidCellClassName: 'htInvalid', + placeholder: false, + placeholderCellClassName: 'htPlaceholder', + readOnlyCellClassName: 'htDimmed', + renderer: void 0, + commentedCellClassName: 'htCommentCell', + fragmentSelection: false, + readOnly: false, + skipColumnOnPaste: false, + search: false, + type: 'text', + copyable: true, + editor: void 0, + autoComplete: void 0, + visibleRows: 10, + trimDropdown: true, + debug: false, + wordWrap: true, + noWordWrapClassName: 'htNoWrap', + contextMenu: void 0, + contextMenuCopyPaste: void 0, + copyPaste: void 0, + undo: void 0, + columnSorting: void 0, + manualColumnMove: void 0, + manualColumnResize: void 0, + manualRowMove: void 0, + manualRowResize: void 0, + mergeCells: false, + viewportRowRenderingOffset: 'auto', + viewportColumnRenderingOffset: 'auto', + validator: void 0, + disableVisualSelection: false, + sortIndicator: false, + manualColumnFreeze: void 0, + trimWhitespace: true, + settings: void 0, + source: void 0, + title: void 0, + checkedTemplate: void 0, + uncheckedTemplate: void 0, + label: void 0, + format: void 0, + language: void 0, + selectOptions: void 0, + autoColumnSize: void 0, + autoRowSize: void 0, + dateFormat: void 0, + correctFormat: false, + defaultDate: void 0, + strict: void 0, + renderAllRows: void 0 +}; +Handsontable.DefaultSettings = DefaultSettings; + +//# +},{"3rdparty/walkontable/src/calculator/viewportColumns":3,"3rdparty/walkontable/src/cell/coords":5,"3rdparty/walkontable/src/cell/range":6,"3rdparty/walkontable/src/selection":18,"dataMap":26,"dataSource":27,"editorManager":28,"eventManager":41,"helpers/array":42,"helpers/data":44,"helpers/dom/element":45,"helpers/number":49,"helpers/object":50,"helpers/setting":51,"helpers/string":52,"numeral":"numeral","plugins":57,"renderers":88,"tableView":97}],26:[function(require,module,exports){ +"use strict"; +Object.defineProperties(exports, { + DataMap: {get: function() { + return DataMap; + }}, + __esModule: {value: true} +}); +var $__SheetClip__, + $__helpers_47_data__, + $__helpers_47_setting__, + $__helpers_47_object__, + $__helpers_47_array__, + $__helpers_47_number__, + $__multiMap__; +var SheetClip = ($__SheetClip__ = require("SheetClip"), $__SheetClip__ && $__SheetClip__.__esModule && $__SheetClip__ || {default: $__SheetClip__}).default; +var cellMethodLookupFactory = ($__helpers_47_data__ = require("helpers/data"), $__helpers_47_data__ && $__helpers_47_data__.__esModule && $__helpers_47_data__ || {default: $__helpers_47_data__}).cellMethodLookupFactory; +var columnFactory = ($__helpers_47_setting__ = require("helpers/setting"), $__helpers_47_setting__ && $__helpers_47_setting__.__esModule && $__helpers_47_setting__ || {default: $__helpers_47_setting__}).columnFactory; +var $__3 = ($__helpers_47_object__ = require("helpers/object"), $__helpers_47_object__ && $__helpers_47_object__.__esModule && $__helpers_47_object__ || {default: $__helpers_47_object__}), + duckSchema = $__3.duckSchema, + deepExtend = $__3.deepExtend; +var $__4 = ($__helpers_47_array__ = require("helpers/array"), $__helpers_47_array__ && $__helpers_47_array__.__esModule && $__helpers_47_array__ || {default: $__helpers_47_array__}), + extendArray = $__4.extendArray, + to2dArray = $__4.to2dArray; +var rangeEach = ($__helpers_47_number__ = require("helpers/number"), $__helpers_47_number__ && $__helpers_47_number__.__esModule && $__helpers_47_number__ || {default: $__helpers_47_number__}).rangeEach; +var MultiMap = ($__multiMap__ = require("multiMap"), $__multiMap__ && $__multiMap__.__esModule && $__multiMap__ || {default: $__multiMap__}).MultiMap; +function DataMap(instance, priv, GridSettings) { + this.instance = instance; + this.priv = priv; + this.GridSettings = GridSettings; + this.dataSource = this.instance.getSettings().data; + if (this.dataSource[0]) { + this.duckSchema = this.recursiveDuckSchema(this.dataSource[0]); + } else { + this.duckSchema = {}; + } + this.createMap(); +} +DataMap.prototype.DESTINATION_RENDERER = 1; +DataMap.prototype.DESTINATION_CLIPBOARD_GENERATOR = 2; +DataMap.prototype.recursiveDuckSchema = function(object) { + return duckSchema(object); +}; +DataMap.prototype.recursiveDuckColumns = function(schema, lastCol, parent) { + var prop, + i; + if (typeof lastCol === 'undefined') { + lastCol = 0; + parent = ''; + } + if (typeof schema === 'object' && !Array.isArray(schema)) { + for (i in schema) { + if (schema.hasOwnProperty(i)) { + if (schema[i] === null) { + prop = parent + i; + this.colToPropCache.push(prop); + this.propToColCache.set(prop, lastCol); + lastCol++; + } else { + lastCol = this.recursiveDuckColumns(schema[i], lastCol, i + '.'); + } + } + } + } + return lastCol; +}; +DataMap.prototype.createMap = function() { + var i, + ilen, + schema = this.getSchema(); + if (typeof schema === 'undefined') { + throw new Error('trying to create `columns` definition but you didnt\' provide `schema` nor `data`'); + } + this.colToPropCache = []; + this.propToColCache = new MultiMap(); + var columns = this.instance.getSettings().columns; + if (columns) { + for (i = 0, ilen = columns.length; i < ilen; i++) { + if (typeof columns[i].data != 'undefined') { + this.colToPropCache[i] = columns[i].data; + this.propToColCache.set(columns[i].data, i); + } + } + } else { + this.recursiveDuckColumns(schema); + } +}; +DataMap.prototype.colToProp = function(col) { + col = Handsontable.hooks.run(this.instance, 'modifyCol', col); + if (this.colToPropCache && typeof this.colToPropCache[col] !== 'undefined') { + return this.colToPropCache[col]; + } + return col; +}; +DataMap.prototype.propToCol = function(prop) { + var col; + if (typeof this.propToColCache.get(prop) === 'undefined') { + col = prop; + } else { + col = this.propToColCache.get(prop); + } + col = Handsontable.hooks.run(this.instance, 'modifyCol', col); + return col; +}; +DataMap.prototype.getSchema = function() { + var schema = this.instance.getSettings().dataSchema; + if (schema) { + if (typeof schema === 'function') { + return schema(); + } + return schema; + } + return this.duckSchema; +}; +DataMap.prototype.createRow = function(index, amount, createdAutomatically) { + var row, + colCount = this.instance.countCols(), + numberOfCreatedRows = 0, + currentIndex; + if (!amount) { + amount = 1; + } + if (typeof index !== 'number' || index >= this.instance.countSourceRows()) { + index = this.instance.countSourceRows(); + } + currentIndex = index; + var maxRows = this.instance.getSettings().maxRows; + while (numberOfCreatedRows < amount && this.instance.countSourceRows() < maxRows) { + if (this.instance.dataType === 'array') { + row = []; + for (var c = 0; c < colCount; c++) { + row.push(null); + } + } else if (this.instance.dataType === 'function') { + row = this.instance.getSettings().dataSchema(index); + } else { + row = {}; + deepExtend(row, this.getSchema()); + } + if (index === this.instance.countSourceRows()) { + this.dataSource.push(row); + } else { + this.dataSource.splice(index, 0, row); + } + numberOfCreatedRows++; + currentIndex++; + } + Handsontable.hooks.run(this.instance, 'afterCreateRow', index, numberOfCreatedRows, createdAutomatically); + this.instance.forceFullRender = true; + return numberOfCreatedRows; +}; +DataMap.prototype.createCol = function(index, amount, createdAutomatically) { + if (!this.instance.isColumnModificationAllowed()) { + throw new Error('Cannot create new column. When data source in an object, ' + 'you can only have as much columns as defined in first data row, data schema or in the \'columns\' setting.' + 'If you want to be able to add new columns, you have to use array datasource.'); + } + var rlen = this.instance.countSourceRows(), + data = this.dataSource, + constructor, + numberOfCreatedCols = 0, + currentIndex; + if (!amount) { + amount = 1; + } + currentIndex = index; + var maxCols = this.instance.getSettings().maxCols; + while (numberOfCreatedCols < amount && this.instance.countCols() < maxCols) { + constructor = columnFactory(this.GridSettings, this.priv.columnsSettingConflicts); + if (typeof index !== 'number' || index >= this.instance.countCols()) { + for (var r = 0; r < rlen; r++) { + if (typeof data[r] === 'undefined') { + data[r] = []; + } + data[r].push(null); + } + this.priv.columnSettings.push(constructor); + } else { + for (var r = 0; r < rlen; r++) { + data[r].splice(currentIndex, 0, null); + } + this.priv.columnSettings.splice(currentIndex, 0, constructor); + } + numberOfCreatedCols++; + currentIndex++; + } + Handsontable.hooks.run(this.instance, 'afterCreateCol', index, numberOfCreatedCols, createdAutomatically); + this.instance.forceFullRender = true; + return numberOfCreatedCols; +}; +DataMap.prototype.removeRow = function(index, amount) { + if (!amount) { + amount = 1; + } + if (typeof index !== 'number') { + index = -amount; + } + index = (this.instance.countSourceRows() + index) % this.instance.countSourceRows(); + var logicRows = this.physicalRowsToLogical(index, amount); + var actionWasNotCancelled = Handsontable.hooks.run(this.instance, 'beforeRemoveRow', index, amount, logicRows); + if (actionWasNotCancelled === false) { + return; + } + var data = this.dataSource; + var newData = data.filter(function(row, index) { + return logicRows.indexOf(index) == -1; + }); + data.length = 0; + Array.prototype.push.apply(data, newData); + Handsontable.hooks.run(this.instance, 'afterRemoveRow', index, amount, logicRows); + this.instance.forceFullRender = true; +}; +DataMap.prototype.removeCol = function(index, amount) { + if (this.instance.dataType === 'object' || this.instance.getSettings().columns) { + throw new Error('cannot remove column with object data source or columns option specified'); + } + if (!amount) { + amount = 1; + } + if (typeof index !== 'number') { + index = -amount; + } + index = (this.instance.countCols() + index) % this.instance.countCols(); + var actionWasNotCancelled = Handsontable.hooks.run(this.instance, 'beforeRemoveCol', index, amount); + if (actionWasNotCancelled === false) { + return; + } + var data = this.dataSource; + for (var r = 0, + rlen = this.instance.countSourceRows(); r < rlen; r++) { + data[r].splice(index, amount); + } + this.priv.columnSettings.splice(index, amount); + Handsontable.hooks.run(this.instance, 'afterRemoveCol', index, amount); + this.instance.forceFullRender = true; +}; +DataMap.prototype.spliceCol = function(col, index, amount) { + var elements = 4 <= arguments.length ? [].slice.call(arguments, 3) : []; + var colData = this.instance.getDataAtCol(col); + var removed = colData.slice(index, index + amount); + var after = colData.slice(index + amount); + extendArray(elements, after); + var i = 0; + while (i < amount) { + elements.push(null); + i++; + } + to2dArray(elements); + this.instance.populateFromArray(index, col, elements, null, null, 'spliceCol'); + return removed; +}; +DataMap.prototype.spliceRow = function(row, index, amount) { + var elements = 4 <= arguments.length ? [].slice.call(arguments, 3) : []; + var rowData = this.instance.getSourceDataAtRow(row); + var removed = rowData.slice(index, index + amount); + var after = rowData.slice(index + amount); + extendArray(elements, after); + var i = 0; + while (i < amount) { + elements.push(null); + i++; + } + this.instance.populateFromArray(row, index, [elements], null, null, 'spliceRow'); + return removed; +}; +DataMap.prototype.get = function(row, prop) { + row = Handsontable.hooks.run(this.instance, 'modifyRow', row); + if (typeof prop === 'string' && prop.indexOf('.') > -1) { + var sliced = prop.split('.'); + var out = this.dataSource[row]; + if (!out) { + return null; + } + for (var i = 0, + ilen = sliced.length; i < ilen; i++) { + out = out[sliced[i]]; + if (typeof out === 'undefined') { + return null; + } + } + return out; + } else if (typeof prop === 'function') { + return prop(this.dataSource.slice(row, row + 1)[0]); + } + if (this.dataSource[row] && this.dataSource[row].hasOwnProperty && this.dataSource[row].hasOwnProperty(prop)) { + return this.dataSource[row][prop]; + } + return null; +}; +var copyableLookup = cellMethodLookupFactory('copyable', false); +DataMap.prototype.getCopyable = function(row, prop) { + if (copyableLookup.call(this.instance, row, this.propToCol(prop))) { + return this.get(row, prop); + } + return ''; +}; +DataMap.prototype.set = function(row, prop, value, source) { + row = Handsontable.hooks.run(this.instance, 'modifyRow', row, source || 'datamapGet'); + if (typeof prop === 'string' && prop.indexOf('.') > -1) { + var sliced = prop.split('.'); + var out = this.dataSource[row]; + for (var i = 0, + ilen = sliced.length - 1; i < ilen; i++) { + if (typeof out[sliced[i]] === 'undefined') { + out[sliced[i]] = {}; + } + out = out[sliced[i]]; + } + out[sliced[i]] = value; + } else if (typeof prop === 'function') { + prop(this.dataSource.slice(row, row + 1)[0], value); + } else { + this.dataSource[row][prop] = value; + } +}; +DataMap.prototype.physicalRowsToLogical = function(index, amount) { + var totalRows = this.instance.countSourceRows(); + var physicRow = (totalRows + index) % totalRows; + var logicRows = []; + var rowsToRemove = amount; + var row; + while (physicRow < totalRows && rowsToRemove) { + row = Handsontable.hooks.run(this.instance, 'modifyRow', physicRow); + logicRows.push(row); + rowsToRemove--; + physicRow++; + } + return logicRows; +}; +DataMap.prototype.clear = function() { + for (var r = 0; r < this.instance.countSourceRows(); r++) { + for (var c = 0; c < this.instance.countCols(); c++) { + this.set(r, this.colToProp(c), ''); + } + } +}; +DataMap.prototype.getLength = function() { + var $__7 = this; + var length = this.instance.countSourceRows(); + if (Handsontable.hooks.has('modifyRow', this.instance)) { + rangeEach(this.instance.countSourceRows() - 1, (function(row) { + row = Handsontable.hooks.run($__7.instance, 'modifyRow', row); + if (row === null) { + length--; + } + })); + } + return length; +}; +DataMap.prototype.getAll = function() { + var start = { + row: 0, + col: 0 + }; + var end = { + row: Math.max(this.instance.countSourceRows() - 1, 0), + col: Math.max(this.instance.countCols() - 1, 0) + }; + if (start.row - end.row === 0 && !this.instance.countSourceRows()) { + return []; + } + return this.getRange(start, end, DataMap.prototype.DESTINATION_RENDERER); +}; +DataMap.prototype.getRange = function(start, end, destination) { + var r, + rlen, + c, + clen, + output = [], + row, + rowExists; + var getFn = destination === this.DESTINATION_CLIPBOARD_GENERATOR ? this.getCopyable : this.get; + rlen = Math.max(start.row, end.row); + clen = Math.max(start.col, end.col); + for (r = Math.min(start.row, end.row); r <= rlen; r++) { + row = []; + var physicalRow = Handsontable.hooks.run(this.instance, 'modifyRow', r); + for (c = Math.min(start.col, end.col); c <= clen; c++) { + var rowValue; + if (physicalRow === null) { + break; + } + row.push(getFn.call(this, r, this.colToProp(c))); + } + if (physicalRow !== null) { + output.push(row); + } + } + return output; +}; +DataMap.prototype.getText = function(start, end) { + return SheetClip.stringify(this.getRange(start, end, this.DESTINATION_RENDERER)); +}; +DataMap.prototype.getCopyableText = function(start, end) { + return SheetClip.stringify(this.getRange(start, end, this.DESTINATION_CLIPBOARD_GENERATOR)); +}; +; +Handsontable.DataMap = DataMap; + +//# +},{"SheetClip":"SheetClip","helpers/array":42,"helpers/data":44,"helpers/number":49,"helpers/object":50,"helpers/setting":51,"multiMap":55}],27:[function(require,module,exports){ +"use strict"; +Object.defineProperties(exports, { + DataSource: {get: function() { + return DataSource; + }}, + __esModule: {value: true} +}); +var $__helpers_47_data__, + $__helpers_47_setting__, + $__helpers_47_object__, + $__helpers_47_array__, + $__helpers_47_number__; +var cellMethodLookupFactory = ($__helpers_47_data__ = require("helpers/data"), $__helpers_47_data__ && $__helpers_47_data__.__esModule && $__helpers_47_data__ || {default: $__helpers_47_data__}).cellMethodLookupFactory; +var columnFactory = ($__helpers_47_setting__ = require("helpers/setting"), $__helpers_47_setting__ && $__helpers_47_setting__.__esModule && $__helpers_47_setting__ || {default: $__helpers_47_setting__}).columnFactory; +var $__2 = ($__helpers_47_object__ = require("helpers/object"), $__helpers_47_object__ && $__helpers_47_object__.__esModule && $__helpers_47_object__ || {default: $__helpers_47_object__}), + duckSchema = $__2.duckSchema, + deepExtend = $__2.deepExtend, + getProperty = $__2.getProperty; +var $__3 = ($__helpers_47_array__ = require("helpers/array"), $__helpers_47_array__ && $__helpers_47_array__.__esModule && $__helpers_47_array__ || {default: $__helpers_47_array__}), + extendArray = $__3.extendArray, + arrayEach = $__3.arrayEach; +var rangeEach = ($__helpers_47_number__ = require("helpers/number"), $__helpers_47_number__ && $__helpers_47_number__.__esModule && $__helpers_47_number__ || {default: $__helpers_47_number__}).rangeEach; +var DataSource = function DataSource(hotInstance, dataSource) { + this.hot = hotInstance; + this.data = dataSource; + this.dataType = 'array'; + this.colToProp = (function() {}); + this.propToCol = (function() {}); +}; +($traceurRuntime.createClass)(DataSource, { + getData: function() { + return this.data; + }, + getAtColumn: function(column) { + var $__5 = this; + var result = []; + arrayEach(this.data, (function(row) { + var property = $__5.colToProp(column); + if (typeof property === 'string') { + row = getProperty(row, property); + } else { + row = row[property]; + } + result.push(row); + })); + return result; + }, + getAtRow: function(row) { + return this.data[row]; + }, + getAtCell: function(row, column) { + return this.data[row][this.colToProp(column)]; + }, + getByRange: function(start, end) { + var $__5 = this; + var startRow = Math.min(start.row, end.row); + var startCol = Math.min(start.col, end.col); + var endRow = Math.max(start.row, end.row); + var endCol = Math.max(start.col, end.col); + var result = []; + rangeEach(startRow, endRow, (function(currentRow) { + var row = $__5.getAtRow(currentRow); + var newRow; + if ($__5.dataType === 'array') { + newRow = row.slice(startCol, endCol); + } else if ($__5.dataType === 'object') { + newRow = {}; + rangeEach(startCol, endCol, (function(column) { + var prop = $__5.colToProp(column); + newRow[prop] = row[prop]; + })); + } + result.push(newRow); + })); + return result; + }, + destroy: function() { + this.data = null; + this.hot = null; + } +}, {}); +; + +//# +},{"helpers/array":42,"helpers/data":44,"helpers/number":49,"helpers/object":50,"helpers/setting":51}],28:[function(require,module,exports){ +"use strict"; +Object.defineProperties(exports, { + EditorManager: {get: function() { + return EditorManager; + }}, + __esModule: {value: true} +}); +var $__3rdparty_47_walkontable_47_src_47_cell_47_coords__, + $__helpers_47_unicode__, + $__helpers_47_dom_47_event__, + $__editors__, + $__eventManager__; +var WalkontableCellCoords = ($__3rdparty_47_walkontable_47_src_47_cell_47_coords__ = require("3rdparty/walkontable/src/cell/coords"), $__3rdparty_47_walkontable_47_src_47_cell_47_coords__ && $__3rdparty_47_walkontable_47_src_47_cell_47_coords__.__esModule && $__3rdparty_47_walkontable_47_src_47_cell_47_coords__ || {default: $__3rdparty_47_walkontable_47_src_47_cell_47_coords__}).WalkontableCellCoords; +var $__1 = ($__helpers_47_unicode__ = require("helpers/unicode"), $__helpers_47_unicode__ && $__helpers_47_unicode__.__esModule && $__helpers_47_unicode__ || {default: $__helpers_47_unicode__}), + KEY_CODES = $__1.KEY_CODES, + isMetaKey = $__1.isMetaKey, + isCtrlKey = $__1.isCtrlKey; +var $__2 = ($__helpers_47_dom_47_event__ = require("helpers/dom/event"), $__helpers_47_dom_47_event__ && $__helpers_47_dom_47_event__.__esModule && $__helpers_47_dom_47_event__ || {default: $__helpers_47_dom_47_event__}), + stopPropagation = $__2.stopPropagation, + stopImmediatePropagation = $__2.stopImmediatePropagation, + isImmediatePropagationStopped = $__2.isImmediatePropagationStopped; +var getEditor = ($__editors__ = require("editors"), $__editors__ && $__editors__.__esModule && $__editors__ || {default: $__editors__}).getEditor; +var eventManagerObject = ($__eventManager__ = require("eventManager"), $__eventManager__ && $__eventManager__.__esModule && $__eventManager__ || {default: $__eventManager__}).eventManager; +; +Handsontable.EditorManager = EditorManager; +function EditorManager(instance, priv, selection) { + var _this = this, + destroyed = false, + eventManager, + activeEditor; + eventManager = eventManagerObject(instance); + function moveSelectionAfterEnter(shiftKey) { + var enterMoves = typeof priv.settings.enterMoves === 'function' ? priv.settings.enterMoves(event) : priv.settings.enterMoves; + if (shiftKey) { + selection.transformStart(-enterMoves.row, -enterMoves.col); + } else { + selection.transformStart(enterMoves.row, enterMoves.col, true); + } + } + function moveSelectionUp(shiftKey) { + if (shiftKey) { + selection.transformEnd(-1, 0); + } else { + selection.transformStart(-1, 0); + } + } + function moveSelectionDown(shiftKey) { + if (shiftKey) { + selection.transformEnd(1, 0); + } else { + selection.transformStart(1, 0); + } + } + function moveSelectionRight(shiftKey) { + if (shiftKey) { + selection.transformEnd(0, 1); + } else { + selection.transformStart(0, 1); + } + } + function moveSelectionLeft(shiftKey) { + if (shiftKey) { + selection.transformEnd(0, -1); + } else { + selection.transformStart(0, -1); + } + } + function onKeyDown(event) { + var ctrlDown, + rangeModifier; + if (!instance.isListening()) { + return; + } + Handsontable.hooks.run(instance, 'beforeKeyDown', event); + if (destroyed) { + return; + } + if (isImmediatePropagationStopped(event)) { + return; + } + priv.lastKeyCode = event.keyCode; + if (!selection.isSelected()) { + return; + } + ctrlDown = (event.ctrlKey || event.metaKey) && !event.altKey; + if (activeEditor && !activeEditor.isWaiting()) { + if (!isMetaKey(event.keyCode) && !isCtrlKey(event.keyCode) && !ctrlDown && !_this.isEditorOpened()) { + _this.openEditor('', event); + return; + } + } + rangeModifier = event.shiftKey ? selection.setRangeEnd : selection.setRangeStart; + switch (event.keyCode) { + case KEY_CODES.A: + if (!_this.isEditorOpened() && ctrlDown) { + selection.selectAll(); + event.preventDefault(); + stopPropagation(event); + } + break; + case KEY_CODES.ARROW_UP: + if (_this.isEditorOpened() && !activeEditor.isWaiting()) { + _this.closeEditorAndSaveChanges(ctrlDown); + } + moveSelectionUp(event.shiftKey); + event.preventDefault(); + stopPropagation(event); + break; + case KEY_CODES.ARROW_DOWN: + if (_this.isEditorOpened() && !activeEditor.isWaiting()) { + _this.closeEditorAndSaveChanges(ctrlDown); + } + moveSelectionDown(event.shiftKey); + event.preventDefault(); + stopPropagation(event); + break; + case KEY_CODES.ARROW_RIGHT: + if (_this.isEditorOpened() && !activeEditor.isWaiting()) { + _this.closeEditorAndSaveChanges(ctrlDown); + } + moveSelectionRight(event.shiftKey); + event.preventDefault(); + stopPropagation(event); + break; + case KEY_CODES.ARROW_LEFT: + if (_this.isEditorOpened() && !activeEditor.isWaiting()) { + _this.closeEditorAndSaveChanges(ctrlDown); + } + moveSelectionLeft(event.shiftKey); + event.preventDefault(); + stopPropagation(event); + break; + case KEY_CODES.TAB: + var tabMoves = typeof priv.settings.tabMoves === 'function' ? priv.settings.tabMoves(event) : priv.settings.tabMoves; + if (event.shiftKey) { + selection.transformStart(-tabMoves.row, -tabMoves.col); + } else { + selection.transformStart(tabMoves.row, tabMoves.col, true); + } + event.preventDefault(); + stopPropagation(event); + break; + case KEY_CODES.BACKSPACE: + case KEY_CODES.DELETE: + selection.empty(event); + _this.prepareEditor(); + event.preventDefault(); + break; + case KEY_CODES.F2: + _this.openEditor(null, event); + if (activeEditor) { + activeEditor.enableFullEditMode(); + } + event.preventDefault(); + break; + case KEY_CODES.ENTER: + if (_this.isEditorOpened()) { + if (activeEditor && activeEditor.state !== Handsontable.EditorState.WAITING) { + _this.closeEditorAndSaveChanges(ctrlDown); + } + moveSelectionAfterEnter(event.shiftKey); + } else { + if (instance.getSettings().enterBeginsEditing) { + _this.openEditor(null, event); + if (activeEditor) { + activeEditor.enableFullEditMode(); + } + } else { + moveSelectionAfterEnter(event.shiftKey); + } + } + event.preventDefault(); + stopImmediatePropagation(event); + break; + case KEY_CODES.ESCAPE: + if (_this.isEditorOpened()) { + _this.closeEditorAndRestoreOriginalValue(ctrlDown); + } + event.preventDefault(); + break; + case KEY_CODES.HOME: + if (event.ctrlKey || event.metaKey) { + rangeModifier(new WalkontableCellCoords(0, priv.selRange.from.col)); + } else { + rangeModifier(new WalkontableCellCoords(priv.selRange.from.row, 0)); + } + event.preventDefault(); + stopPropagation(event); + break; + case KEY_CODES.END: + if (event.ctrlKey || event.metaKey) { + rangeModifier(new WalkontableCellCoords(instance.countRows() - 1, priv.selRange.from.col)); + } else { + rangeModifier(new WalkontableCellCoords(priv.selRange.from.row, instance.countCols() - 1)); + } + event.preventDefault(); + stopPropagation(event); + break; + case KEY_CODES.PAGE_UP: + selection.transformStart(-instance.countVisibleRows(), 0); + event.preventDefault(); + stopPropagation(event); + break; + case KEY_CODES.PAGE_DOWN: + selection.transformStart(instance.countVisibleRows(), 0); + event.preventDefault(); + stopPropagation(event); + break; + } + } + function init() { + instance.addHook('afterDocumentKeyDown', onKeyDown); + eventManager.addEventListener(document.documentElement, 'keydown', function(event) { + instance.runHooks('afterDocumentKeyDown', event); + }); + function onDblClick(event, coords, elem) { + if (elem.nodeName == 'TD') { + _this.openEditor(); + if (activeEditor) { + activeEditor.enableFullEditMode(); + } + } + } + instance.view.wt.update('onCellDblClick', onDblClick); + instance.addHook('afterDestroy', function() { + destroyed = true; + }); + } + this.destroyEditor = function(revertOriginal) { + this.closeEditor(revertOriginal); + }; + this.getActiveEditor = function() { + return activeEditor; + }; + this.prepareEditor = function() { + var row, + col, + prop, + td, + originalValue, + cellProperties, + editorClass; + if (activeEditor && activeEditor.isWaiting()) { + this.closeEditor(false, false, function(dataSaved) { + if (dataSaved) { + _this.prepareEditor(); + } + }); + return; + } + row = priv.selRange.highlight.row; + col = priv.selRange.highlight.col; + prop = instance.colToProp(col); + td = instance.getCell(row, col); + originalValue = instance.getDataAtCell(row, col); + cellProperties = instance.getCellMeta(row, col); + editorClass = instance.getCellEditor(cellProperties); + if (editorClass) { + activeEditor = Handsontable.editors.getEditor(editorClass, instance); + activeEditor.prepare(row, col, prop, td, originalValue, cellProperties); + } else { + activeEditor = void 0; + } + }; + this.isEditorOpened = function() { + return activeEditor && activeEditor.isOpened(); + }; + this.openEditor = function(initialValue, event) { + if (activeEditor && !activeEditor.cellProperties.readOnly) { + activeEditor.beginEditing(initialValue, event); + } else if (activeEditor && activeEditor.cellProperties.readOnly) { + if (event && event.keyCode === KEY_CODES.ENTER) { + moveSelectionAfterEnter(); + } + } + }; + this.closeEditor = function(restoreOriginalValue, ctrlDown, callback) { + if (activeEditor) { + activeEditor.finishEditing(restoreOriginalValue, ctrlDown, callback); + } else { + if (callback) { + callback(false); + } + } + }; + this.closeEditorAndSaveChanges = function(ctrlDown) { + return this.closeEditor(false, ctrlDown); + }; + this.closeEditorAndRestoreOriginalValue = function(ctrlDown) { + return this.closeEditor(true, ctrlDown); + }; + init(); +} + +//# +},{"3rdparty/walkontable/src/cell/coords":5,"editors":29,"eventManager":41,"helpers/dom/event":46,"helpers/unicode":53}],29:[function(require,module,exports){ +"use strict"; +Object.defineProperties(exports, { + registerEditor: {get: function() { + return registerEditor; + }}, + getEditor: {get: function() { + return getEditor; + }}, + hasEditor: {get: function() { + return hasEditor; + }}, + getEditorConstructor: {get: function() { + return getEditorConstructor; + }}, + __esModule: {value: true} +}); +var $__helpers_47_string__; +var toUpperCaseFirst = ($__helpers_47_string__ = require("helpers/string"), $__helpers_47_string__ && $__helpers_47_string__.__esModule && $__helpers_47_string__ || {default: $__helpers_47_string__}).toUpperCaseFirst; +; +var registeredEditorNames = {}, + registeredEditorClasses = new WeakMap(); +Handsontable.editors = Handsontable.editors || {}; +Handsontable.editors.registerEditor = registerEditor; +Handsontable.editors.getEditor = getEditor; +function RegisteredEditor(editorClass) { + var Clazz, + instances; + instances = {}; + Clazz = editorClass; + this.getConstructor = function() { + return editorClass; + }; + this.getInstance = function(hotInstance) { + if (!(hotInstance.guid in instances)) { + instances[hotInstance.guid] = new Clazz(hotInstance); + } + return instances[hotInstance.guid]; + }; +} +function registerEditor(editorName, editorClass) { + var editor = new RegisteredEditor(editorClass); + if (typeof editorName === 'string') { + registeredEditorNames[editorName] = editor; + Handsontable.editors[toUpperCaseFirst(editorName) + 'Editor'] = editorClass; + } + registeredEditorClasses.set(editorClass, editor); +} +function getEditor(editorName, hotInstance) { + var editor; + if (typeof editorName == 'function') { + if (!(registeredEditorClasses.get(editorName))) { + registerEditor(null, editorName); + } + editor = registeredEditorClasses.get(editorName); + } else if (typeof editorName == 'string') { + editor = registeredEditorNames[editorName]; + } else { + throw Error('Only strings and functions can be passed as "editor" parameter '); + } + if (!editor) { + throw Error('No editor registered under name "' + editorName + '"'); + } + return editor.getInstance(hotInstance); +} +function getEditorConstructor(editorName) { + var editor; + if (typeof editorName == 'string') { + editor = registeredEditorNames[editorName]; + } else { + throw Error('Only strings and functions can be passed as "editor" parameter '); + } + if (!editor) { + throw Error('No editor registered under name "' + editorName + '"'); + } + return editor.getConstructor(); +} +function hasEditor(editorName) { + return registeredEditorNames[editorName] ? true : false; +} + +//# +},{"helpers/string":52}],30:[function(require,module,exports){ +"use strict"; +Object.defineProperties(exports, { + BaseEditor: {get: function() { + return BaseEditor; + }}, + __esModule: {value: true} +}); +var $___46__46__47_helpers_47_mixed__, + $___46__46__47_3rdparty_47_walkontable_47_src_47_cell_47_coords__; +var stringify = ($___46__46__47_helpers_47_mixed__ = require("helpers/mixed"), $___46__46__47_helpers_47_mixed__ && $___46__46__47_helpers_47_mixed__.__esModule && $___46__46__47_helpers_47_mixed__ || {default: $___46__46__47_helpers_47_mixed__}).stringify; +var WalkontableCellCoords = ($___46__46__47_3rdparty_47_walkontable_47_src_47_cell_47_coords__ = require("3rdparty/walkontable/src/cell/coords"), $___46__46__47_3rdparty_47_walkontable_47_src_47_cell_47_coords__ && $___46__46__47_3rdparty_47_walkontable_47_src_47_cell_47_coords__.__esModule && $___46__46__47_3rdparty_47_walkontable_47_src_47_cell_47_coords__ || {default: $___46__46__47_3rdparty_47_walkontable_47_src_47_cell_47_coords__}).WalkontableCellCoords; +; +Handsontable.editors = Handsontable.editors || {}; +Handsontable.editors.BaseEditor = BaseEditor; +Handsontable.EditorState = { + VIRGIN: 'STATE_VIRGIN', + EDITING: 'STATE_EDITING', + WAITING: 'STATE_WAITING', + FINISHED: 'STATE_FINISHED' +}; +function BaseEditor(instance) { + this.instance = instance; + this.state = Handsontable.EditorState.VIRGIN; + this._opened = false; + this._fullEditMode = false; + this._closeCallback = null; + this.init(); +} +BaseEditor.prototype._fireCallbacks = function(result) { + if (this._closeCallback) { + this._closeCallback(result); + this._closeCallback = null; + } +}; +BaseEditor.prototype.init = function() {}; +BaseEditor.prototype.getValue = function() { + throw Error('Editor getValue() method unimplemented'); +}; +BaseEditor.prototype.setValue = function(newValue) { + throw Error('Editor setValue() method unimplemented'); +}; +BaseEditor.prototype.open = function() { + throw Error('Editor open() method unimplemented'); +}; +BaseEditor.prototype.close = function() { + throw Error('Editor close() method unimplemented'); +}; +BaseEditor.prototype.prepare = function(row, col, prop, td, originalValue, cellProperties) { + this.TD = td; + this.row = row; + this.col = col; + this.prop = prop; + this.originalValue = originalValue; + this.cellProperties = cellProperties; + if (this.instance.view.isMouseDown() && document.activeElement && document.activeElement !== document.body) { + document.activeElement.blur(); + } else if (!document.activeElement) { + document.body.focus(); + } + this.state = Handsontable.EditorState.VIRGIN; +}; +BaseEditor.prototype.extend = function() { + var baseClass = this.constructor; + function Editor() { + baseClass.apply(this, arguments); + } + function inherit(Child, Parent) { + function Bridge() {} + Bridge.prototype = Parent.prototype; + Child.prototype = new Bridge(); + Child.prototype.constructor = Child; + return Child; + } + return inherit(Editor, baseClass); +}; +BaseEditor.prototype.saveValue = function(val, ctrlDown) { + var sel, + tmp; + if (ctrlDown) { + sel = this.instance.getSelected(); + if (sel[0] > sel[2]) { + tmp = sel[0]; + sel[0] = sel[2]; + sel[2] = tmp; + } + if (sel[1] > sel[3]) { + tmp = sel[1]; + sel[1] = sel[3]; + sel[3] = tmp; + } + this.instance.populateFromArray(sel[0], sel[1], val, sel[2], sel[3], 'edit'); + } else { + this.instance.populateFromArray(this.row, this.col, val, null, null, 'edit'); + } +}; +BaseEditor.prototype.beginEditing = function(initialValue, event) { + if (this.state != Handsontable.EditorState.VIRGIN) { + return; + } + this.instance.view.scrollViewport(new WalkontableCellCoords(this.row, this.col)); + this.instance.view.render(); + this.state = Handsontable.EditorState.EDITING; + initialValue = typeof initialValue == 'string' ? initialValue : this.originalValue; + this.setValue(stringify(initialValue)); + this.open(event); + this._opened = true; + this.focus(); + this.instance.view.render(); +}; +BaseEditor.prototype.finishEditing = function(restoreOriginalValue, ctrlDown, callback) { + var _this = this, + val; + if (callback) { + var previousCloseCallback = this._closeCallback; + this._closeCallback = function(result) { + if (previousCloseCallback) { + previousCloseCallback(result); + } + callback(result); + }; + } + if (this.isWaiting()) { + return; + } + if (this.state == Handsontable.EditorState.VIRGIN) { + this.instance._registerTimeout(setTimeout(function() { + _this._fireCallbacks(true); + }, 0)); + return; + } + if (this.state == Handsontable.EditorState.EDITING) { + if (restoreOriginalValue) { + this.cancelChanges(); + this.instance.view.render(); + return; + } + if (this.instance.getSettings().trimWhitespace) { + val = [[typeof this.getValue() === 'string' ? String.prototype.trim.call(this.getValue() || '') : this.getValue()]]; + } else { + val = [[this.getValue()]]; + } + this.state = Handsontable.EditorState.WAITING; + this.saveValue(val, ctrlDown); + if (this.instance.getCellValidator(this.cellProperties)) { + this.instance.addHookOnce('postAfterValidate', function(result) { + _this.state = Handsontable.EditorState.FINISHED; + _this.discardEditor(result); + }); + } else { + this.state = Handsontable.EditorState.FINISHED; + this.discardEditor(true); + } + } +}; +BaseEditor.prototype.cancelChanges = function() { + this.state = Handsontable.EditorState.FINISHED; + this.discardEditor(); +}; +BaseEditor.prototype.discardEditor = function(result) { + if (this.state !== Handsontable.EditorState.FINISHED) { + return; + } + if (result === false && this.cellProperties.allowInvalid !== true) { + this.instance.selectCell(this.row, this.col); + this.focus(); + this.state = Handsontable.EditorState.EDITING; + this._fireCallbacks(false); + } else { + this.close(); + this._opened = false; + this._fullEditMode = false; + this.state = Handsontable.EditorState.VIRGIN; + this._fireCallbacks(true); + } +}; +BaseEditor.prototype.enableFullEditMode = function() { + this._fullEditMode = true; +}; +BaseEditor.prototype.isInFullEditMode = function() { + return this._fullEditMode; +}; +BaseEditor.prototype.isOpened = function() { + return this._opened; +}; +BaseEditor.prototype.isWaiting = function() { + return this.state === Handsontable.EditorState.WAITING; +}; +BaseEditor.prototype.checkEditorSection = function() { + var totalRows = this.instance.countRows(); + var section = ''; + if (this.row < this.instance.getSettings().fixedRowsTop) { + if (this.col < this.instance.getSettings().fixedColumnsLeft) { + section = 'top-left-corner'; + } else { + section = 'top'; + } + } else if (this.instance.getSettings().fixedRowsBottom && this.row >= totalRows - this.instance.getSettings().fixedRowsBottom) { + if (this.col < this.instance.getSettings().fixedColumnsLeft) { + section = 'bottom-left-corner'; + } else { + section = 'bottom'; + } + } else { + if (this.col < this.instance.getSettings().fixedColumnsLeft) { + section = 'left'; + } + } + return section; +}; + +//# +},{"3rdparty/walkontable/src/cell/coords":5,"helpers/mixed":48}],31:[function(require,module,exports){ +"use strict"; +Object.defineProperties(exports, { + AutocompleteEditor: {get: function() { + return AutocompleteEditor; + }}, + __esModule: {value: true} +}); +var $___46__46__47_helpers_47_unicode__, + $___46__46__47_helpers_47_mixed__, + $___46__46__47_helpers_47_array__, + $___46__46__47_helpers_47_dom_47_element__, + $___46__46__47_editors__, + $__handsontableEditor__; +var $__0 = ($___46__46__47_helpers_47_unicode__ = require("helpers/unicode"), $___46__46__47_helpers_47_unicode__ && $___46__46__47_helpers_47_unicode__.__esModule && $___46__46__47_helpers_47_unicode__ || {default: $___46__46__47_helpers_47_unicode__}), + KEY_CODES = $__0.KEY_CODES, + isPrintableChar = $__0.isPrintableChar; +var stringify = ($___46__46__47_helpers_47_mixed__ = require("helpers/mixed"), $___46__46__47_helpers_47_mixed__ && $___46__46__47_helpers_47_mixed__.__esModule && $___46__46__47_helpers_47_mixed__ || {default: $___46__46__47_helpers_47_mixed__}).stringify; +var pivot = ($___46__46__47_helpers_47_array__ = require("helpers/array"), $___46__46__47_helpers_47_array__ && $___46__46__47_helpers_47_array__.__esModule && $___46__46__47_helpers_47_array__ || {default: $___46__46__47_helpers_47_array__}).pivot; +var $__3 = ($___46__46__47_helpers_47_dom_47_element__ = require("helpers/dom/element"), $___46__46__47_helpers_47_dom_47_element__ && $___46__46__47_helpers_47_dom_47_element__.__esModule && $___46__46__47_helpers_47_dom_47_element__ || {default: $___46__46__47_helpers_47_dom_47_element__}), + addClass = $__3.addClass, + getCaretPosition = $__3.getCaretPosition, + getScrollbarWidth = $__3.getScrollbarWidth, + getSelectionEndPosition = $__3.getSelectionEndPosition, + outerWidth = $__3.outerWidth, + setCaretPosition = $__3.setCaretPosition; +var $__4 = ($___46__46__47_editors__ = require("editors"), $___46__46__47_editors__ && $___46__46__47_editors__.__esModule && $___46__46__47_editors__ || {default: $___46__46__47_editors__}), + getEditorConstructor = $__4.getEditorConstructor, + registerEditor = $__4.registerEditor; +var HandsontableEditor = ($__handsontableEditor__ = require("handsontableEditor"), $__handsontableEditor__ && $__handsontableEditor__.__esModule && $__handsontableEditor__ || {default: $__handsontableEditor__}).HandsontableEditor; +var AutocompleteEditor = HandsontableEditor.prototype.extend(); +AutocompleteEditor.prototype.init = function() { + HandsontableEditor.prototype.init.apply(this, arguments); + this.query = null; + this.choices = []; +}; +AutocompleteEditor.prototype.createElements = function() { + HandsontableEditor.prototype.createElements.apply(this, arguments); + addClass(this.htContainer, 'autocompleteEditor'); + addClass(this.htContainer, window.navigator.platform.indexOf('Mac') === -1 ? '' : 'htMacScroll'); +}; +var skipOne = false; +function onBeforeKeyDown(event) { + skipOne = false; + var editor = this.getActiveEditor(); + if (isPrintableChar(event.keyCode) || event.keyCode === KEY_CODES.BACKSPACE || event.keyCode === KEY_CODES.DELETE || event.keyCode === KEY_CODES.INSERT) { + var timeOffset = 0; + if (event.keyCode === KEY_CODES.C && (event.ctrlKey || event.metaKey)) { + return; + } + if (!editor.isOpened()) { + timeOffset += 10; + } + if (editor.htEditor) { + editor.instance._registerTimeout(setTimeout(function() { + editor.queryChoices(editor.TEXTAREA.value); + skipOne = true; + }, timeOffset)); + } + } +} +AutocompleteEditor.prototype.prepare = function() { + this.instance.addHook('beforeKeyDown', onBeforeKeyDown); + HandsontableEditor.prototype.prepare.apply(this, arguments); +}; +AutocompleteEditor.prototype.open = function() { + this.TEXTAREA_PARENT.style.overflow = 'auto'; + HandsontableEditor.prototype.open.apply(this, arguments); + this.TEXTAREA_PARENT.style.overflow = ''; + var choicesListHot = this.htEditor.getInstance(); + var that = this; + var trimDropdown = this.cellProperties.trimDropdown === void 0 ? true : this.cellProperties.trimDropdown; + this.TEXTAREA.style.visibility = 'visible'; + this.focus(); + choicesListHot.updateSettings({ + colWidths: trimDropdown ? [outerWidth(this.TEXTAREA) - 2] : void 0, + width: trimDropdown ? outerWidth(this.TEXTAREA) + getScrollbarWidth() + 2 : void 0, + afterRenderer: function(TD, row, col, prop, value) { + var caseSensitive = this.getCellMeta(row, col).filteringCaseSensitive === true, + indexOfMatch, + match, + value = stringify(value); + if (value) { + indexOfMatch = caseSensitive ? value.indexOf(this.query) : value.toLowerCase().indexOf(that.query.toLowerCase()); + if (indexOfMatch != -1) { + match = value.substr(indexOfMatch, that.query.length); + TD.innerHTML = value.replace(match, '' + match + ''); + } + } + }, + autoColumnSize: true, + modifyColWidth: function(width, col) { + var autoWidths = this.getPlugin('autoColumnSize').widths; + if (autoWidths[col]) { + width = autoWidths[col]; + } + return trimDropdown ? width : width + 15; + } + }); + this.htEditor.view.wt.wtTable.holder.parentNode.style['padding-right'] = getScrollbarWidth() + 2 + 'px'; + if (skipOne) { + skipOne = false; + } + that.instance._registerTimeout(setTimeout(function() { + that.queryChoices(that.TEXTAREA.value); + }, 0)); +}; +AutocompleteEditor.prototype.close = function() { + HandsontableEditor.prototype.close.apply(this, arguments); +}; +AutocompleteEditor.prototype.queryChoices = function(query) { + this.query = query; + if (typeof this.cellProperties.source == 'function') { + var that = this; + this.cellProperties.source(query, function(choices) { + that.updateChoicesList(choices); + }); + } else if (Array.isArray(this.cellProperties.source)) { + var choices; + if (!query || this.cellProperties.filter === false) { + choices = this.cellProperties.source; + } else { + var filteringCaseSensitive = this.cellProperties.filteringCaseSensitive === true; + var lowerCaseQuery = query.toLowerCase(); + choices = this.cellProperties.source.filter(function(choice) { + if (filteringCaseSensitive) { + return choice.indexOf(query) != -1; + } else { + return choice.toLowerCase().indexOf(lowerCaseQuery) != -1; + } + }); + } + this.updateChoicesList(choices); + } else { + this.updateChoicesList([]); + } +}; +AutocompleteEditor.prototype.updateChoicesList = function(choices) { + var pos = getCaretPosition(this.TEXTAREA), + endPos = getSelectionEndPosition(this.TEXTAREA); + var orderByRelevance = AutocompleteEditor.sortByRelevance(this.getValue(), choices, this.cellProperties.filteringCaseSensitive); + var highlightIndex; + if (this.cellProperties.filter == false) { + highlightIndex = orderByRelevance[0]; + } else { + var sorted = []; + for (var i = 0, + choicesCount = orderByRelevance.length; i < choicesCount; i++) { + sorted.push(choices[orderByRelevance[i]]); + } + highlightIndex = 0; + choices = sorted; + } + this.choices = choices; + this.htEditor.loadData(pivot([choices])); + this.updateDropdownHeight(); + if (this.cellProperties.strict === true) { + this.highlightBestMatchingChoice(highlightIndex); + } + this.instance.listen(); + this.TEXTAREA.focus(); + setCaretPosition(this.TEXTAREA, pos, (pos == endPos ? void 0 : endPos)); +}; +AutocompleteEditor.prototype.updateDropdownHeight = function() { + var currentDropdownWidth = this.htEditor.getColWidth(0) + getScrollbarWidth() + 2; + var trimDropdown = this.cellProperties.trimDropdown === void 0 ? true : this.cellProperties.trimDropdown; + this.htEditor.updateSettings({ + height: this.getDropdownHeight(), + width: trimDropdown ? void 0 : currentDropdownWidth + }); + this.htEditor.view.wt.wtTable.alignOverlaysWithTrimmingContainer(); +}; +AutocompleteEditor.prototype.finishEditing = function(restoreOriginalValue) { + if (!restoreOriginalValue) { + this.instance.removeHook('beforeKeyDown', onBeforeKeyDown); + } + HandsontableEditor.prototype.finishEditing.apply(this, arguments); +}; +AutocompleteEditor.prototype.highlightBestMatchingChoice = function(index) { + if (typeof index === 'number') { + this.htEditor.selectCell(index, 0); + } else { + this.htEditor.deselectCell(); + } +}; +AutocompleteEditor.sortByRelevance = function(value, choices, caseSensitive) { + var choicesRelevance = [], + currentItem, + valueLength = value.length, + valueIndex, + charsLeft, + result = [], + i, + choicesCount; + if (valueLength === 0) { + for (i = 0, choicesCount = choices.length; i < choicesCount; i++) { + result.push(i); + } + return result; + } + for (i = 0, choicesCount = choices.length; i < choicesCount; i++) { + currentItem = stringify(choices[i]); + if (caseSensitive) { + valueIndex = currentItem.indexOf(value); + } else { + valueIndex = currentItem.toLowerCase().indexOf(value.toLowerCase()); + } + if (valueIndex == -1) { + continue; + } + charsLeft = currentItem.length - valueIndex - valueLength; + choicesRelevance.push({ + baseIndex: i, + index: valueIndex, + charsLeft: charsLeft, + value: currentItem + }); + } + choicesRelevance.sort(function(a, b) { + if (b.index === -1) { + return -1; + } + if (a.index === -1) { + return 1; + } + if (a.index < b.index) { + return -1; + } else if (b.index < a.index) { + return 1; + } else if (a.index === b.index) { + if (a.charsLeft < b.charsLeft) { + return -1; + } else if (a.charsLeft > b.charsLeft) { + return 1; + } else { + return 0; + } + } + }); + for (i = 0, choicesCount = choicesRelevance.length; i < choicesCount; i++) { + result.push(choicesRelevance[i].baseIndex); + } + return result; +}; +AutocompleteEditor.prototype.getDropdownHeight = function() { + var firstRowHeight = this.htEditor.getInstance().getRowHeight(0) || 23; + var _visibleRows = this.cellProperties.visibleRows; + return this.choices.length >= _visibleRows ? _visibleRows * firstRowHeight : this.choices.length * firstRowHeight + 8; +}; +AutocompleteEditor.prototype.allowKeyEventPropagation = function(keyCode) { + var selected = {row: this.htEditor.getSelectedRange() ? this.htEditor.getSelectedRange().from.row : -1}; + var allowed = false; + if (keyCode === KEY_CODES.ARROW_DOWN && selected.row < this.htEditor.countRows() - 1) { + allowed = true; + } + if (keyCode === KEY_CODES.ARROW_UP && selected.row > -1) { + allowed = true; + } + return allowed; +}; +; +registerEditor('autocomplete', AutocompleteEditor); + +//# +},{"editors":29,"handsontableEditor":35,"helpers/array":42,"helpers/dom/element":45,"helpers/mixed":48,"helpers/unicode":53}],32:[function(require,module,exports){ +"use strict"; +Object.defineProperties(exports, { + CheckboxEditor: {get: function() { + return CheckboxEditor; + }}, + __esModule: {value: true} +}); +var $___46__46__47_editors__, + $___95_baseEditor__, + $___46__46__47_helpers_47_dom_47_element__; +var registerEditor = ($___46__46__47_editors__ = require("editors"), $___46__46__47_editors__ && $___46__46__47_editors__.__esModule && $___46__46__47_editors__ || {default: $___46__46__47_editors__}).registerEditor; +var BaseEditor = ($___95_baseEditor__ = require("_baseEditor"), $___95_baseEditor__ && $___95_baseEditor__.__esModule && $___95_baseEditor__ || {default: $___95_baseEditor__}).BaseEditor; +var hasClass = ($___46__46__47_helpers_47_dom_47_element__ = require("helpers/dom/element"), $___46__46__47_helpers_47_dom_47_element__ && $___46__46__47_helpers_47_dom_47_element__.__esModule && $___46__46__47_helpers_47_dom_47_element__ || {default: $___46__46__47_helpers_47_dom_47_element__}).hasClass; +var CheckboxEditor = function CheckboxEditor() { + $traceurRuntime.superConstructor($CheckboxEditor).apply(this, arguments); +}; +var $CheckboxEditor = CheckboxEditor; +($traceurRuntime.createClass)(CheckboxEditor, { + beginEditing: function() { + var checkbox = this.TD.querySelector('input[type="checkbox"]'); + if (!hasClass(checkbox, 'htBadValue')) { + checkbox.click(); + } + }, + finishEditing: function() {}, + init: function() {}, + open: function() {}, + close: function() {}, + getValue: function() {}, + setValue: function() {}, + focus: function() {} +}, {}, BaseEditor); +; +registerEditor('checkbox', CheckboxEditor); + +//# +},{"_baseEditor":30,"editors":29,"helpers/dom/element":45}],33:[function(require,module,exports){ +"use strict"; +Object.defineProperties(exports, { + DateEditor: {get: function() { + return DateEditor; + }}, + __esModule: {value: true} +}); +var $___46__46__47_helpers_47_dom_47_element__, + $___46__46__47_helpers_47_object__, + $___46__46__47_eventManager__, + $___46__46__47_editors__, + $___46__46__47_helpers_47_unicode__, + $___46__46__47_helpers_47_dom_47_event__, + $__textEditor__, + $__moment__, + $__pikaday__; +var $__0 = ($___46__46__47_helpers_47_dom_47_element__ = require("helpers/dom/element"), $___46__46__47_helpers_47_dom_47_element__ && $___46__46__47_helpers_47_dom_47_element__.__esModule && $___46__46__47_helpers_47_dom_47_element__ || {default: $___46__46__47_helpers_47_dom_47_element__}), + addClass = $__0.addClass, + outerHeight = $__0.outerHeight; +var deepExtend = ($___46__46__47_helpers_47_object__ = require("helpers/object"), $___46__46__47_helpers_47_object__ && $___46__46__47_helpers_47_object__.__esModule && $___46__46__47_helpers_47_object__ || {default: $___46__46__47_helpers_47_object__}).deepExtend; +var EventManager = ($___46__46__47_eventManager__ = require("eventManager"), $___46__46__47_eventManager__ && $___46__46__47_eventManager__.__esModule && $___46__46__47_eventManager__ || {default: $___46__46__47_eventManager__}).EventManager; +var $__3 = ($___46__46__47_editors__ = require("editors"), $___46__46__47_editors__ && $___46__46__47_editors__.__esModule && $___46__46__47_editors__ || {default: $___46__46__47_editors__}), + getEditor = $__3.getEditor, + registerEditor = $__3.registerEditor; +var isMetaKey = ($___46__46__47_helpers_47_unicode__ = require("helpers/unicode"), $___46__46__47_helpers_47_unicode__ && $___46__46__47_helpers_47_unicode__.__esModule && $___46__46__47_helpers_47_unicode__ || {default: $___46__46__47_helpers_47_unicode__}).isMetaKey; +var stopPropagation = ($___46__46__47_helpers_47_dom_47_event__ = require("helpers/dom/event"), $___46__46__47_helpers_47_dom_47_event__ && $___46__46__47_helpers_47_dom_47_event__.__esModule && $___46__46__47_helpers_47_dom_47_event__ || {default: $___46__46__47_helpers_47_dom_47_event__}).stopPropagation; +var TextEditor = ($__textEditor__ = require("textEditor"), $__textEditor__ && $__textEditor__.__esModule && $__textEditor__ || {default: $__textEditor__}).TextEditor; +var moment = ($__moment__ = require("moment"), $__moment__ && $__moment__.__esModule && $__moment__ || {default: $__moment__}).default; +var Pikaday = ($__pikaday__ = require("pikaday"), $__pikaday__ && $__pikaday__.__esModule && $__pikaday__ || {default: $__pikaday__}).default; +Handsontable.editors = Handsontable.editors || {}; +Handsontable.editors.DateEditor = DateEditor; +var DateEditor = function DateEditor(hotInstance) { + this.$datePicker = null; + this.datePicker = null; + this.datePickerStyle = null; + this.defaultDateFormat = 'DD/MM/YYYY'; + this.isCellEdited = false; + this.parentDestroyed = false; + $traceurRuntime.superConstructor($DateEditor).call(this, hotInstance); +}; +var $DateEditor = DateEditor; +($traceurRuntime.createClass)(DateEditor, { + init: function() { + var $__9 = this; + if (typeof moment !== 'function') { + throw new Error('You need to include moment.js to your project.'); + } + if (typeof Pikaday !== 'function') { + throw new Error('You need to include Pikaday to your project.'); + } + $traceurRuntime.superGet(this, $DateEditor.prototype, "init").call(this); + this.instance.addHook('afterDestroy', (function() { + $__9.parentDestroyed = true; + $__9.destroyElements(); + })); + }, + createElements: function() { + $traceurRuntime.superGet(this, $DateEditor.prototype, "createElements").call(this); + this.datePicker = document.createElement('DIV'); + this.datePickerStyle = this.datePicker.style; + this.datePickerStyle.position = 'absolute'; + this.datePickerStyle.top = 0; + this.datePickerStyle.left = 0; + this.datePickerStyle.zIndex = 9999; + addClass(this.datePicker, 'htDatepickerHolder'); + document.body.appendChild(this.datePicker); + this.$datePicker = new Pikaday(this.getDatePickerConfig()); + var eventManager = new EventManager(this); + eventManager.addEventListener(this.datePicker, 'mousedown', (function(event) { + return stopPropagation(event); + })); + this.hideDatepicker(); + }, + destroyElements: function() { + this.$datePicker.destroy(); + }, + prepare: function(row, col, prop, td, originalValue, cellProperties) { + this._opened = false; + $traceurRuntime.superGet(this, $DateEditor.prototype, "prepare").call(this, row, col, prop, td, originalValue, cellProperties); + }, + open: function() { + var event = arguments[0] !== (void 0) ? arguments[0] : null; + $traceurRuntime.superGet(this, $DateEditor.prototype, "open").call(this); + this.showDatepicker(event); + }, + close: function() { + var $__9 = this; + this._opened = false; + this.instance._registerTimeout(setTimeout((function() { + $__9.instance.selection.refreshBorders(); + }), 0)); + $traceurRuntime.superGet(this, $DateEditor.prototype, "close").call(this); + }, + finishEditing: function() { + var isCancelled = arguments[0] !== (void 0) ? arguments[0] : false; + var ctrlDown = arguments[1] !== (void 0) ? arguments[1] : false; + if (isCancelled) { + var value = this.originalValue; + if (value !== void 0) { + this.setValue(value); + } + } + this.hideDatepicker(); + $traceurRuntime.superGet(this, $DateEditor.prototype, "finishEditing").call(this, isCancelled, ctrlDown); + }, + showDatepicker: function(event) { + this.$datePicker.config(this.getDatePickerConfig()); + var offset = this.TD.getBoundingClientRect(); + var dateFormat = this.cellProperties.dateFormat || this.defaultDateFormat; + var datePickerConfig = this.$datePicker.config(); + var dateStr; + var isMouseDown = this.instance.view.isMouseDown(); + var isMeta = event ? isMetaKey(event.keyCode) : false; + this.datePickerStyle.top = (window.pageYOffset + offset.top + outerHeight(this.TD)) + 'px'; + this.datePickerStyle.left = (window.pageXOffset + offset.left) + 'px'; + this.$datePicker._onInputFocus = function() {}; + datePickerConfig.format = dateFormat; + if (this.originalValue) { + dateStr = this.originalValue; + if (moment(dateStr, dateFormat, true).isValid()) { + this.$datePicker.setMoment(moment(dateStr, dateFormat), true); + } + if (!isMeta && !isMouseDown) { + this.setValue(''); + } + } else { + if (this.cellProperties.defaultDate) { + dateStr = this.cellProperties.defaultDate; + datePickerConfig.defaultDate = dateStr; + if (moment(dateStr, dateFormat, true).isValid()) { + this.$datePicker.setMoment(moment(dateStr, dateFormat), true); + } + if (!isMeta && !isMouseDown) { + this.setValue(''); + } + } else { + this.$datePicker.gotoToday(); + } + } + this.datePickerStyle.display = 'block'; + this.$datePicker.show(); + }, + hideDatepicker: function() { + this.datePickerStyle.display = 'none'; + this.$datePicker.hide(); + }, + getDatePickerConfig: function() { + var $__9 = this; + var htInput = this.TEXTAREA; + var options = {}; + if (this.cellProperties && this.cellProperties.datePickerConfig) { + deepExtend(options, this.cellProperties.datePickerConfig); + } + var origOnSelect = options.onSelect; + var origOnClose = options.onClose; + options.field = htInput; + options.trigger = htInput; + options.container = this.datePicker; + options.bound = false; + options.format = options.format || this.defaultDateFormat; + options.reposition = options.reposition || false; + options.onSelect = (function(dateStr) { + if (!isNaN(dateStr.getTime())) { + dateStr = moment(dateStr).format($__9.cellProperties.dateFormat || $__9.defaultDateFormat); + } + $__9.setValue(dateStr); + $__9.hideDatepicker(); + if (origOnSelect) { + origOnSelect(); + } + }); + options.onClose = (function() { + if (!$__9.parentDestroyed) { + $__9.finishEditing(false); + } + if (origOnClose) { + origOnClose(); + } + }); + return options; + } +}, {}, TextEditor); +; +registerEditor('date', DateEditor); + +//# +},{"editors":29,"eventManager":41,"helpers/dom/element":45,"helpers/dom/event":46,"helpers/object":50,"helpers/unicode":53,"moment":"moment","pikaday":"pikaday","textEditor":40}],34:[function(require,module,exports){ +"use strict"; +Object.defineProperties(exports, { + DropdownEditor: {get: function() { + return DropdownEditor; + }}, + __esModule: {value: true} +}); +var $___46__46__47_editors__, + $__autocompleteEditor__; +var $__0 = ($___46__46__47_editors__ = require("editors"), $___46__46__47_editors__ && $___46__46__47_editors__.__esModule && $___46__46__47_editors__ || {default: $___46__46__47_editors__}), + getEditor = $__0.getEditor, + registerEditor = $__0.registerEditor; +var AutocompleteEditor = ($__autocompleteEditor__ = require("autocompleteEditor"), $__autocompleteEditor__ && $__autocompleteEditor__.__esModule && $__autocompleteEditor__ || {default: $__autocompleteEditor__}).AutocompleteEditor; +var DropdownEditor = function DropdownEditor() { + $traceurRuntime.superConstructor($DropdownEditor).apply(this, arguments); +}; +var $DropdownEditor = DropdownEditor; +($traceurRuntime.createClass)(DropdownEditor, {prepare: function(row, col, prop, td, originalValue, cellProperties) { + $traceurRuntime.superGet(this, $DropdownEditor.prototype, "prepare").call(this, row, col, prop, td, originalValue, cellProperties); + this.cellProperties.filter = false; + this.cellProperties.strict = true; + }}, {}, AutocompleteEditor); +Handsontable.hooks.add('beforeValidate', function(value, row, col, source) { + var cellMeta = this.getCellMeta(row, col); + if (cellMeta.editor === Handsontable.editors.DropdownEditor) { + if (cellMeta.strict === void 0) { + cellMeta.filter = false; + cellMeta.strict = true; + } + } +}); +; +registerEditor('dropdown', DropdownEditor); + +//# +},{"autocompleteEditor":31,"editors":29}],35:[function(require,module,exports){ +"use strict"; +Object.defineProperties(exports, { + HandsontableEditor: {get: function() { + return HandsontableEditor; + }}, + __esModule: {value: true} +}); +var $___46__46__47_helpers_47_unicode__, + $___46__46__47_helpers_47_object__, + $___46__46__47_helpers_47_dom_47_element__, + $___46__46__47_helpers_47_dom_47_event__, + $___46__46__47_editors__, + $__textEditor__; +var KEY_CODES = ($___46__46__47_helpers_47_unicode__ = require("helpers/unicode"), $___46__46__47_helpers_47_unicode__ && $___46__46__47_helpers_47_unicode__.__esModule && $___46__46__47_helpers_47_unicode__ || {default: $___46__46__47_helpers_47_unicode__}).KEY_CODES; +var extend = ($___46__46__47_helpers_47_object__ = require("helpers/object"), $___46__46__47_helpers_47_object__ && $___46__46__47_helpers_47_object__.__esModule && $___46__46__47_helpers_47_object__ || {default: $___46__46__47_helpers_47_object__}).extend; +var setCaretPosition = ($___46__46__47_helpers_47_dom_47_element__ = require("helpers/dom/element"), $___46__46__47_helpers_47_dom_47_element__ && $___46__46__47_helpers_47_dom_47_element__.__esModule && $___46__46__47_helpers_47_dom_47_element__ || {default: $___46__46__47_helpers_47_dom_47_element__}).setCaretPosition; +var $__3 = ($___46__46__47_helpers_47_dom_47_event__ = require("helpers/dom/event"), $___46__46__47_helpers_47_dom_47_event__ && $___46__46__47_helpers_47_dom_47_event__.__esModule && $___46__46__47_helpers_47_dom_47_event__ || {default: $___46__46__47_helpers_47_dom_47_event__}), + stopImmediatePropagation = $__3.stopImmediatePropagation, + isImmediatePropagationStopped = $__3.isImmediatePropagationStopped; +var $__4 = ($___46__46__47_editors__ = require("editors"), $___46__46__47_editors__ && $___46__46__47_editors__.__esModule && $___46__46__47_editors__ || {default: $___46__46__47_editors__}), + getEditor = $__4.getEditor, + registerEditor = $__4.registerEditor; +var TextEditor = ($__textEditor__ = require("textEditor"), $__textEditor__ && $__textEditor__.__esModule && $__textEditor__ || {default: $__textEditor__}).TextEditor; +var HandsontableEditor = TextEditor.prototype.extend(); +HandsontableEditor.prototype.createElements = function() { + TextEditor.prototype.createElements.apply(this, arguments); + var DIV = document.createElement('DIV'); + DIV.className = 'handsontableEditor'; + this.TEXTAREA_PARENT.appendChild(DIV); + this.htContainer = DIV; + this.assignHooks(); +}; +HandsontableEditor.prototype.prepare = function(td, row, col, prop, value, cellProperties) { + TextEditor.prototype.prepare.apply(this, arguments); + var parent = this; + var options = { + startRows: 0, + startCols: 0, + minRows: 0, + minCols: 0, + className: 'listbox', + copyPaste: false, + autoColumnSize: false, + autoRowSize: false, + readOnly: true, + fillHandle: false, + afterOnCellMouseDown: function() { + var value = this.getValue(); + if (value !== void 0) { + parent.setValue(value); + } + parent.instance.destroyEditor(); + } + }; + if (this.cellProperties.handsontable) { + extend(options, cellProperties.handsontable); + } + this.htOptions = options; +}; +var onBeforeKeyDown = function(event) { + if (isImmediatePropagationStopped(event)) { + return; + } + var editor = this.getActiveEditor(); + var innerHOT = editor.htEditor.getInstance(); + var rowToSelect; + if (event.keyCode == KEY_CODES.ARROW_DOWN) { + if (innerHOT.getSelected()) { + var selectedRow = innerHOT.getSelected()[0]; + var lastRow = innerHOT.countRows() - 1; + rowToSelect = Math.min(lastRow, selectedRow + 1); + } else { + rowToSelect = 0; + } + } else if (event.keyCode == KEY_CODES.ARROW_UP) { + if (innerHOT.getSelected()) { + var selectedRow = innerHOT.getSelected()[0]; + rowToSelect = selectedRow - 1; + } + } + if (rowToSelect !== void 0) { + if (rowToSelect < 0) { + innerHOT.deselectCell(); + } else { + innerHOT.selectCell(rowToSelect, 0); + } + if (innerHOT.getData().length) { + event.preventDefault(); + stopImmediatePropagation(event); + editor.instance.listen(); + editor.TEXTAREA.focus(); + } + } +}; +HandsontableEditor.prototype.open = function() { + this.instance.addHook('beforeKeyDown', onBeforeKeyDown); + TextEditor.prototype.open.apply(this, arguments); + if (this.htEditor) { + this.htEditor.destroy(); + } + this.htEditor = new Handsontable(this.htContainer, this.htOptions); + if (this.cellProperties.strict) { + this.htEditor.selectCell(0, 0); + this.TEXTAREA.style.visibility = 'hidden'; + } else { + this.htEditor.deselectCell(); + this.TEXTAREA.style.visibility = 'visible'; + } + setCaretPosition(this.TEXTAREA, 0, this.TEXTAREA.value.length); +}; +HandsontableEditor.prototype.close = function() { + this.instance.removeHook('beforeKeyDown', onBeforeKeyDown); + this.instance.listen(); + TextEditor.prototype.close.apply(this, arguments); +}; +HandsontableEditor.prototype.focus = function() { + this.instance.listen(); + TextEditor.prototype.focus.apply(this, arguments); +}; +HandsontableEditor.prototype.beginEditing = function(initialValue) { + var onBeginEditing = this.instance.getSettings().onBeginEditing; + if (onBeginEditing && onBeginEditing() === false) { + return; + } + TextEditor.prototype.beginEditing.apply(this, arguments); +}; +HandsontableEditor.prototype.finishEditing = function(isCancelled, ctrlDown) { + if (this.htEditor && this.htEditor.isListening()) { + this.instance.listen(); + } + if (this.htEditor && this.htEditor.getSelected()) { + var value = this.htEditor.getInstance().getValue(); + if (value !== void 0) { + this.setValue(value); + } + } + return TextEditor.prototype.finishEditing.apply(this, arguments); +}; +HandsontableEditor.prototype.assignHooks = function() { + var _this = this; + this.instance.addHook('afterDestroy', function() { + if (_this.htEditor) { + _this.htEditor.destroy(); + } + }); +}; +; +registerEditor('handsontable', HandsontableEditor); + +//# +},{"editors":29,"helpers/dom/element":45,"helpers/dom/event":46,"helpers/object":50,"helpers/unicode":53,"textEditor":40}],36:[function(require,module,exports){ +"use strict"; +Object.defineProperties(exports, { + MobileTextEditor: {get: function() { + return MobileTextEditor; + }}, + __esModule: {value: true} +}); +var $___46__46__47_helpers_47_unicode__, + $___46__46__47_helpers_47_dom_47_event__, + $___46__46__47_helpers_47_dom_47_element__, + $___46__46__47_editors__, + $___95_baseEditor__, + $___46__46__47_eventManager__; +var KEY_CODES = ($___46__46__47_helpers_47_unicode__ = require("helpers/unicode"), $___46__46__47_helpers_47_unicode__ && $___46__46__47_helpers_47_unicode__.__esModule && $___46__46__47_helpers_47_unicode__ || {default: $___46__46__47_helpers_47_unicode__}).KEY_CODES; +var $__1 = ($___46__46__47_helpers_47_dom_47_event__ = require("helpers/dom/event"), $___46__46__47_helpers_47_dom_47_event__ && $___46__46__47_helpers_47_dom_47_event__.__esModule && $___46__46__47_helpers_47_dom_47_event__ || {default: $___46__46__47_helpers_47_dom_47_event__}), + stopImmediatePropagation = $__1.stopImmediatePropagation, + isImmediatePropagationStopped = $__1.isImmediatePropagationStopped; +var $__2 = ($___46__46__47_helpers_47_dom_47_element__ = require("helpers/dom/element"), $___46__46__47_helpers_47_dom_47_element__ && $___46__46__47_helpers_47_dom_47_element__.__esModule && $___46__46__47_helpers_47_dom_47_element__ || {default: $___46__46__47_helpers_47_dom_47_element__}), + addClass = $__2.addClass, + getScrollLeft = $__2.getScrollLeft, + getScrollTop = $__2.getScrollTop, + hasClass = $__2.hasClass, + isChildOf = $__2.isChildOf, + offset = $__2.offset, + outerHeight = $__2.outerHeight, + outerWidth = $__2.outerWidth, + removeClass = $__2.removeClass, + setCaretPosition = $__2.setCaretPosition; +var $__3 = ($___46__46__47_editors__ = require("editors"), $___46__46__47_editors__ && $___46__46__47_editors__.__esModule && $___46__46__47_editors__ || {default: $___46__46__47_editors__}), + getEditor = $__3.getEditor, + registerEditor = $__3.registerEditor; +var BaseEditor = ($___95_baseEditor__ = require("_baseEditor"), $___95_baseEditor__ && $___95_baseEditor__.__esModule && $___95_baseEditor__ || {default: $___95_baseEditor__}).BaseEditor; +var eventManagerObject = ($___46__46__47_eventManager__ = require("eventManager"), $___46__46__47_eventManager__ && $___46__46__47_eventManager__.__esModule && $___46__46__47_eventManager__ || {default: $___46__46__47_eventManager__}).eventManager; +var MobileTextEditor = BaseEditor.prototype.extend(), + domDimensionsCache = {}; +var createControls = function() { + this.controls = {}; + this.controls.leftButton = document.createElement('DIV'); + this.controls.leftButton.className = 'leftButton'; + this.controls.rightButton = document.createElement('DIV'); + this.controls.rightButton.className = 'rightButton'; + this.controls.upButton = document.createElement('DIV'); + this.controls.upButton.className = 'upButton'; + this.controls.downButton = document.createElement('DIV'); + this.controls.downButton.className = 'downButton'; + for (var button in this.controls) { + if (this.controls.hasOwnProperty(button)) { + this.positionControls.appendChild(this.controls[button]); + } + } +}; +MobileTextEditor.prototype.valueChanged = function() { + return this.initValue != this.getValue(); +}; +MobileTextEditor.prototype.init = function() { + var that = this; + this.eventManager = eventManagerObject(this.instance); + this.createElements(); + this.bindEvents(); + this.instance.addHook('afterDestroy', function() { + that.destroy(); + }); +}; +MobileTextEditor.prototype.getValue = function() { + return this.TEXTAREA.value; +}; +MobileTextEditor.prototype.setValue = function(newValue) { + this.initValue = newValue; + this.TEXTAREA.value = newValue; +}; +MobileTextEditor.prototype.createElements = function() { + this.editorContainer = document.createElement('DIV'); + this.editorContainer.className = 'htMobileEditorContainer'; + this.cellPointer = document.createElement('DIV'); + this.cellPointer.className = 'cellPointer'; + this.moveHandle = document.createElement('DIV'); + this.moveHandle.className = 'moveHandle'; + this.inputPane = document.createElement('DIV'); + this.inputPane.className = 'inputs'; + this.positionControls = document.createElement('DIV'); + this.positionControls.className = 'positionControls'; + this.TEXTAREA = document.createElement('TEXTAREA'); + addClass(this.TEXTAREA, 'handsontableInput'); + this.inputPane.appendChild(this.TEXTAREA); + this.editorContainer.appendChild(this.cellPointer); + this.editorContainer.appendChild(this.moveHandle); + this.editorContainer.appendChild(this.inputPane); + this.editorContainer.appendChild(this.positionControls); + createControls.call(this); + document.body.appendChild(this.editorContainer); +}; +MobileTextEditor.prototype.onBeforeKeyDown = function(event) { + var instance = this; + var that = instance.getActiveEditor(); + if (event.target !== that.TEXTAREA || isImmediatePropagationStopped(event)) { + return; + } + switch (event.keyCode) { + case KEY_CODES.ENTER: + that.close(); + event.preventDefault(); + break; + case KEY_CODES.BACKSPACE: + stopImmediatePropagation(event); + break; + } +}; +MobileTextEditor.prototype.open = function() { + this.instance.addHook('beforeKeyDown', this.onBeforeKeyDown); + addClass(this.editorContainer, 'active'); + removeClass(this.cellPointer, 'hidden'); + this.updateEditorPosition(); +}; +MobileTextEditor.prototype.focus = function() { + this.TEXTAREA.focus(); + setCaretPosition(this.TEXTAREA, this.TEXTAREA.value.length); +}; +MobileTextEditor.prototype.close = function() { + this.TEXTAREA.blur(); + this.instance.removeHook('beforeKeyDown', this.onBeforeKeyDown); + removeClass(this.editorContainer, 'active'); +}; +MobileTextEditor.prototype.scrollToView = function() { + var coords = this.instance.getSelectedRange().highlight; + this.instance.view.scrollViewport(coords); +}; +MobileTextEditor.prototype.hideCellPointer = function() { + if (!hasClass(this.cellPointer, 'hidden')) { + addClass(this.cellPointer, 'hidden'); + } +}; +MobileTextEditor.prototype.updateEditorPosition = function(x, y) { + if (x && y) { + x = parseInt(x, 10); + y = parseInt(y, 10); + this.editorContainer.style.top = y + 'px'; + this.editorContainer.style.left = x + 'px'; + } else { + var selection = this.instance.getSelected(), + selectedCell = this.instance.getCell(selection[0], selection[1]); + if (!domDimensionsCache.cellPointer) { + domDimensionsCache.cellPointer = { + height: outerHeight(this.cellPointer), + width: outerWidth(this.cellPointer) + }; + } + if (!domDimensionsCache.editorContainer) { + domDimensionsCache.editorContainer = {width: outerWidth(this.editorContainer)}; + } + if (selectedCell !== undefined) { + var scrollLeft = this.instance.view.wt.wtOverlays.leftOverlay.trimmingContainer == window ? 0 : getScrollLeft(this.instance.view.wt.wtOverlays.leftOverlay.holder); + var scrollTop = this.instance.view.wt.wtOverlays.topOverlay.trimmingContainer == window ? 0 : getScrollTop(this.instance.view.wt.wtOverlays.topOverlay.holder); + var selectedCellOffset = offset(selectedCell), + selectedCellWidth = outerWidth(selectedCell), + currentScrollPosition = { + x: scrollLeft, + y: scrollTop + }; + this.editorContainer.style.top = parseInt(selectedCellOffset.top + outerHeight(selectedCell) - currentScrollPosition.y + domDimensionsCache.cellPointer.height, 10) + 'px'; + this.editorContainer.style.left = parseInt((window.innerWidth / 2) - (domDimensionsCache.editorContainer.width / 2), 10) + 'px'; + if (selectedCellOffset.left + selectedCellWidth / 2 > parseInt(this.editorContainer.style.left, 10) + domDimensionsCache.editorContainer.width) { + this.editorContainer.style.left = window.innerWidth - domDimensionsCache.editorContainer.width + 'px'; + } else if (selectedCellOffset.left + selectedCellWidth / 2 < parseInt(this.editorContainer.style.left, 10) + 20) { + this.editorContainer.style.left = 0 + 'px'; + } + this.cellPointer.style.left = parseInt(selectedCellOffset.left - (domDimensionsCache.cellPointer.width / 2) - offset(this.editorContainer).left + (selectedCellWidth / 2) - currentScrollPosition.x, 10) + 'px'; + } + } +}; +MobileTextEditor.prototype.updateEditorData = function() { + var selected = this.instance.getSelected(), + selectedValue = this.instance.getDataAtCell(selected[0], selected[1]); + this.row = selected[0]; + this.col = selected[1]; + this.setValue(selectedValue); + this.updateEditorPosition(); +}; +MobileTextEditor.prototype.prepareAndSave = function() { + var val; + if (!this.valueChanged()) { + return true; + } + if (this.instance.getSettings().trimWhitespace) { + val = [[String.prototype.trim.call(this.getValue())]]; + } else { + val = [[this.getValue()]]; + } + this.saveValue(val); +}; +MobileTextEditor.prototype.bindEvents = function() { + var that = this; + this.eventManager.addEventListener(this.controls.leftButton, 'touchend', function(event) { + that.prepareAndSave(); + that.instance.selection.transformStart(0, -1, null, true); + that.updateEditorData(); + event.preventDefault(); + }); + this.eventManager.addEventListener(this.controls.rightButton, 'touchend', function(event) { + that.prepareAndSave(); + that.instance.selection.transformStart(0, 1, null, true); + that.updateEditorData(); + event.preventDefault(); + }); + this.eventManager.addEventListener(this.controls.upButton, 'touchend', function(event) { + that.prepareAndSave(); + that.instance.selection.transformStart(-1, 0, null, true); + that.updateEditorData(); + event.preventDefault(); + }); + this.eventManager.addEventListener(this.controls.downButton, 'touchend', function(event) { + that.prepareAndSave(); + that.instance.selection.transformStart(1, 0, null, true); + that.updateEditorData(); + event.preventDefault(); + }); + this.eventManager.addEventListener(this.moveHandle, 'touchstart', function(event) { + if (event.touches.length == 1) { + var touch = event.touches[0], + onTouchPosition = { + x: that.editorContainer.offsetLeft, + y: that.editorContainer.offsetTop + }, + onTouchOffset = { + x: touch.pageX - onTouchPosition.x, + y: touch.pageY - onTouchPosition.y + }; + that.eventManager.addEventListener(this, 'touchmove', function(event) { + var touch = event.touches[0]; + that.updateEditorPosition(touch.pageX - onTouchOffset.x, touch.pageY - onTouchOffset.y); + that.hideCellPointer(); + event.preventDefault(); + }); + } + }); + this.eventManager.addEventListener(document.body, 'touchend', function(event) { + if (!isChildOf(event.target, that.editorContainer) && !isChildOf(event.target, that.instance.rootElement)) { + that.close(); + } + }); + this.eventManager.addEventListener(this.instance.view.wt.wtOverlays.leftOverlay.holder, 'scroll', function(event) { + if (that.instance.view.wt.wtOverlays.leftOverlay.trimmingContainer != window) { + that.hideCellPointer(); + } + }); + this.eventManager.addEventListener(this.instance.view.wt.wtOverlays.topOverlay.holder, 'scroll', function(event) { + if (that.instance.view.wt.wtOverlays.topOverlay.trimmingContainer != window) { + that.hideCellPointer(); + } + }); +}; +MobileTextEditor.prototype.destroy = function() { + this.eventManager.clear(); + this.editorContainer.parentNode.removeChild(this.editorContainer); +}; +; +registerEditor('mobile', MobileTextEditor); + +//# +},{"_baseEditor":30,"editors":29,"eventManager":41,"helpers/dom/element":45,"helpers/dom/event":46,"helpers/unicode":53}],37:[function(require,module,exports){ +"use strict"; +Object.defineProperties(exports, { + NumericEditor: {get: function() { + return NumericEditor; + }}, + __esModule: {value: true} +}); +var $__numeral__, + $___46__46__47_editors__, + $__textEditor__; +var numeral = ($__numeral__ = require("numeral"), $__numeral__ && $__numeral__.__esModule && $__numeral__ || {default: $__numeral__}).default; +var $__1 = ($___46__46__47_editors__ = require("editors"), $___46__46__47_editors__ && $___46__46__47_editors__.__esModule && $___46__46__47_editors__ || {default: $___46__46__47_editors__}), + getEditor = $__1.getEditor, + registerEditor = $__1.registerEditor; +var TextEditor = ($__textEditor__ = require("textEditor"), $__textEditor__ && $__textEditor__.__esModule && $__textEditor__ || {default: $__textEditor__}).TextEditor; +var NumericEditor = function NumericEditor() { + $traceurRuntime.superConstructor($NumericEditor).apply(this, arguments); +}; +var $NumericEditor = NumericEditor; +($traceurRuntime.createClass)(NumericEditor, {beginEditing: function(initialValue) { + if (typeof initialValue === 'undefined' && this.originalValue) { + if (typeof this.cellProperties.language !== 'undefined') { + numeral.language(this.cellProperties.language); + } + var decimalDelimiter = numeral.languageData().delimiters.decimal; + initialValue = ('' + this.originalValue).replace('.', decimalDelimiter); + } + $traceurRuntime.superGet(this, $NumericEditor.prototype, "beginEditing").call(this, initialValue); + }}, {}, TextEditor); +; +registerEditor('numeric', NumericEditor); + +//# +},{"editors":29,"numeral":"numeral","textEditor":40}],38:[function(require,module,exports){ +"use strict"; +Object.defineProperties(exports, { + PasswordEditor: {get: function() { + return PasswordEditor; + }}, + __esModule: {value: true} +}); +var $___46__46__47_helpers_47_dom_47_element__, + $___46__46__47_editors__, + $__textEditor__; +var empty = ($___46__46__47_helpers_47_dom_47_element__ = require("helpers/dom/element"), $___46__46__47_helpers_47_dom_47_element__ && $___46__46__47_helpers_47_dom_47_element__.__esModule && $___46__46__47_helpers_47_dom_47_element__ || {default: $___46__46__47_helpers_47_dom_47_element__}).empty; +var $__1 = ($___46__46__47_editors__ = require("editors"), $___46__46__47_editors__ && $___46__46__47_editors__.__esModule && $___46__46__47_editors__ || {default: $___46__46__47_editors__}), + getEditor = $__1.getEditor, + registerEditor = $__1.registerEditor; +var TextEditor = ($__textEditor__ = require("textEditor"), $__textEditor__ && $__textEditor__.__esModule && $__textEditor__ || {default: $__textEditor__}).TextEditor; +var PasswordEditor = function PasswordEditor() { + $traceurRuntime.superConstructor($PasswordEditor).apply(this, arguments); +}; +var $PasswordEditor = PasswordEditor; +($traceurRuntime.createClass)(PasswordEditor, {createElements: function() { + $traceurRuntime.superGet(this, $PasswordEditor.prototype, "createElements").call(this); + this.TEXTAREA = document.createElement('input'); + this.TEXTAREA.setAttribute('type', 'password'); + this.TEXTAREA.className = 'handsontableInput'; + this.textareaStyle = this.TEXTAREA.style; + this.textareaStyle.width = 0; + this.textareaStyle.height = 0; + empty(this.TEXTAREA_PARENT); + this.TEXTAREA_PARENT.appendChild(this.TEXTAREA); + }}, {}, TextEditor); +; +registerEditor('password', PasswordEditor); + +//# +},{"editors":29,"helpers/dom/element":45,"textEditor":40}],39:[function(require,module,exports){ +"use strict"; +Object.defineProperties(exports, { + SelectEditor: {get: function() { + return SelectEditor; + }}, + __esModule: {value: true} +}); +var $___46__46__47_helpers_47_dom_47_element__, + $___46__46__47_helpers_47_dom_47_event__, + $___46__46__47_helpers_47_unicode__, + $___46__46__47_editors__, + $___95_baseEditor__; +var $__0 = ($___46__46__47_helpers_47_dom_47_element__ = require("helpers/dom/element"), $___46__46__47_helpers_47_dom_47_element__ && $___46__46__47_helpers_47_dom_47_element__.__esModule && $___46__46__47_helpers_47_dom_47_element__ || {default: $___46__46__47_helpers_47_dom_47_element__}), + addClass = $__0.addClass, + empty = $__0.empty, + fastInnerHTML = $__0.fastInnerHTML, + getComputedStyle = $__0.getComputedStyle, + getCssTransform = $__0.getCssTransform, + getScrollableElement = $__0.getScrollableElement, + offset = $__0.offset, + outerHeight = $__0.outerHeight, + outerWidth = $__0.outerWidth, + resetCssTransform = $__0.resetCssTransform; +var stopImmediatePropagation = ($___46__46__47_helpers_47_dom_47_event__ = require("helpers/dom/event"), $___46__46__47_helpers_47_dom_47_event__ && $___46__46__47_helpers_47_dom_47_event__.__esModule && $___46__46__47_helpers_47_dom_47_event__ || {default: $___46__46__47_helpers_47_dom_47_event__}).stopImmediatePropagation; +var KEY_CODES = ($___46__46__47_helpers_47_unicode__ = require("helpers/unicode"), $___46__46__47_helpers_47_unicode__ && $___46__46__47_helpers_47_unicode__.__esModule && $___46__46__47_helpers_47_unicode__ || {default: $___46__46__47_helpers_47_unicode__}).KEY_CODES; +var $__3 = ($___46__46__47_editors__ = require("editors"), $___46__46__47_editors__ && $___46__46__47_editors__.__esModule && $___46__46__47_editors__ || {default: $___46__46__47_editors__}), + getEditor = $__3.getEditor, + registerEditor = $__3.registerEditor; +var BaseEditor = ($___95_baseEditor__ = require("_baseEditor"), $___95_baseEditor__ && $___95_baseEditor__.__esModule && $___95_baseEditor__ || {default: $___95_baseEditor__}).BaseEditor; +var SelectEditor = BaseEditor.prototype.extend(); +SelectEditor.prototype.init = function() { + this.select = document.createElement('SELECT'); + addClass(this.select, 'htSelectEditor'); + this.select.style.display = 'none'; + this.instance.rootElement.appendChild(this.select); + this.registerHooks(); +}; +SelectEditor.prototype.registerHooks = function() { + var $__5 = this; + this.instance.addHook('afterScrollHorizontally', (function() { + return $__5.refreshDimensions(); + })); + this.instance.addHook('afterScrollVertically', (function() { + return $__5.refreshDimensions(); + })); + this.instance.addHook('afterColumnResize', (function() { + return $__5.refreshDimensions(); + })); + this.instance.addHook('afterRowResize', (function() { + return $__5.refreshDimensions(); + })); +}; +SelectEditor.prototype.prepare = function() { + BaseEditor.prototype.prepare.apply(this, arguments); + var selectOptions = this.cellProperties.selectOptions; + var options; + if (typeof selectOptions == 'function') { + options = this.prepareOptions(selectOptions(this.row, this.col, this.prop)); + } else { + options = this.prepareOptions(selectOptions); + } + empty(this.select); + for (var option in options) { + if (options.hasOwnProperty(option)) { + var optionElement = document.createElement('OPTION'); + optionElement.value = option; + fastInnerHTML(optionElement, options[option]); + this.select.appendChild(optionElement); + } + } +}; +SelectEditor.prototype.prepareOptions = function(optionsToPrepare) { + var preparedOptions = {}; + if (Array.isArray(optionsToPrepare)) { + for (var i = 0, + len = optionsToPrepare.length; i < len; i++) { + preparedOptions[optionsToPrepare[i]] = optionsToPrepare[i]; + } + } else if (typeof optionsToPrepare == 'object') { + preparedOptions = optionsToPrepare; + } + return preparedOptions; +}; +SelectEditor.prototype.getValue = function() { + return this.select.value; +}; +SelectEditor.prototype.setValue = function(value) { + this.select.value = value; +}; +var onBeforeKeyDown = function(event) { + var instance = this; + var editor = instance.getActiveEditor(); + switch (event.keyCode) { + case KEY_CODES.ARROW_UP: + var previousOptionIndex = editor.select.selectedIndex - 1; + if (previousOptionIndex >= 0) { + editor.select[previousOptionIndex].selected = true; + } + stopImmediatePropagation(event); + event.preventDefault(); + break; + case KEY_CODES.ARROW_DOWN: + var nextOptionIndex = editor.select.selectedIndex + 1; + if (nextOptionIndex <= editor.select.length - 1) { + editor.select[nextOptionIndex].selected = true; + } + stopImmediatePropagation(event); + event.preventDefault(); + break; + } +}; +SelectEditor.prototype.open = function() { + this._opened = true; + this.refreshDimensions(); + this.select.style.display = ''; + this.instance.addHook('beforeKeyDown', onBeforeKeyDown); +}; +SelectEditor.prototype.close = function() { + this._opened = false; + this.select.style.display = 'none'; + this.instance.removeHook('beforeKeyDown', onBeforeKeyDown); +}; +SelectEditor.prototype.focus = function() { + this.select.focus(); +}; +SelectEditor.prototype.refreshDimensions = function() { + if (this.state !== Handsontable.EditorState.EDITING) { + return; + } + this.TD = this.getEditedCell(); + if (!this.TD) { + this.close(); + return; + } + var width = outerWidth(this.TD) + 1, + height = outerHeight(this.TD) + 1, + currentOffset = offset(this.TD), + containerOffset = offset(this.instance.rootElement), + scrollableContainer = getScrollableElement(this.TD), + editTop = currentOffset.top - containerOffset.top - 1 - (scrollableContainer.scrollTop || 0), + editLeft = currentOffset.left - containerOffset.left - 1 - (scrollableContainer.scrollLeft || 0), + editorSection = this.checkEditorSection(), + cssTransformOffset; + var settings = this.instance.getSettings(); + var rowHeadersCount = settings.rowHeaders ? 1 : 0; + var colHeadersCount = settings.colHeaders ? 1 : 0; + switch (editorSection) { + case 'top': + cssTransformOffset = getCssTransform(this.instance.view.wt.wtOverlays.topOverlay.clone.wtTable.holder.parentNode); + break; + case 'left': + cssTransformOffset = getCssTransform(this.instance.view.wt.wtOverlays.leftOverlay.clone.wtTable.holder.parentNode); + break; + case 'top-left-corner': + cssTransformOffset = getCssTransform(this.instance.view.wt.wtOverlays.topLeftCornerOverlay.clone.wtTable.holder.parentNode); + break; + case 'bottom-left-corner': + cssTransformOffset = getCssTransform(this.instance.view.wt.wtOverlays.bottomLeftCornerOverlay.clone.wtTable.holder.parentNode); + break; + case 'bottom': + cssTransformOffset = getCssTransform(this.instance.view.wt.wtOverlays.bottomOverlay.clone.wtTable.holder.parentNode); + break; + } + if (this.instance.getSelected()[0] === 0) { + editTop += 1; + } + if (this.instance.getSelected()[1] === 0) { + editLeft += 1; + } + var selectStyle = this.select.style; + if (cssTransformOffset && cssTransformOffset != -1) { + selectStyle[cssTransformOffset[0]] = cssTransformOffset[1]; + } else { + resetCssTransform(this.select); + } + var cellComputedStyle = getComputedStyle(this.TD); + if (parseInt(cellComputedStyle.borderTopWidth, 10) > 0) { + height -= 1; + } + if (parseInt(cellComputedStyle.borderLeftWidth, 10) > 0) { + width -= 1; + } + selectStyle.height = height + 'px'; + selectStyle.minWidth = width + 'px'; + selectStyle.top = editTop + 'px'; + selectStyle.left = editLeft + 'px'; + selectStyle.margin = '0px'; +}; +SelectEditor.prototype.getEditedCell = function() { + var editorSection = this.checkEditorSection(), + editedCell; + switch (editorSection) { + case 'top': + editedCell = this.instance.view.wt.wtOverlays.topOverlay.clone.wtTable.getCell({ + row: this.row, + col: this.col + }); + this.select.style.zIndex = 101; + break; + case 'corner': + editedCell = this.instance.view.wt.wtOverlays.topLeftCornerOverlay.clone.wtTable.getCell({ + row: this.row, + col: this.col + }); + this.select.style.zIndex = 103; + break; + case 'left': + editedCell = this.instance.view.wt.wtOverlays.leftOverlay.clone.wtTable.getCell({ + row: this.row, + col: this.col + }); + this.select.style.zIndex = 102; + break; + default: + editedCell = this.instance.getCell(this.row, this.col); + this.select.style.zIndex = ''; + break; + } + return editedCell != -1 && editedCell != -2 ? editedCell : void 0; +}; +; +registerEditor('select', SelectEditor); + +//# +},{"_baseEditor":30,"editors":29,"helpers/dom/element":45,"helpers/dom/event":46,"helpers/unicode":53}],40:[function(require,module,exports){ +"use strict"; +Object.defineProperties(exports, { + TextEditor: {get: function() { + return TextEditor; + }}, + __esModule: {value: true} +}); +var $___46__46__47_helpers_47_dom_47_element__, + $__autoResize__, + $___95_baseEditor__, + $___46__46__47_eventManager__, + $___46__46__47_editors__, + $___46__46__47_helpers_47_unicode__, + $___46__46__47_helpers_47_dom_47_event__; +var $__0 = ($___46__46__47_helpers_47_dom_47_element__ = require("helpers/dom/element"), $___46__46__47_helpers_47_dom_47_element__ && $___46__46__47_helpers_47_dom_47_element__.__esModule && $___46__46__47_helpers_47_dom_47_element__ || {default: $___46__46__47_helpers_47_dom_47_element__}), + addClass = $__0.addClass, + getCaretPosition = $__0.getCaretPosition, + getComputedStyle = $__0.getComputedStyle, + getCssTransform = $__0.getCssTransform, + getScrollableElement = $__0.getScrollableElement, + innerWidth = $__0.innerWidth, + offset = $__0.offset, + resetCssTransform = $__0.resetCssTransform, + setCaretPosition = $__0.setCaretPosition; +var autoResize = ($__autoResize__ = require("autoResize"), $__autoResize__ && $__autoResize__.__esModule && $__autoResize__ || {default: $__autoResize__}).default; +var BaseEditor = ($___95_baseEditor__ = require("_baseEditor"), $___95_baseEditor__ && $___95_baseEditor__.__esModule && $___95_baseEditor__ || {default: $___95_baseEditor__}).BaseEditor; +var eventManagerObject = ($___46__46__47_eventManager__ = require("eventManager"), $___46__46__47_eventManager__ && $___46__46__47_eventManager__.__esModule && $___46__46__47_eventManager__ || {default: $___46__46__47_eventManager__}).eventManager; +var $__4 = ($___46__46__47_editors__ = require("editors"), $___46__46__47_editors__ && $___46__46__47_editors__.__esModule && $___46__46__47_editors__ || {default: $___46__46__47_editors__}), + getEditor = $__4.getEditor, + registerEditor = $__4.registerEditor; +var KEY_CODES = ($___46__46__47_helpers_47_unicode__ = require("helpers/unicode"), $___46__46__47_helpers_47_unicode__ && $___46__46__47_helpers_47_unicode__.__esModule && $___46__46__47_helpers_47_unicode__ || {default: $___46__46__47_helpers_47_unicode__}).KEY_CODES; +var $__6 = ($___46__46__47_helpers_47_dom_47_event__ = require("helpers/dom/event"), $___46__46__47_helpers_47_dom_47_event__ && $___46__46__47_helpers_47_dom_47_event__.__esModule && $___46__46__47_helpers_47_dom_47_event__ || {default: $___46__46__47_helpers_47_dom_47_event__}), + stopPropagation = $__6.stopPropagation, + stopImmediatePropagation = $__6.stopImmediatePropagation, + isImmediatePropagationStopped = $__6.isImmediatePropagationStopped; +var TextEditor = BaseEditor.prototype.extend(); +TextEditor.prototype.init = function() { + var that = this; + this.createElements(); + this.eventManager = eventManagerObject(this); + this.bindEvents(); + this.autoResize = autoResize(); + this.instance.addHook('afterDestroy', function() { + that.destroy(); + }); +}; +TextEditor.prototype.getValue = function() { + return this.TEXTAREA.value; +}; +TextEditor.prototype.setValue = function(newValue) { + this.TEXTAREA.value = newValue; +}; +var onBeforeKeyDown = function onBeforeKeyDown(event) { + var instance = this, + that = instance.getActiveEditor(), + ctrlDown; + ctrlDown = (event.ctrlKey || event.metaKey) && !event.altKey; + if (event.target !== that.TEXTAREA || isImmediatePropagationStopped(event)) { + return; + } + if (event.keyCode === 17 || event.keyCode === 224 || event.keyCode === 91 || event.keyCode === 93) { + stopImmediatePropagation(event); + return; + } + switch (event.keyCode) { + case KEY_CODES.ARROW_RIGHT: + if (that.isInFullEditMode()) { + if ((!that.isWaiting() && !that.allowKeyEventPropagation) || (!that.isWaiting() && that.allowKeyEventPropagation && !that.allowKeyEventPropagation(event.keyCode))) { + stopImmediatePropagation(event); + } + } + break; + case KEY_CODES.ARROW_LEFT: + if (that.isInFullEditMode()) { + if ((!that.isWaiting() && !that.allowKeyEventPropagation) || (!that.isWaiting() && that.allowKeyEventPropagation && !that.allowKeyEventPropagation(event.keyCode))) { + stopImmediatePropagation(event); + } + } + break; + case KEY_CODES.ARROW_UP: + case KEY_CODES.ARROW_DOWN: + if (that.isInFullEditMode()) { + if ((!that.isWaiting() && !that.allowKeyEventPropagation) || (!that.isWaiting() && that.allowKeyEventPropagation && !that.allowKeyEventPropagation(event.keyCode))) { + stopImmediatePropagation(event); + } + } + break; + case KEY_CODES.ENTER: + var selected = that.instance.getSelected(); + var isMultipleSelection = !(selected[0] === selected[2] && selected[1] === selected[3]); + if ((ctrlDown && !isMultipleSelection) || event.altKey) { + if (that.isOpened()) { + var caretPosition = getCaretPosition(that.TEXTAREA), + value = that.getValue(); + var newValue = value.slice(0, caretPosition) + '\n' + value.slice(caretPosition); + that.setValue(newValue); + setCaretPosition(that.TEXTAREA, caretPosition + 1); + } else { + that.beginEditing(that.originalValue + '\n'); + } + stopImmediatePropagation(event); + } + event.preventDefault(); + break; + case KEY_CODES.A: + case KEY_CODES.X: + case KEY_CODES.C: + case KEY_CODES.V: + if (ctrlDown) { + stopImmediatePropagation(event); + } + break; + case KEY_CODES.BACKSPACE: + case KEY_CODES.DELETE: + case KEY_CODES.HOME: + case KEY_CODES.END: + stopImmediatePropagation(event); + break; + } + if ([KEY_CODES.ARROW_UP, KEY_CODES.ARROW_RIGHT, KEY_CODES.ARROW_DOWN, KEY_CODES.ARROW_LEFT].indexOf(event.keyCode) === -1) { + that.autoResize.resize(String.fromCharCode(event.keyCode)); + } +}; +TextEditor.prototype.open = function() { + this.refreshDimensions(); + this.instance.addHook('beforeKeyDown', onBeforeKeyDown); +}; +TextEditor.prototype.close = function(tdOutside) { + this.textareaParentStyle.display = 'none'; + this.autoResize.unObserve(); + if (document.activeElement === this.TEXTAREA) { + this.instance.listen(); + } + this.instance.removeHook('beforeKeyDown', onBeforeKeyDown); +}; +TextEditor.prototype.focus = function() { + this.TEXTAREA.focus(); + setCaretPosition(this.TEXTAREA, this.TEXTAREA.value.length); +}; +TextEditor.prototype.createElements = function() { + this.TEXTAREA = document.createElement('TEXTAREA'); + addClass(this.TEXTAREA, 'handsontableInput'); + this.textareaStyle = this.TEXTAREA.style; + this.textareaStyle.width = 0; + this.textareaStyle.height = 0; + this.TEXTAREA_PARENT = document.createElement('DIV'); + addClass(this.TEXTAREA_PARENT, 'handsontableInputHolder'); + this.textareaParentStyle = this.TEXTAREA_PARENT.style; + this.textareaParentStyle.top = 0; + this.textareaParentStyle.left = 0; + this.textareaParentStyle.display = 'none'; + this.TEXTAREA_PARENT.appendChild(this.TEXTAREA); + this.instance.rootElement.appendChild(this.TEXTAREA_PARENT); + var that = this; + this.instance._registerTimeout(setTimeout(function() { + that.refreshDimensions(); + }, 0)); +}; +TextEditor.prototype.getEditedCell = function() { + var editorSection = this.checkEditorSection(), + editedCell; + switch (editorSection) { + case 'top': + editedCell = this.instance.view.wt.wtOverlays.topOverlay.clone.wtTable.getCell({ + row: this.row, + col: this.col + }); + this.textareaParentStyle.zIndex = 101; + break; + case 'top-left-corner': + editedCell = this.instance.view.wt.wtOverlays.topLeftCornerOverlay.clone.wtTable.getCell({ + row: this.row, + col: this.col + }); + this.textareaParentStyle.zIndex = 103; + break; + case 'bottom-left-corner': + editedCell = this.instance.view.wt.wtOverlays.bottomLeftCornerOverlay.clone.wtTable.getCell({ + row: this.row, + col: this.col + }); + this.textareaParentStyle.zIndex = 103; + break; + case 'left': + editedCell = this.instance.view.wt.wtOverlays.leftOverlay.clone.wtTable.getCell({ + row: this.row, + col: this.col + }); + this.textareaParentStyle.zIndex = 102; + break; + case 'bottom': + editedCell = this.instance.view.wt.wtOverlays.bottomOverlay.clone.wtTable.getCell({ + row: this.row, + col: this.col + }); + this.textareaParentStyle.zIndex = 102; + break; + default: + editedCell = this.instance.getCell(this.row, this.col); + this.textareaParentStyle.zIndex = ''; + break; + } + return editedCell != -1 && editedCell != -2 ? editedCell : void 0; +}; +TextEditor.prototype.refreshDimensions = function() { + if (this.state !== Handsontable.EditorState.EDITING) { + return; + } + this.TD = this.getEditedCell(); + if (!this.TD) { + this.close(true); + return; + } + var currentOffset = offset(this.TD), + containerOffset = offset(this.instance.rootElement), + scrollableContainer = getScrollableElement(this.TD), + totalRowsCount = this.instance.countRows(), + editTop = currentOffset.top - containerOffset.top - 1 - (scrollableContainer.scrollTop || 0), + editLeft = currentOffset.left - containerOffset.left - 1 - (scrollableContainer.scrollLeft || 0), + settings = this.instance.getSettings(), + rowHeadersCount = settings.rowHeaders ? 1 : 0, + colHeadersCount = settings.colHeaders ? 1 : 0, + editorSection = this.checkEditorSection(), + backgroundColor = this.TD.style.backgroundColor, + cssTransformOffset; + switch (editorSection) { + case 'top': + cssTransformOffset = getCssTransform(this.instance.view.wt.wtOverlays.topOverlay.clone.wtTable.holder.parentNode); + break; + case 'left': + cssTransformOffset = getCssTransform(this.instance.view.wt.wtOverlays.leftOverlay.clone.wtTable.holder.parentNode); + break; + case 'top-left-corner': + cssTransformOffset = getCssTransform(this.instance.view.wt.wtOverlays.topLeftCornerOverlay.clone.wtTable.holder.parentNode); + break; + case 'bottom-left-corner': + cssTransformOffset = getCssTransform(this.instance.view.wt.wtOverlays.bottomLeftCornerOverlay.clone.wtTable.holder.parentNode); + break; + case 'bottom': + cssTransformOffset = getCssTransform(this.instance.view.wt.wtOverlays.bottomOverlay.clone.wtTable.holder.parentNode); + break; + } + if (colHeadersCount && this.instance.getSelected()[0] === 0 || (settings.fixedRowsBottom && this.instance.getSelected()[0] === totalRowsCount - settings.fixedRowsBottom)) { + editTop += 1; + } + if (this.instance.getSelected()[1] === 0) { + editLeft += 1; + } + if (cssTransformOffset && cssTransformOffset != -1) { + this.textareaParentStyle[cssTransformOffset[0]] = cssTransformOffset[1]; + } else { + resetCssTransform(this.textareaParentStyle); + } + this.textareaParentStyle.top = editTop + 'px'; + this.textareaParentStyle.left = editLeft + 'px'; + var cellTopOffset = this.TD.offsetTop - this.instance.view.wt.wtOverlays.topOverlay.getScrollPosition(), + cellLeftOffset = this.TD.offsetLeft - this.instance.view.wt.wtOverlays.leftOverlay.getScrollPosition(); + var width = innerWidth(this.TD) - 8; + var maxWidth = this.instance.view.maximumVisibleElementWidth(cellLeftOffset) - 9; + var height = this.TD.scrollHeight + 1; + var maxHeight = Math.max(this.instance.view.maximumVisibleElementHeight(cellTopOffset) - 2, 23); + var cellComputedStyle = getComputedStyle(this.TD); + this.TEXTAREA.style.fontSize = cellComputedStyle.fontSize; + this.TEXTAREA.style.fontFamily = cellComputedStyle.fontFamily; + this.TEXTAREA.style.backgroundColor = ''; + this.TEXTAREA.style.backgroundColor = backgroundColor ? backgroundColor : getComputedStyle(this.TEXTAREA).backgroundColor; + this.autoResize.init(this.TEXTAREA, { + minHeight: Math.min(height, maxHeight), + maxHeight: maxHeight, + minWidth: Math.min(width, maxWidth), + maxWidth: maxWidth + }, true); + this.textareaParentStyle.display = 'block'; +}; +TextEditor.prototype.bindEvents = function() { + var editor = this; + this.eventManager.addEventListener(this.TEXTAREA, 'cut', function(event) { + stopPropagation(event); + }); + this.eventManager.addEventListener(this.TEXTAREA, 'paste', function(event) { + stopPropagation(event); + }); + this.instance.addHook('afterScrollHorizontally', function() { + editor.refreshDimensions(); + }); + this.instance.addHook('afterScrollVertically', function() { + editor.refreshDimensions(); + }); + this.instance.addHook('afterColumnResize', function() { + editor.refreshDimensions(); + editor.focus(); + }); + this.instance.addHook('afterRowResize', function() { + editor.refreshDimensions(); + editor.focus(); + }); + this.instance.addHook('afterDestroy', function() { + editor.eventManager.destroy(); + }); +}; +TextEditor.prototype.destroy = function() { + this.eventManager.destroy(); +}; +; +registerEditor('text', TextEditor); + +//# +},{"_baseEditor":30,"autoResize":"autoResize","editors":29,"eventManager":41,"helpers/dom/element":45,"helpers/dom/event":46,"helpers/unicode":53}],41:[function(require,module,exports){ +"use strict"; +Object.defineProperties(exports, { + EventManager: {get: function() { + return EventManager; + }}, + eventManager: {get: function() { + return eventManager; + }}, + __esModule: {value: true} +}); +var $__helpers_47_dom_47_element__, + $__helpers_47_browser__; +var $__0 = ($__helpers_47_dom_47_element__ = require("helpers/dom/element"), $__helpers_47_dom_47_element__ && $__helpers_47_dom_47_element__.__esModule && $__helpers_47_dom_47_element__ || {default: $__helpers_47_dom_47_element__}), + polymerWrap = $__0.polymerWrap, + closest = $__0.closest; +var isWebComponentSupportedNatively = ($__helpers_47_browser__ = require("helpers/browser"), $__helpers_47_browser__ && $__helpers_47_browser__.__esModule && $__helpers_47_browser__ || {default: $__helpers_47_browser__}).isWebComponentSupportedNatively; +var EventManager = function EventManager() { + var context = arguments[0] !== (void 0) ? arguments[0] : null; + this.context = context || this; + if (!this.context.eventListeners) { + this.context.eventListeners = []; + } +}; +($traceurRuntime.createClass)(EventManager, { + addEventListener: function(element, eventName, callback) { + var $__2 = this; + var context = this.context; + function callbackProxy(event) { + if (event.target == void 0 && event.srcElement != void 0) { + if (event.definePoperty) { + event.definePoperty('target', {value: event.srcElement}); + } else { + event.target = event.srcElement; + } + } + if (event.preventDefault == void 0) { + if (event.definePoperty) { + event.definePoperty('preventDefault', {value: function() { + this.returnValue = false; + }}); + } else { + event.preventDefault = function() { + this.returnValue = false; + }; + } + } + event = extendEvent(context, event); + callback.call(this, event); + } + this.context.eventListeners.push({ + element: element, + event: eventName, + callback: callback, + callbackProxy: callbackProxy + }); + if (window.addEventListener) { + element.addEventListener(eventName, callbackProxy, false); + } else { + element.attachEvent('on' + eventName, callbackProxy); + } + Handsontable.countEventManagerListeners++; + return (function() { + $__2.removeEventListener(element, eventName, callback); + }); + }, + removeEventListener: function(element, eventName, callback) { + var len = this.context.eventListeners.length; + var tmpEvent; + while (len--) { + tmpEvent = this.context.eventListeners[len]; + if (tmpEvent.event == eventName && tmpEvent.element == element) { + if (callback && callback != tmpEvent.callback) { + continue; + } + this.context.eventListeners.splice(len, 1); + if (tmpEvent.element.removeEventListener) { + tmpEvent.element.removeEventListener(tmpEvent.event, tmpEvent.callbackProxy, false); + } else { + tmpEvent.element.detachEvent('on' + tmpEvent.event, tmpEvent.callbackProxy); + } + Handsontable.countEventManagerListeners--; + } + } + }, + clearEvents: function() { + if (!this.context) { + return; + } + var len = this.context.eventListeners.length; + while (len--) { + var event = this.context.eventListeners[len]; + if (event) { + this.removeEventListener(event.element, event.event, event.callback); + } + } + }, + clear: function() { + this.clearEvents(); + }, + destroy: function() { + this.clearEvents(); + this.context = null; + }, + fireEvent: function(element, eventName) { + var options = { + bubbles: true, + cancelable: (eventName !== 'mousemove'), + view: window, + detail: 0, + screenX: 0, + screenY: 0, + clientX: 1, + clientY: 1, + ctrlKey: false, + altKey: false, + shiftKey: false, + metaKey: false, + button: 0, + relatedTarget: undefined + }; + var event; + if (document.createEvent) { + event = document.createEvent('MouseEvents'); + event.initMouseEvent(eventName, options.bubbles, options.cancelable, options.view, options.detail, options.screenX, options.screenY, options.clientX, options.clientY, options.ctrlKey, options.altKey, options.shiftKey, options.metaKey, options.button, options.relatedTarget || document.body.parentNode); + } else { + event = document.createEventObject(); + } + if (element.dispatchEvent) { + element.dispatchEvent(event); + } else { + element.fireEvent('on' + eventName, event); + } + } +}, {}); +function extendEvent(context, event) { + var componentName = 'HOT-TABLE'; + var isHotTableSpotted; + var fromElement; + var realTarget; + var target; + var len; + event.isTargetWebComponent = false; + event.realTarget = event.target; + if (!Handsontable.eventManager.isHotTableEnv) { + return event; + } + event = polymerWrap(event); + len = event.path ? event.path.length : 0; + while (len--) { + if (event.path[len].nodeName === componentName) { + isHotTableSpotted = true; + } else if (isHotTableSpotted && event.path[len].shadowRoot) { + target = event.path[len]; + break; + } + if (len === 0 && !target) { + target = event.path[len]; + } + } + if (!target) { + target = event.target; + } + event.isTargetWebComponent = true; + if (isWebComponentSupportedNatively()) { + event.realTarget = event.srcElement || event.toElement; + } else if (context instanceof Handsontable.Core || context instanceof Walkontable) { + if (context instanceof Handsontable.Core) { + fromElement = context.view ? context.view.wt.wtTable.TABLE : null; + } else if (context instanceof Walkontable) { + fromElement = context.wtTable.TABLE.parentNode.parentNode; + } + realTarget = closest(event.target, [componentName], fromElement); + if (realTarget) { + event.realTarget = fromElement.querySelector(componentName) || event.target; + } else { + event.realTarget = event.target; + } + } + Object.defineProperty(event, 'target', { + get: function() { + return polymerWrap(target); + }, + enumerable: true, + configurable: true + }); + return event; +} +; +//window.Handsontable = window.Handsontable || {}; +Handsontable.countEventManagerListeners = 0; +Handsontable.eventManager = eventManager; +function eventManager(context) { + return new EventManager(context); +} + +//# +},{"helpers/browser":43,"helpers/dom/element":45}],42:[function(require,module,exports){ +"use strict"; +Object.defineProperties(exports, { + to2dArray: {get: function() { + return to2dArray; + }}, + extendArray: {get: function() { + return extendArray; + }}, + pivot: {get: function() { + return pivot; + }}, + arrayReduce: {get: function() { + return arrayReduce; + }}, + arrayFilter: {get: function() { + return arrayFilter; + }}, + arrayMap: {get: function() { + return arrayMap; + }}, + arrayEach: {get: function() { + return arrayEach; + }}, + arraySum: {get: function() { + return arraySum; + }}, + arrayMax: {get: function() { + return arrayMax; + }}, + arrayMin: {get: function() { + return arrayMin; + }}, + arrayAvg: {get: function() { + return arrayAvg; + }}, + arrayFlatten: {get: function() { + return arrayFlatten; + }}, + arrayUnique: {get: function() { + return arrayUnique; + }}, + __esModule: {value: true} +}); +function to2dArray(arr) { + var i = 0, + ilen = arr.length; + while (i < ilen) { + arr[i] = [arr[i]]; + i++; + } +} +function extendArray(arr, extension) { + var i = 0, + ilen = extension.length; + while (i < ilen) { + arr.push(extension[i]); + i++; + } +} +function pivot(arr) { + var pivotedArr = []; + if (!arr || arr.length === 0 || !arr[0] || arr[0].length === 0) { + return pivotedArr; + } + var rowCount = arr.length; + var colCount = arr[0].length; + for (var i = 0; i < rowCount; i++) { + for (var j = 0; j < colCount; j++) { + if (!pivotedArr[j]) { + pivotedArr[j] = []; + } + pivotedArr[j][i] = arr[i][j]; + } + } + return pivotedArr; +} +function arrayReduce(array, iteratee, accumulator, initFromArray) { + var index = -1, + length = array.length; + if (initFromArray && length) { + accumulator = array[++index]; + } + while (++index < length) { + accumulator = iteratee(accumulator, array[index], index, array); + } + return accumulator; +} +function arrayFilter(array, predicate) { + var index = -1, + length = array.length, + resIndex = -1, + result = []; + while (++index < length) { + var value = array[index]; + if (predicate(value, index, array)) { + result[++resIndex] = value; + } + } + return result; +} +function arrayMap(array, iteratee) { + var index = -1, + length = array.length, + resIndex = -1, + result = []; + while (++index < length) { + var value = array[index]; + result[++resIndex] = iteratee(value, index, array); + } + return result; +} +function arrayEach(array, iteratee) { + var index = -1, + length = array.length; + while (++index < length) { + if (iteratee(array[index], index, array) === false) { + break; + } + } + return array; +} +function arraySum(array) { + return arrayReduce(array, (function(a, b) { + return (a + b); + }), 0); +} +function arrayMax(array) { + return arrayReduce(array, (function(a, b) { + return (a > b ? a : b); + }), Array.isArray(array) ? array[0] : void 0); +} +function arrayMin(array) { + return arrayReduce(array, (function(a, b) { + return (a < b ? a : b); + }), Array.isArray(array) ? array[0] : void 0); +} +function arrayAvg(array) { + if (!array.length) { + return 0; + } + return arraySum(array) / array.length; +} +function arrayFlatten(array) { + return arrayReduce(array, (function(initial, value) { + return initial.concat(Array.isArray(value) ? arrayFlatten(value) : value); + }), []); +} +function arrayUnique(array) { + var unique = []; + arrayEach(array, (function(value) { + if (unique.indexOf(value) === -1) { + unique.push(value); + } + })); + return unique; +} + +//# +},{}],43:[function(require,module,exports){ +"use strict"; +Object.defineProperties(exports, { + isIE8: {get: function() { + return isIE8; + }}, + isIE9: {get: function() { + return isIE9; + }}, + isSafari: {get: function() { + return isSafari; + }}, + isChrome: {get: function() { + return isChrome; + }}, + isMobileBrowser: {get: function() { + return isMobileBrowser; + }}, + isTouchSupported: {get: function() { + return isTouchSupported; + }}, + isWebComponentSupportedNatively: {get: function() { + return isWebComponentSupportedNatively; + }}, + hasCaptionProblem: {get: function() { + return hasCaptionProblem; + }}, + __esModule: {value: true} +}); +var _isIE8 = !(document.createTextNode('test').textContent); +function isIE8() { + return _isIE8; +} +var _isIE9 = !!(document.documentMode); +function isIE9() { + return _isIE9; +} +var _isSafari = (/Safari/.test(navigator.userAgent) && /Apple Computer/.test(navigator.vendor)); +function isSafari() { + return _isSafari; +} +var _isChrome = (/Chrome/.test(navigator.userAgent) && /Google/.test(navigator.vendor)); +function isChrome() { + return _isChrome; +} +function isMobileBrowser(userAgent) { + if (!userAgent) { + userAgent = navigator.userAgent; + } + return (/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(userAgent)); +} +function isTouchSupported() { + return ('ontouchstart' in window); +} +function isWebComponentSupportedNatively() { + var test = document.createElement('div'); + return test.createShadowRoot && test.createShadowRoot.toString().match(/\[native code\]/) ? true : false; +} +var _hasCaptionProblem; +function detectCaptionProblem() { + var TABLE = document.createElement('TABLE'); + TABLE.style.borderSpacing = 0; + TABLE.style.borderWidth = 0; + TABLE.style.padding = 0; + var TBODY = document.createElement('TBODY'); + TABLE.appendChild(TBODY); + TBODY.appendChild(document.createElement('TR')); + TBODY.firstChild.appendChild(document.createElement('TD')); + TBODY.firstChild.firstChild.innerHTML = 't
t'; + var CAPTION = document.createElement('CAPTION'); + CAPTION.innerHTML = 'c
c
c
c'; + CAPTION.style.padding = 0; + CAPTION.style.margin = 0; + TABLE.insertBefore(CAPTION, TBODY); + document.body.appendChild(TABLE); + _hasCaptionProblem = (TABLE.offsetHeight < 2 * TABLE.lastChild.offsetHeight); + document.body.removeChild(TABLE); +} +function hasCaptionProblem() { + if (_hasCaptionProblem === void 0) { + detectCaptionProblem(); + } + return _hasCaptionProblem; +} + +//# +},{}],44:[function(require,module,exports){ +"use strict"; +Object.defineProperties(exports, { + spreadsheetColumnLabel: {get: function() { + return spreadsheetColumnLabel; + }}, + createSpreadsheetData: {get: function() { + return createSpreadsheetData; + }}, + createSpreadsheetObjectData: {get: function() { + return createSpreadsheetObjectData; + }}, + createEmptySpreadsheetData: {get: function() { + return createEmptySpreadsheetData; + }}, + translateRowsToColumns: {get: function() { + return translateRowsToColumns; + }}, + cellMethodLookupFactory: {get: function() { + return cellMethodLookupFactory; + }}, + __esModule: {value: true} +}); +var $__object__; +var getPrototypeOf = ($__object__ = require("object"), $__object__ && $__object__.__esModule && $__object__ || {default: $__object__}).getPrototypeOf; +function spreadsheetColumnLabel(index) { + var dividend = index + 1; + var columnLabel = ''; + var modulo; + while (dividend > 0) { + modulo = (dividend - 1) % 26; + columnLabel = String.fromCharCode(65 + modulo) + columnLabel; + dividend = parseInt((dividend - modulo) / 26, 10); + } + return columnLabel; +} +function createSpreadsheetData(rowCount, colCount) { + rowCount = typeof rowCount === 'number' ? rowCount : 100; + colCount = typeof colCount === 'number' ? colCount : 4; + var rows = [], + i, + j; + for (i = 0; i < rowCount; i++) { + var row = []; + for (j = 0; j < colCount; j++) { + row.push(spreadsheetColumnLabel(j) + (i + 1)); + } + rows.push(row); + } + return rows; +} +function createSpreadsheetObjectData(rowCount, colCount) { + rowCount = typeof rowCount === 'number' ? rowCount : 100; + colCount = typeof colCount === 'number' ? colCount : 4; + var rows = [], + i, + j; + for (i = 0; i < rowCount; i++) { + var row = {}; + for (j = 0; j < colCount; j++) { + row['prop' + j] = spreadsheetColumnLabel(j) + (i + 1); + } + rows.push(row); + } + return rows; +} +function createEmptySpreadsheetData(rows, columns) { + var data = []; + var row; + for (var i = 0; i < rows; i++) { + row = []; + for (var j = 0; j < columns; j++) { + row.push(''); + } + data.push(row); + } + return data; +} +function translateRowsToColumns(input) { + var i, + ilen, + j, + jlen, + output = [], + olen = 0; + for (i = 0, ilen = input.length; i < ilen; i++) { + for (j = 0, jlen = input[i].length; j < jlen; j++) { + if (j == olen) { + output.push([]); + olen++; + } + output[j].push(input[i][j]); + } + } + return output; +} +function cellMethodLookupFactory(methodName, allowUndefined) { + allowUndefined = typeof allowUndefined == 'undefined' ? true : allowUndefined; + return function cellMethodLookup(row, col) { + return (function getMethodFromProperties(properties) { + if (!properties) { + return; + } else if (properties.hasOwnProperty(methodName) && properties[methodName] !== void 0) { + return properties[methodName]; + } else if (properties.hasOwnProperty('type') && properties.type) { + var type; + if (typeof properties.type != 'string') { + throw new Error('Cell type must be a string '); + } + type = translateTypeNameToObject(properties.type); + if (type.hasOwnProperty(methodName)) { + return type[methodName]; + } else if (allowUndefined) { + return; + } + } + return getMethodFromProperties(getPrototypeOf(properties)); + })(typeof row == 'number' ? this.getCellMeta(row, col) : row); + }; + function translateTypeNameToObject(typeName) { + var type = Handsontable.cellTypes[typeName]; + if (typeof type == 'undefined') { + throw new Error('You declared cell type "' + typeName + '" as a string that is not mapped to a known object. ' + 'Cell type must be an object or a string mapped to an object in Handsontable.cellTypes'); + } + return type; + } +} + +//# +},{"object":50}],45:[function(require,module,exports){ +"use strict"; +Object.defineProperties(exports, { + closest: {get: function() { + return closest; + }}, + isChildOf: {get: function() { + return isChildOf; + }}, + isChildOfWebComponentTable: {get: function() { + return isChildOfWebComponentTable; + }}, + polymerWrap: {get: function() { + return polymerWrap; + }}, + polymerUnwrap: {get: function() { + return polymerUnwrap; + }}, + index: {get: function() { + return index; + }}, + overlayContainsElement: {get: function() { + return overlayContainsElement; + }}, + hasClass: {get: function() { + return hasClass; + }}, + addClass: {get: function() { + return addClass; + }}, + removeClass: {get: function() { + return removeClass; + }}, + removeTextNodes: {get: function() { + return removeTextNodes; + }}, + empty: {get: function() { + return empty; + }}, + HTML_CHARACTERS: {get: function() { + return HTML_CHARACTERS; + }}, + fastInnerHTML: {get: function() { + return fastInnerHTML; + }}, + fastInnerText: {get: function() { + return fastInnerText; + }}, + isVisible: {get: function() { + return isVisible; + }}, + offset: {get: function() { + return offset; + }}, + getWindowScrollTop: {get: function() { + return getWindowScrollTop; + }}, + getWindowScrollLeft: {get: function() { + return getWindowScrollLeft; + }}, + getScrollTop: {get: function() { + return getScrollTop; + }}, + getScrollLeft: {get: function() { + return getScrollLeft; + }}, + getScrollableElement: {get: function() { + return getScrollableElement; + }}, + getTrimmingContainer: {get: function() { + return getTrimmingContainer; + }}, + getStyle: {get: function() { + return getStyle; + }}, + getComputedStyle: {get: function() { + return getComputedStyle; + }}, + outerWidth: {get: function() { + return outerWidth; + }}, + outerHeight: {get: function() { + return outerHeight; + }}, + innerHeight: {get: function() { + return innerHeight; + }}, + innerWidth: {get: function() { + return innerWidth; + }}, + addEvent: {get: function() { + return addEvent; + }}, + removeEvent: {get: function() { + return removeEvent; + }}, + getCaretPosition: {get: function() { + return getCaretPosition; + }}, + getSelectionEndPosition: {get: function() { + return getSelectionEndPosition; + }}, + getSelectionText: {get: function() { + return getSelectionText; + }}, + setCaretPosition: {get: function() { + return setCaretPosition; + }}, + getScrollbarWidth: {get: function() { + return getScrollbarWidth; + }}, + setOverlayPosition: {get: function() { + return setOverlayPosition; + }}, + getCssTransform: {get: function() { + return getCssTransform; + }}, + resetCssTransform: {get: function() { + return resetCssTransform; + }}, + isInput: {get: function() { + return isInput; + }}, + isOutsideInput: {get: function() { + return isOutsideInput; + }}, + requestAnimationFrame: {get: function() { + return requestAnimationFrame; + }}, + cancelAnimationFrame: {get: function() { + return cancelAnimationFrame; + }}, + __esModule: {value: true} +}); +var $___46__46__47_browser__; +var $__0 = ($___46__46__47_browser__ = require("../browser"), $___46__46__47_browser__ && $___46__46__47_browser__.__esModule && $___46__46__47_browser__ || {default: $___46__46__47_browser__}), + isIE8 = $__0.isIE8, + isIE9 = $__0.isIE9, + isSafari = $__0.isSafari, + hasCaptionProblem = $__0.hasCaptionProblem; +function closest(element, nodes, until) { + while (element != null && element !== until) { + if (element.nodeType === Node.ELEMENT_NODE && (nodes.indexOf(element.nodeName) > -1 || nodes.indexOf(element) > -1)) { + return element; + } + if (element.host && element.nodeType === Node.DOCUMENT_FRAGMENT_NODE) { + element = element.host; + } else { + element = element.parentNode; + } + } + return null; +} +function isChildOf(child, parent) { + var node = child.parentNode; + var queriedParents = []; + if (typeof parent === 'string') { + queriedParents = Array.prototype.slice.call(document.querySelectorAll(parent), 0); + } else { + queriedParents.push(parent); + } + while (node != null) { + if (queriedParents.indexOf(node) > -1) { + return true; + } + node = node.parentNode; + } + return false; +} +function isChildOfWebComponentTable(element) { + var hotTableName = 'hot-table', + result = false, + parentNode; + parentNode = polymerWrap(element); + function isHotTable(element) { + return element.nodeType === Node.ELEMENT_NODE && element.nodeName === hotTableName.toUpperCase(); + } + while (parentNode != null) { + if (isHotTable(parentNode)) { + result = true; + break; + } else if (parentNode.host && parentNode.nodeType === Node.DOCUMENT_FRAGMENT_NODE) { + result = isHotTable(parentNode.host); + if (result) { + break; + } + parentNode = parentNode.host; + } + parentNode = parentNode.parentNode; + } + return result; +} +function polymerWrap(element) { + return typeof Polymer !== 'undefined' && typeof wrap === 'function' ? wrap(element) : element; +} +function polymerUnwrap(element) { + return typeof Polymer !== 'undefined' && typeof unwrap === 'function' ? unwrap(element) : element; +} +function index(element) { + var i = 0; + if (element.previousSibling) { + while (element = element.previousSibling) { + ++i; + } + } + return i; +} +function overlayContainsElement(overlayType, element) { + var overlayElement = document.querySelector('.ht_clone_' + overlayType); + return overlayElement ? overlayElement.contains(element) : null; +} +var classListSupport = document.documentElement.classList ? true : false; +var _hasClass, + _addClass, + _removeClass; +function filterEmptyClassNames(classNames) { + var len = 0, + result = []; + if (!classNames || !classNames.length) { + return result; + } + while (classNames[len]) { + result.push(classNames[len]); + len++; + } + return result; +} +if (classListSupport) { + var isSupportMultipleClassesArg = (function() { + var element = document.createElement('div'); + element.classList.add('test', 'test2'); + return element.classList.contains('test2'); + }()); + _hasClass = function _hasClass(element, className) { + if (className === '') { + return false; + } + return element.classList.contains(className); + }; + _addClass = function _addClass(element, className) { + var len = 0; + if (typeof className === 'string') { + className = className.split(' '); + } + className = filterEmptyClassNames(className); + if (isSupportMultipleClassesArg) { + element.classList.add.apply(element.classList, className); + } else { + while (className && className[len]) { + element.classList.add(className[len]); + len++; + } + } + }; + _removeClass = function _removeClass(element, className) { + var len = 0; + if (typeof className === 'string') { + className = className.split(' '); + } + className = filterEmptyClassNames(className); + if (isSupportMultipleClassesArg) { + element.classList.remove.apply(element.classList, className); + } else { + while (className && className[len]) { + element.classList.remove(className[len]); + len++; + } + } + }; +} else { + var createClassNameRegExp = function createClassNameRegExp(className) { + return new RegExp('(\\s|^)' + className + '(\\s|$)'); + }; + _hasClass = function _hasClass(element, className) { + return element.className.match(createClassNameRegExp(className)) ? true : false; + }; + _addClass = function _addClass(element, className) { + var len = 0, + _className = element.className; + if (typeof className === 'string') { + className = className.split(' '); + } + if (_className === '') { + _className = className.join(' '); + } else { + while (className && className[len]) { + if (!createClassNameRegExp(className[len]).test(_className)) { + _className += ' ' + className[len]; + } + len++; + } + } + element.className = _className; + }; + _removeClass = function _removeClass(element, className) { + var len = 0, + _className = element.className; + if (typeof className === 'string') { + className = className.split(' '); + } + while (className && className[len]) { + _className = _className.replace(createClassNameRegExp(className[len]), ' ').trim(); + len++; + } + if (element.className !== _className) { + element.className = _className; + } + }; +} +function hasClass(element, className) { + return _hasClass(element, className); +} +function addClass(element, className) { + return _addClass(element, className); +} +function removeClass(element, className) { + return _removeClass(element, className); +} +function removeTextNodes(element, parent) { + if (element.nodeType === 3) { + parent.removeChild(element); + } else if (['TABLE', 'THEAD', 'TBODY', 'TFOOT', 'TR'].indexOf(element.nodeName) > -1) { + var childs = element.childNodes; + for (var i = childs.length - 1; i >= 0; i--) { + removeTextNodes(childs[i], element); + } + } +} +function empty(element) { + var child; + while (child = element.lastChild) { + element.removeChild(child); + } +} +var HTML_CHARACTERS = /(<(.*)>|&(.*);)/; +function fastInnerHTML(element, content) { + if (HTML_CHARACTERS.test(content)) { + element.innerHTML = content; + } else { + fastInnerText(element, content); + } +} +var textContextSupport = document.createTextNode('test').textContent ? true : false; +function fastInnerText(element, content) { + var child = element.firstChild; + if (child && child.nodeType === 3 && child.nextSibling === null) { + if (textContextSupport) { + child.textContent = content; + } else { + child.data = content; + } + } else { + empty(element); + element.appendChild(document.createTextNode(content)); + } +} +function isVisible(elem) { + var next = elem; + while (polymerUnwrap(next) !== document.documentElement) { + if (next === null) { + return false; + } else if (next.nodeType === Node.DOCUMENT_FRAGMENT_NODE) { + if (next.host) { + if (next.host.impl) { + return isVisible(next.host.impl); + } else if (next.host) { + return isVisible(next.host); + } else { + throw new Error('Lost in Web Components world'); + } + } else { + return false; + } + } else if (next.style.display === 'none') { + return false; + } + next = next.parentNode; + } + return true; +} +function offset(elem) { + var offsetLeft, + offsetTop, + lastElem, + docElem, + box; + docElem = document.documentElement; + if (hasCaptionProblem() && elem.firstChild && elem.firstChild.nodeName === 'CAPTION') { + box = elem.getBoundingClientRect(); + return { + top: box.top + (window.pageYOffset || docElem.scrollTop) - (docElem.clientTop || 0), + left: box.left + (window.pageXOffset || docElem.scrollLeft) - (docElem.clientLeft || 0) + }; + } + offsetLeft = elem.offsetLeft; + offsetTop = elem.offsetTop; + lastElem = elem; + while (elem = elem.offsetParent) { + if (elem === document.body) { + break; + } + offsetLeft += elem.offsetLeft; + offsetTop += elem.offsetTop; + lastElem = elem; + } + if (lastElem && lastElem.style.position === 'fixed') { + offsetLeft += window.pageXOffset || docElem.scrollLeft; + offsetTop += window.pageYOffset || docElem.scrollTop; + } + return { + left: offsetLeft, + top: offsetTop + }; +} +function getWindowScrollTop() { + var res = window.scrollY; + if (res === void 0) { + res = document.documentElement.scrollTop; + } + return res; +} +function getWindowScrollLeft() { + var res = window.scrollX; + if (res === void 0) { + res = document.documentElement.scrollLeft; + } + return res; +} +function getScrollTop(element) { + if (element === window) { + return getWindowScrollTop(); + } else { + return element.scrollTop; + } +} +function getScrollLeft(element) { + if (element === window) { + return getWindowScrollLeft(); + } else { + return element.scrollLeft; + } +} +function getScrollableElement(element) { + var el = element.parentNode, + props = ['auto', 'scroll'], + overflow, + overflowX, + overflowY, + computedStyle = '', + computedOverflow = '', + computedOverflowY = '', + computedOverflowX = ''; + while (el && el.style && document.body !== el) { + overflow = el.style.overflow; + overflowX = el.style.overflowX; + overflowY = el.style.overflowY; + if (overflow == 'scroll' || overflowX == 'scroll' || overflowY == 'scroll') { + return el; + } else if (window.getComputedStyle) { + computedStyle = window.getComputedStyle(el); + computedOverflow = computedStyle.getPropertyValue('overflow'); + computedOverflowY = computedStyle.getPropertyValue('overflow-y'); + computedOverflowX = computedStyle.getPropertyValue('overflow-x'); + if (computedOverflow === 'scroll' || computedOverflowX === 'scroll' || computedOverflowY === 'scroll') { + return el; + } + } + if (el.clientHeight <= el.scrollHeight && (props.indexOf(overflowY) !== -1 || props.indexOf(overflow) !== -1 || props.indexOf(computedOverflow) !== -1 || props.indexOf(computedOverflowY) !== -1)) { + return el; + } + if (el.clientWidth <= el.scrollWidth && (props.indexOf(overflowX) !== -1 || props.indexOf(overflow) !== -1 || props.indexOf(computedOverflow) !== -1 || props.indexOf(computedOverflowX) !== -1)) { + return el; + } + el = el.parentNode; + } + return window; +} +function getTrimmingContainer(base) { + var el = base.parentNode; + while (el && el.style && document.body !== el) { + if (el.style.overflow !== 'visible' && el.style.overflow !== '') { + return el; + } else if (window.getComputedStyle) { + var computedStyle = window.getComputedStyle(el); + if (computedStyle.getPropertyValue('overflow') !== 'visible' && computedStyle.getPropertyValue('overflow') !== '') { + return el; + } + } + el = el.parentNode; + } + return window; +} +function getStyle(element, prop) { + if (!element) { + return; + } else if (element === window) { + if (prop === 'width') { + return window.innerWidth + 'px'; + } else if (prop === 'height') { + return window.innerHeight + 'px'; + } + return; + } + var styleProp = element.style[prop], + computedStyle; + if (styleProp !== '' && styleProp !== void 0) { + return styleProp; + } else { + computedStyle = getComputedStyle(element); + if (computedStyle[prop] !== '' && computedStyle[prop] !== void 0) { + return computedStyle[prop]; + } + return void 0; + } +} +function getComputedStyle(element) { + return element.currentStyle || document.defaultView.getComputedStyle(element); +} +function outerWidth(element) { + return element.offsetWidth; +} +function outerHeight(elem) { + if (hasCaptionProblem() && elem.firstChild && elem.firstChild.nodeName === 'CAPTION') { + return elem.offsetHeight + elem.firstChild.offsetHeight; + } else { + return elem.offsetHeight; + } +} +function innerHeight(element) { + return element.clientHeight || element.innerHeight; +} +function innerWidth(element) { + return element.clientWidth || element.innerWidth; +} +function addEvent(element, event, callback) { + if (window.addEventListener) { + element.addEventListener(event, callback, false); + } else { + element.attachEvent('on' + event, callback); + } +} +function removeEvent(element, event, callback) { + if (window.removeEventListener) { + element.removeEventListener(event, callback, false); + } else { + element.detachEvent('on' + event, callback); + } +} +function getCaretPosition(el) { + if (el.selectionStart) { + return el.selectionStart; + } else if (document.selection) { + el.focus(); + var r = document.selection.createRange(); + if (r == null) { + return 0; + } + var re = el.createTextRange(); + var rc = re.duplicate(); + re.moveToBookmark(r.getBookmark()); + rc.setEndPoint('EndToStart', re); + return rc.text.length; + } + return 0; +} +function getSelectionEndPosition(el) { + if (el.selectionEnd) { + return el.selectionEnd; + } else if (document.selection) { + var r = document.selection.createRange(); + if (r == null) { + return 0; + } + var re = el.createTextRange(); + return re.text.indexOf(r.text) + r.text.length; + } +} +function getSelectionText() { + var text = ''; + if (window.getSelection) { + text = window.getSelection().toString(); + } else if (document.selection && document.selection.type !== 'Control') { + text = document.selection.createRange().text; + } + return text; +} +function setCaretPosition(element, pos, endPos) { + if (endPos === void 0) { + endPos = pos; + } + if (element.setSelectionRange) { + element.focus(); + try { + element.setSelectionRange(pos, endPos); + } catch (err) { + var elementParent = element.parentNode; + var parentDisplayValue = elementParent.style.display; + elementParent.style.display = 'block'; + element.setSelectionRange(pos, endPos); + elementParent.style.display = parentDisplayValue; + } + } else if (element.createTextRange) { + var range = element.createTextRange(); + range.collapse(true); + range.moveEnd('character', endPos); + range.moveStart('character', pos); + range.select(); + } +} +var cachedScrollbarWidth; +function walkontableCalculateScrollbarWidth() { + var inner = document.createElement('p'); + inner.style.width = '100%'; + inner.style.height = '200px'; + var outer = document.createElement('div'); + outer.style.position = 'absolute'; + outer.style.top = '0px'; + outer.style.left = '0px'; + outer.style.visibility = 'hidden'; + outer.style.width = '200px'; + outer.style.height = '150px'; + outer.style.overflow = 'hidden'; + outer.appendChild(inner); + (document.body || document.documentElement).appendChild(outer); + var w1 = inner.offsetWidth; + outer.style.overflow = 'scroll'; + var w2 = inner.offsetWidth; + if (w1 == w2) { + w2 = outer.clientWidth; + } + (document.body || document.documentElement).removeChild(outer); + return (w1 - w2); +} +function getScrollbarWidth() { + if (cachedScrollbarWidth === void 0) { + cachedScrollbarWidth = walkontableCalculateScrollbarWidth(); + } + return cachedScrollbarWidth; +} +function setOverlayPosition(overlayElem, left, top) { + if (isIE8() || isIE9()) { + overlayElem.style.top = top; + overlayElem.style.left = left; + } else if (isSafari()) { + overlayElem.style['-webkit-transform'] = 'translate3d(' + left + ',' + top + ',0)'; + } else { + overlayElem.style.transform = 'translate3d(' + left + ',' + top + ',0)'; + } +} +function getCssTransform(element) { + var transform; + if (element.style.transform && (transform = element.style.transform) !== '') { + return ['transform', transform]; + } else if (element.style['-webkit-transform'] && (transform = element.style['-webkit-transform']) !== '') { + return ['-webkit-transform', transform]; + } + return -1; +} +function resetCssTransform(element) { + if (element.transform && element.transform !== '') { + element.transform = ''; + } else if (element['-webkit-transform'] && element['-webkit-transform'] !== '') { + element['-webkit-transform'] = ''; + } +} +function isInput(element) { + var inputs = ['INPUT', 'SELECT', 'TEXTAREA']; + return inputs.indexOf(element.nodeName) > -1 || element.contentEditable === 'true'; +} +function isOutsideInput(element) { + return isInput(element) && element.className.indexOf('handsontableInput') == -1 && element.className.indexOf('copyPaste') == -1; +} +var lastTime = 0; +var vendors = ['ms', 'moz', 'webkit', 'o']; +var _requestAnimationFrame = window.requestAnimationFrame; +var _cancelAnimationFrame = window.cancelAnimationFrame; +for (var x = 0; x < vendors.length && !_requestAnimationFrame; ++x) { + _requestAnimationFrame = window[vendors[x] + 'RequestAnimationFrame']; + _cancelAnimationFrame = window[vendors[x] + 'CancelAnimationFrame'] || window[vendors[x] + 'CancelRequestAnimationFrame']; +} +if (!_requestAnimationFrame) { + _requestAnimationFrame = function(callback) { + var currTime = new Date().getTime(); + var timeToCall = Math.max(0, 16 - (currTime - lastTime)); + var id = window.setTimeout(function() { + callback(currTime + timeToCall); + }, timeToCall); + lastTime = currTime + timeToCall; + return id; + }; +} +if (!_cancelAnimationFrame) { + _cancelAnimationFrame = function(id) { + clearTimeout(id); + }; +} +function requestAnimationFrame(callback) { + return _requestAnimationFrame.call(window, callback); +} +function cancelAnimationFrame(id) { + _cancelAnimationFrame.call(window, id); +} + +//# +},{"../browser":43}],46:[function(require,module,exports){ +"use strict"; +Object.defineProperties(exports, { + stopImmediatePropagation: {get: function() { + return stopImmediatePropagation; + }}, + isImmediatePropagationStopped: {get: function() { + return isImmediatePropagationStopped; + }}, + stopPropagation: {get: function() { + return stopPropagation; + }}, + pageX: {get: function() { + return pageX; + }}, + pageY: {get: function() { + return pageY; + }}, + __esModule: {value: true} +}); +function stopImmediatePropagation(event) { + event.isImmediatePropagationEnabled = false; + event.cancelBubble = true; +} +function isImmediatePropagationStopped(event) { + return event.isImmediatePropagationEnabled === false; +} +function stopPropagation(event) { + if (typeof event.stopPropagation === 'function') { + event.stopPropagation(); + } else { + event.cancelBubble = true; + } +} +function pageX(event) { + if (event.pageX) { + return event.pageX; + } + var scrollLeft = getWindowScrollLeft(); + var cursorX = event.clientX + scrollLeft; + return cursorX; +} +function pageY(event) { + if (event.pageY) { + return event.pageY; + } + var scrollTop = getWindowScrollTop(); + var cursorY = event.clientY + scrollTop; + return cursorY; +} + +//# +},{}],47:[function(require,module,exports){ +"use strict"; +Object.defineProperties(exports, { + proxy: {get: function() { + return proxy; + }}, + throttle: {get: function() { + return throttle; + }}, + throttleAfterHits: {get: function() { + return throttleAfterHits; + }}, + __esModule: {value: true} +}); +function proxy(fun, context) { + return function() { + return fun.apply(context, arguments); + }; +} +function throttle(func) { + var wait = arguments[1] !== (void 0) ? arguments[1] : 200; + var lastCalled = 0; + var result = {lastCallThrottled: true}; + var lastTimer = null; + function _throttle() { + var $__0 = this; + var args = arguments; + var stamp = Date.now(); + var needCall = false; + result.lastCallThrottled = true; + if (!lastCalled) { + lastCalled = stamp; + needCall = true; + } + var remaining = wait - (stamp - lastCalled); + if (needCall) { + result.lastCallThrottled = false; + func.apply(this, args); + } else { + if (lastTimer) { + clearTimeout(lastTimer); + } + lastTimer = setTimeout((function() { + result.lastCallThrottled = false; + func.apply($__0, args); + lastCalled = 0; + lastTimer = void 0; + }), remaining); + } + return result; + } + return _throttle; +} +function throttleAfterHits(func) { + var wait = arguments[1] !== (void 0) ? arguments[1] : 200; + var hits = arguments[2] !== (void 0) ? arguments[2] : 10; + var funcThrottle = throttle(func, wait); + var remainHits = hits; + function _clearHits() { + remainHits = hits; + } + function _throttleAfterHits() { + if (remainHits) { + remainHits--; + return func.apply(this, arguments); + } + return funcThrottle.apply(this, arguments); + } + _throttleAfterHits.clearHits = _clearHits; + return _throttleAfterHits; +} + +//# +},{}],48:[function(require,module,exports){ +"use strict"; +Object.defineProperties(exports, { + stringify: {get: function() { + return stringify; + }}, + __esModule: {value: true} +}); +function stringify(value) { + switch (typeof value) { + case 'string': + case 'number': + return value + ''; + case 'object': + if (value === null) { + return ''; + } else { + return value.toString(); + } + break; + case 'undefined': + return ''; + default: + return value.toString(); + } +} + +//# +},{}],49:[function(require,module,exports){ +"use strict"; +Object.defineProperties(exports, { + isNumeric: {get: function() { + return isNumeric; + }}, + rangeEach: {get: function() { + return rangeEach; + }}, + rangeEachReverse: {get: function() { + return rangeEachReverse; + }}, + valueAccordingPercent: {get: function() { + return valueAccordingPercent; + }}, + __esModule: {value: true} +}); +function isNumeric(n) { + var t = typeof n; + return t == 'number' ? !isNaN(n) && isFinite(n) : t == 'string' ? !n.length ? false : n.length == 1 ? /\d/.test(n) : /^\s*[+-]?\s*(?:(?:\d+(?:\.\d+)?(?:e[+-]?\d+)?)|(?:0x[a-f\d]+))\s*$/i.test(n) : t == 'object' ? !!n && typeof n.valueOf() == 'number' && !(n instanceof Date) : false; +} +function rangeEach(rangeFrom, rangeTo, iteratee) { + var index = -1; + if (typeof rangeTo === 'function') { + iteratee = rangeTo; + rangeTo = rangeFrom; + } else { + index = rangeFrom - 1; + } + while (++index <= rangeTo) { + if (iteratee(index) === false) { + break; + } + } +} +function rangeEachReverse(rangeFrom, rangeTo, iteratee) { + var index = rangeFrom + 1; + if (typeof rangeTo === 'function') { + iteratee = rangeTo; + rangeTo = 0; + } + while (--index >= rangeTo) { + if (iteratee(index) === false) { + break; + } + } +} +function valueAccordingPercent(value, percent) { + percent = parseInt(percent.toString().replace('%', ''), 10); + percent = parseInt(value * percent / 100); + return percent; +} + +//# +},{}],50:[function(require,module,exports){ +"use strict"; +Object.defineProperties(exports, { + duckSchema: {get: function() { + return duckSchema; + }}, + inherit: {get: function() { + return inherit; + }}, + extend: {get: function() { + return extend; + }}, + deepExtend: {get: function() { + return deepExtend; + }}, + deepClone: {get: function() { + return deepClone; + }}, + clone: {get: function() { + return clone; + }}, + mixin: {get: function() { + return mixin; + }}, + isObjectEquals: {get: function() { + return isObjectEquals; + }}, + isObject: {get: function() { + return isObject; + }}, + getPrototypeOf: {get: function() { + return getPrototypeOf; + }}, + defineGetter: {get: function() { + return defineGetter; + }}, + objectEach: {get: function() { + return objectEach; + }}, + getProperty: {get: function() { + return getProperty; + }}, + __esModule: {value: true} +}); +var $__array__; +var arrayEach = ($__array__ = require("array"), $__array__ && $__array__.__esModule && $__array__ || {default: $__array__}).arrayEach; +function duckSchema(object) { + var schema; + if (Array.isArray(object)) { + schema = []; + } else { + schema = {}; + objectEach(object, function(value, key) { + if (value && typeof value === 'object' && !Array.isArray(value)) { + schema[key] = duckSchema(value); + } else if (Array.isArray(value)) { + if (value.length && typeof value[0] === 'object' && !Array.isArray(value[0])) { + schema[key] = [duckSchema(value[0])]; + } else { + schema[key] = []; + } + } else { + schema[key] = null; + } + }); + } + return schema; +} +function inherit(Child, Parent) { + Parent.prototype.constructor = Parent; + Child.prototype = new Parent(); + Child.prototype.constructor = Child; + return Child; +} +function extend(target, extension) { + objectEach(extension, function(value, key) { + target[key] = value; + }); + return target; +} +function deepExtend(target, extension) { + objectEach(extension, function(value, key) { + if (extension[key] && typeof extension[key] === 'object') { + if (!target[key]) { + if (Array.isArray(extension[key])) { + target[key] = []; + } else { + target[key] = {}; + } + } + deepExtend(target[key], extension[key]); + } else { + target[key] = extension[key]; + } + }); +} +function deepClone(obj) { + if (typeof obj === 'object') { + return JSON.parse(JSON.stringify(obj)); + } + return obj; +} +function clone(object) { + var result = {}; + objectEach(object, (function(value, key) { + result[key] = value; + })); + return result; +} +function mixin(Base) { + for (var mixins = [], + $__1 = 1; $__1 < arguments.length; $__1++) + mixins[$__1 - 1] = arguments[$__1]; + if (!Base.MIXINS) { + Base.MIXINS = []; + } + arrayEach(mixins, (function(mixin) { + Base.MIXINS.push(mixin.MIXIN_NAME); + objectEach(mixin, (function(value, key) { + if (Base.prototype[key] !== void 0) { + throw new Error(("Mixin conflict. Property '" + key + "' already exist and cannot be overwritten.")); + } + if (typeof value === 'function') { + Base.prototype[key] = value; + } else { + var getter = function _getter(propertyName, initialValue) { + propertyName = '_' + propertyName; + var initValue = (function(value) { + if (Array.isArray(value) || isObject(value)) { + value = deepClone(value); + } + return value; + }); + return function() { + if (this[propertyName] === void 0) { + this[propertyName] = initValue(initialValue); + } + return this[propertyName]; + }; + }; + var setter = function _setter(propertyName) { + propertyName = '_' + propertyName; + return function(value) { + this[propertyName] = value; + }; + }; + Object.defineProperty(Base.prototype, key, { + get: getter(key, value), + set: setter(key), + configurable: true + }); + } + })); + })); + return Base; +} +function isObjectEquals(object1, object2) { + return JSON.stringify(object1) === JSON.stringify(object2); +} +function isObject(obj) { + return Object.prototype.toString.call(obj) == '[object Object]'; +} +function getPrototypeOf(obj) { + var prototype; + if (typeof obj.__proto__ == 'object') { + prototype = obj.__proto__; + } else { + var oldConstructor, + constructor = obj.constructor; + if (typeof obj.constructor == 'function') { + oldConstructor = constructor; + if (delete obj.constructor) { + constructor = obj.constructor; + obj.constructor = oldConstructor; + } + } + prototype = constructor ? constructor.prototype : null; + } + return prototype; +} +function defineGetter(object, property, value, options) { + options.value = value; + options.writable = options.writable !== false; + options.enumerable = options.enumerable !== false; + options.configurable = options.configurable !== false; + Object.defineProperty(object, property, options); +} +function objectEach(object, iteratee) { + for (var key in object) { + if (!object.hasOwnProperty || (object.hasOwnProperty && object.hasOwnProperty(key))) { + if (iteratee(object[key], key, object) === false) { + break; + } + } + } + return object; +} +function getProperty(object, name) { + var names = name.split('.'); + var result = object; + objectEach(names, (function(name) { + result = result[name]; + if (result === void 0) { + result = void 0; + return false; + } + })); + return result; +} + +//# +},{"array":42}],51:[function(require,module,exports){ +"use strict"; +Object.defineProperties(exports, { + columnFactory: {get: function() { + return columnFactory; + }}, + __esModule: {value: true} +}); +var $__object__; +var inherit = ($__object__ = require("object"), $__object__ && $__object__.__esModule && $__object__ || {default: $__object__}).inherit; +function columnFactory(GridSettings, conflictList) { + function ColumnSettings() {} + ; + inherit(ColumnSettings, GridSettings); + for (var i = 0, + len = conflictList.length; i < len; i++) { + ColumnSettings.prototype[conflictList[i]] = void 0; + } + return ColumnSettings; +} + +//# +},{"object":50}],52:[function(require,module,exports){ +"use strict"; +Object.defineProperties(exports, { + toUpperCaseFirst: {get: function() { + return toUpperCaseFirst; + }}, + startsWith: {get: function() { + return startsWith; + }}, + endsWith: {get: function() { + return endsWith; + }}, + equalsIgnoreCase: {get: function() { + return equalsIgnoreCase; + }}, + randomString: {get: function() { + return randomString; + }}, + isPercentValue: {get: function() { + return isPercentValue; + }}, + substitute: {get: function() { + return substitute; + }}, + padStart: {get: function() { + return padStart; + }}, + __esModule: {value: true} +}); +var $__mixed__, + $__number__; +var stringify = ($__mixed__ = require("mixed"), $__mixed__ && $__mixed__.__esModule && $__mixed__ || {default: $__mixed__}).stringify; +var rangeEach = ($__number__ = require("number"), $__number__ && $__number__.__esModule && $__number__ || {default: $__number__}).rangeEach; +function toUpperCaseFirst(string) { + return string[0].toUpperCase() + string.substr(1); +} +function startsWith(string, needle) { + var result = true; + rangeEach(needle.length - 1, (function(index) { + if (string.charAt(index) !== needle.charAt(index)) { + result = false; + return false; + } + })); + return result; +} +function endsWith(string, needle) { + var result = true; + var needleLength = needle.length - 1; + var stringLength = string.length - 1; + rangeEach(needleLength, (function(index) { + var stringIndex = stringLength - index; + var needleIndex = needleLength - index; + if (string.charAt(stringIndex) !== needle.charAt(needleIndex)) { + result = false; + return false; + } + })); + return result; +} +function equalsIgnoreCase() { + for (var strings = [], + $__2 = 0; $__2 < arguments.length; $__2++) + strings[$__2] = arguments[$__2]; + var unique = []; + var length = strings.length; + while (length--) { + var string = stringify(strings[length]).toLowerCase(); + if (unique.indexOf(string) === -1) { + unique.push(string); + } + } + return unique.length === 1; +} +function randomString() { + function s4() { + return Math.floor((1 + Math.random()) * 0x10000).toString(16).substring(1); + } + return s4() + s4() + s4() + s4(); +} +function isPercentValue(value) { + return /^([0-9][0-9]?\%$)|(^100\%$)/.test(value); +} +function substitute(template) { + var variables = arguments[1] !== (void 0) ? arguments[1] : {}; + return (template + '').replace(/(?:\\)?\[([^\[\]]+)]/g, function(match, name) { + if (match.charAt(0) === '\\') { + return match.substr(1, match.length - 1); + } + return variables[name] === void 0 ? '' : variables[name]; + }); +} +function padStart(string, maxLength) { + var fillString = arguments[2] !== (void 0) ? arguments[2] : ' '; + string = string + ''; + if (string.length >= maxLength) { + return string; + } + fillString = String(fillString); + var fillStringLength = fillString.length; + if (!fillStringLength) { + fillString = ' '; + } + var fillLen = maxLength - string.length; + var timesToRepeat = Math.ceil(fillLen / fillString.length); + var truncatedString = ''; + rangeEach(timesToRepeat, (function(index) { + truncatedString += fillString; + })); + truncatedString = truncatedString.slice(0, fillLen); + return truncatedString + string; +} +; + +//# +},{"mixed":48,"number":49}],53:[function(require,module,exports){ +"use strict"; +Object.defineProperties(exports, { + KEY_CODES: {get: function() { + return KEY_CODES; + }}, + isPrintableChar: {get: function() { + return isPrintableChar; + }}, + isMetaKey: {get: function() { + return isMetaKey; + }}, + isCtrlKey: {get: function() { + return isCtrlKey; + }}, + isKey: {get: function() { + return isKey; + }}, + __esModule: {value: true} +}); +var $__array__; +var arrayEach = ($__array__ = require("array"), $__array__ && $__array__.__esModule && $__array__ || {default: $__array__}).arrayEach; +var KEY_CODES = { + MOUSE_LEFT: 1, + MOUSE_RIGHT: 3, + MOUSE_MIDDLE: 2, + BACKSPACE: 8, + COMMA: 188, + INSERT: 45, + DELETE: 46, + END: 35, + ENTER: 13, + ESCAPE: 27, + CONTROL_LEFT: 91, + COMMAND_LEFT: 17, + COMMAND_RIGHT: 93, + ALT: 18, + HOME: 36, + PAGE_DOWN: 34, + PAGE_UP: 33, + PERIOD: 190, + SPACE: 32, + SHIFT: 16, + CAPS_LOCK: 20, + TAB: 9, + ARROW_RIGHT: 39, + ARROW_LEFT: 37, + ARROW_UP: 38, + ARROW_DOWN: 40, + F1: 112, + F2: 113, + F3: 114, + F4: 115, + F5: 116, + F6: 117, + F7: 118, + F8: 119, + F9: 120, + F10: 121, + F11: 122, + F12: 123, + A: 65, + X: 88, + C: 67, + V: 86 +}; +function isPrintableChar(keyCode) { + return ((keyCode == 32) || (keyCode >= 48 && keyCode <= 57) || (keyCode >= 96 && keyCode <= 111) || (keyCode >= 186 && keyCode <= 192) || (keyCode >= 219 && keyCode <= 222) || keyCode >= 226 || (keyCode >= 65 && keyCode <= 90)); +} +function isMetaKey(keyCode) { + var metaKeys = [KEY_CODES.ARROW_DOWN, KEY_CODES.ARROW_UP, KEY_CODES.ARROW_LEFT, KEY_CODES.ARROW_RIGHT, KEY_CODES.HOME, KEY_CODES.END, KEY_CODES.DELETE, KEY_CODES.BACKSPACE, KEY_CODES.F1, KEY_CODES.F2, KEY_CODES.F3, KEY_CODES.F4, KEY_CODES.F5, KEY_CODES.F6, KEY_CODES.F7, KEY_CODES.F8, KEY_CODES.F9, KEY_CODES.F10, KEY_CODES.F11, KEY_CODES.F12, KEY_CODES.TAB, KEY_CODES.PAGE_DOWN, KEY_CODES.PAGE_UP, KEY_CODES.ENTER, KEY_CODES.ESCAPE, KEY_CODES.SHIFT, KEY_CODES.CAPS_LOCK, KEY_CODES.ALT]; + return metaKeys.indexOf(keyCode) !== -1; +} +function isCtrlKey(keyCode) { + return [KEY_CODES.CONTROL_LEFT, 224, KEY_CODES.COMMAND_LEFT, KEY_CODES.COMMAND_RIGHT].indexOf(keyCode) !== -1; +} +function isKey(keyCode, baseCode) { + var keys = baseCode.split('|'); + var result = false; + arrayEach(keys, function(key) { + if (keyCode === KEY_CODES[key]) { + result = true; + return false; + } + }); + return result; +} + +//# +},{"array":42}],54:[function(require,module,exports){ +"use strict"; +Object.defineProperties(exports, { + localHooks: {get: function() { + return localHooks; + }}, + __esModule: {value: true} +}); +var $___46__46__47_helpers_47_array__, + $___46__46__47_helpers_47_object__; +var arrayEach = ($___46__46__47_helpers_47_array__ = require("helpers/array"), $___46__46__47_helpers_47_array__ && $___46__46__47_helpers_47_array__.__esModule && $___46__46__47_helpers_47_array__ || {default: $___46__46__47_helpers_47_array__}).arrayEach; +var defineGetter = ($___46__46__47_helpers_47_object__ = require("helpers/object"), $___46__46__47_helpers_47_object__ && $___46__46__47_helpers_47_object__.__esModule && $___46__46__47_helpers_47_object__ || {default: $___46__46__47_helpers_47_object__}).defineGetter; +var MIXIN_NAME = 'localHooks'; +var localHooks = { + _localHooks: Object.create(null), + addLocalHook: function(key, callback) { + if (!this._localHooks[key]) { + this._localHooks[key] = []; + } + this._localHooks[key].push(callback); + }, + runLocalHooks: function(key) { + for (var params = [], + $__3 = 1; $__3 < arguments.length; $__3++) + params[$__3 - 1] = arguments[$__3]; + var $__2 = this; + if (this._localHooks[key]) { + arrayEach(this._localHooks[key], (function(callback) { + return callback.apply($__2, params); + })); + } + }, + clearLocalHooks: function() { + this._localHooks = {}; + } +}; +defineGetter(localHooks, 'MIXIN_NAME', MIXIN_NAME, { + writable: false, + enumerable: false +}); +; +Handsontable.utils = Handsontable.utils || {}; +Handsontable.utils.localHooks = localHooks; + +//# +},{"helpers/array":42,"helpers/object":50}],55:[function(require,module,exports){ +"use strict"; +Object.defineProperties(exports, { + MultiMap: {get: function() { + return MultiMap; + }}, + __esModule: {value: true} +}); +; +window.MultiMap = MultiMap; +function MultiMap() { + var map = { + arrayMap: [], + weakMap: new WeakMap() + }; + return { + get: function(key) { + if (canBeAnArrayMapKey(key)) { + return map.arrayMap[key]; + } else if (canBeAWeakMapKey(key)) { + return map.weakMap.get(key); + } + }, + set: function(key, value) { + if (canBeAnArrayMapKey(key)) { + map.arrayMap[key] = value; + } else if (canBeAWeakMapKey(key)) { + map.weakMap.set(key, value); + } else { + throw new Error('Invalid key type'); + } + }, + delete: function(key) { + if (canBeAnArrayMapKey(key)) { + delete map.arrayMap[key]; + } else if (canBeAWeakMapKey(key)) { + map.weakMap.delete(key); + } + } + }; + function canBeAnArrayMapKey(obj) { + return obj !== null && !isNaNSymbol(obj) && (typeof obj == 'string' || typeof obj == 'number'); + } + function canBeAWeakMapKey(obj) { + return obj !== null && (typeof obj == 'object' || typeof obj == 'function'); + } + function isNaNSymbol(obj) { + return obj !== obj; + } +} + +//# +},{}],56:[function(require,module,exports){ +"use strict"; +Object.defineProperties(exports, { + Hooks: {get: function() { + return Hooks; + }}, + __esModule: {value: true} +}); +var $__helpers_47_array__, + $__helpers_47_object__; +var REGISTERED_HOOKS = ['afterCellMetaReset', 'afterChange', 'afterChangesObserved', 'afterContextMenuDefaultOptions', 'afterContextMenuHide', 'afterContextMenuShow', 'afterCopyLimit', 'afterCreateCol', 'afterCreateRow', 'afterDeselect', 'afterDestroy', 'afterDocumentKeyDown', 'afterGetCellMeta', 'afterGetColHeader', 'afterGetRowHeader', 'afterInit', 'afterLoadData', 'afterMomentumScroll', 'afterOnCellCornerMouseDown', 'afterOnCellMouseDown', 'afterOnCellMouseOver', 'afterRemoveCol', 'afterRemoveRow', 'afterRender', 'afterRenderer', 'afterScrollHorizontally', 'afterScrollVertically', 'afterSelection', 'afterSelectionByProp', 'afterSelectionEnd', 'afterSelectionEndByProp', 'afterSetCellMeta', 'afterUpdateSettings', 'afterValidate', 'beforeAutofill', 'beforeCellAlignment', 'beforeChange', 'beforeChangeRender', 'beforeDrawBorders', 'beforeGetCellMeta', 'beforeInit', 'beforeInitWalkontable', 'beforeKeyDown', 'beforeOnCellMouseDown', 'beforeRemoveCol', 'beforeRemoveRow', 'beforeRender', 'beforeSetRangeEnd', 'beforeTouchScroll', 'beforeValidate', 'construct', 'init', 'modifyCol', 'modifyColHeader', 'modifyColWidth', 'modifyRow', 'modifyRowHeader', 'modifyRowHeight', 'persistentStateLoad', 'persistentStateReset', 'persistentStateSave', 'beforeColumnSort', 'afterColumnSort', 'afterAutofillApplyValues', 'modifyCopyableRange', 'beforeColumnMove', 'afterColumnMove', 'beforeRowMove', 'afterRowMove', 'beforeColumnResize', 'afterColumnResize', 'beforeRowResize', 'afterRowResize']; +var arrayEach = ($__helpers_47_array__ = require("helpers/array"), $__helpers_47_array__ && $__helpers_47_array__.__esModule && $__helpers_47_array__ || {default: $__helpers_47_array__}).arrayEach; +var objectEach = ($__helpers_47_object__ = require("helpers/object"), $__helpers_47_object__ && $__helpers_47_object__.__esModule && $__helpers_47_object__ || {default: $__helpers_47_object__}).objectEach; +var Hooks = function Hooks() { + this.globalBucket = this.createEmptyBucket(); +}; +($traceurRuntime.createClass)(Hooks, { + createEmptyBucket: function() { + var bucket = Object.create(null); + arrayEach(REGISTERED_HOOKS, (function(hook) { + return (bucket[hook] = []); + })); + return bucket; + }, + getBucket: function() { + var context = arguments[0] !== (void 0) ? arguments[0] : null; + if (context) { + if (!context.pluginHookBucket) { + context.pluginHookBucket = this.createEmptyBucket(); + } + return context.pluginHookBucket; + } + return this.globalBucket; + }, + add: function(key, callback) { + var context = arguments[2] !== (void 0) ? arguments[2] : null; + var $__2 = this; + if (Array.isArray(callback)) { + arrayEach(callback, (function(c) { + return ($__2.add(key, c, context)); + })); + } else { + var bucket = this.getBucket(context); + if (typeof bucket[key] === 'undefined') { + this.register(key); + bucket[key] = []; + } + callback.skip = false; + if (bucket[key].indexOf(callback) === -1) { + bucket[key].push(callback); + } + } + return this; + }, + once: function(key, callback) { + var context = arguments[2] !== (void 0) ? arguments[2] : null; + var $__2 = this; + if (Array.isArray(callback)) { + arrayEach(callback, (function(c) { + return ($__2.once(key, c, context)); + })); + } else { + callback.runOnce = true; + this.add(key, callback, context); + } + }, + remove: function(key, callback) { + var context = arguments[2] !== (void 0) ? arguments[2] : null; + var bucket = this.getBucket(context); + if (typeof bucket[key] !== 'undefined') { + if (bucket[key].indexOf(callback) >= 0) { + callback.skip = true; + return true; + } + } + return false; + }, + has: function(key) { + var context = arguments[1] !== (void 0) ? arguments[1] : null; + var bucket = this.getBucket(context); + return bucket[key] !== void 0 && bucket[key].length ? true : false; + }, + run: function(context, key, p1, p2, p3, p4, p5, p6) { + { + var globalHandlers = this.globalBucket[key]; + var index = -1; + var length = globalHandlers ? globalHandlers.length : 0; + if (length) { + while (++index < length) { + if (!globalHandlers[index] || globalHandlers[index].skip) { + continue; + } + var res = globalHandlers[index].call(context, p1, p2, p3, p4, p5, p6); + if (res !== void 0) { + p1 = res; + } + if (globalHandlers[index] && globalHandlers[index].runOnce) { + this.remove(key, globalHandlers[index]); + } + } + } + } + { + var localHandlers = this.getBucket(context)[key]; + var index$__4 = -1; + var length$__5 = localHandlers ? localHandlers.length : 0; + if (length$__5) { + while (++index$__4 < length$__5) { + if (!localHandlers[index$__4] || localHandlers[index$__4].skip) { + continue; + } + var res$__6 = localHandlers[index$__4].call(context, p1, p2, p3, p4, p5, p6); + if (res$__6 !== void 0) { + p1 = res$__6; + } + if (localHandlers[index$__4] && localHandlers[index$__4].runOnce) { + this.remove(key, localHandlers[index$__4], context); + } + } + } + } + return p1; + }, + destroy: function() { + var context = arguments[0] !== (void 0) ? arguments[0] : null; + objectEach(this.getBucket(context), (function(value, key, bucket) { + return (bucket[key].length = 0); + })); + }, + register: function(key) { + if (!this.isRegistered(key)) { + REGISTERED_HOOKS.push(key); + } + }, + deregister: function(key) { + if (this.isRegistered(key)) { + REGISTERED_HOOKS.splice(REGISTERED_HOOKS.indexOf(key), 1); + } + }, + isRegistered: function(key) { + return REGISTERED_HOOKS.indexOf(key) >= 0; + }, + getRegistered: function() { + return REGISTERED_HOOKS; + } +}, {}); +; +Handsontable.utils = Handsontable.utils || {}; +Handsontable.utils.Hooks = Hooks; + +//# +},{"helpers/array":42,"helpers/object":50}],57:[function(require,module,exports){ +"use strict"; +Object.defineProperties(exports, { + registerPlugin: {get: function() { + return registerPlugin; + }}, + getPlugin: {get: function() { + return getPlugin; + }}, + getRegistredPluginNames: {get: function() { + return getRegistredPluginNames; + }}, + getPluginName: {get: function() { + return getPluginName; + }}, + __esModule: {value: true} +}); +var $__helpers_47_object__, + $__helpers_47_string__; +var objectEach = ($__helpers_47_object__ = require("helpers/object"), $__helpers_47_object__ && $__helpers_47_object__.__esModule && $__helpers_47_object__ || {default: $__helpers_47_object__}).objectEach; +var toUpperCaseFirst = ($__helpers_47_string__ = require("helpers/string"), $__helpers_47_string__ && $__helpers_47_string__.__esModule && $__helpers_47_string__ || {default: $__helpers_47_string__}).toUpperCaseFirst; +var registeredPlugins = new WeakMap(); +Handsontable.plugins = Handsontable.plugins || {}; +function registerPlugin(pluginName, PluginClass) { + pluginName = toUpperCaseFirst(pluginName); + Handsontable.plugins[pluginName] = PluginClass; + Handsontable.hooks.add('construct', function() { + var holder; + if (!registeredPlugins.has(this)) { + registeredPlugins.set(this, {}); + } + holder = registeredPlugins.get(this); + if (!holder[pluginName]) { + holder[pluginName] = new PluginClass(this); + } + }); + Handsontable.hooks.add('afterDestroy', function() { + if (registeredPlugins.has(this)) { + var pluginsHolder = registeredPlugins.get(this); + objectEach(pluginsHolder, (function(plugin) { + return plugin.destroy(); + })); + registeredPlugins.delete(this); + } + }); +} +function getPlugin(instance, pluginName) { + if (typeof pluginName != 'string') { + throw Error('Only strings can be passed as "plugin" parameter'); + } + var _pluginName = toUpperCaseFirst(pluginName); + if (!registeredPlugins.has(instance) || !registeredPlugins.get(instance)[_pluginName]) { + return void 0; + } + return registeredPlugins.get(instance)[_pluginName]; +} +function getRegistredPluginNames(hotInstance) { + return registeredPlugins.has(hotInstance) ? Object.keys(registeredPlugins.get(hotInstance)) : []; +} +function getPluginName(hotInstance, plugin) { + var pluginName = null; + if (registeredPlugins.has(hotInstance)) { + objectEach(registeredPlugins.get(hotInstance), (function(pluginInstance, name) { + if (pluginInstance === plugin) { + pluginName = name; + } + })); + } + return pluginName; +} +; +Handsontable.plugins.utils = Handsontable.plugins.utils || {}; +Handsontable.plugins.registerPlugin = registerPlugin; + +//# +},{"helpers/object":50,"helpers/string":52}],58:[function(require,module,exports){ +"use strict"; +Object.defineProperties(exports, { + default: {get: function() { + return $__default; + }}, + __esModule: {value: true} +}); +var $___46__46__47_helpers_47_object__, + $___46__46__47_helpers_47_array__, + $___46__46__47_plugins__; +var $__0 = ($___46__46__47_helpers_47_object__ = require("helpers/object"), $___46__46__47_helpers_47_object__ && $___46__46__47_helpers_47_object__.__esModule && $___46__46__47_helpers_47_object__ || {default: $___46__46__47_helpers_47_object__}), + defineGetter = $__0.defineGetter, + objectEach = $__0.objectEach; +var arrayEach = ($___46__46__47_helpers_47_array__ = require("helpers/array"), $___46__46__47_helpers_47_array__ && $___46__46__47_helpers_47_array__.__esModule && $___46__46__47_helpers_47_array__ || {default: $___46__46__47_helpers_47_array__}).arrayEach; +var $__2 = ($___46__46__47_plugins__ = require("plugins"), $___46__46__47_plugins__ && $___46__46__47_plugins__.__esModule && $___46__46__47_plugins__ || {default: $___46__46__47_plugins__}), + getRegistredPluginNames = $__2.getRegistredPluginNames, + getPluginName = $__2.getPluginName; +var privatePool = new WeakMap(); +var initializedPlugins = null; +var BasePlugin = function BasePlugin(hotInstance) { + var $__3 = this; + defineGetter(this, 'hot', hotInstance, {writable: false}); + privatePool.set(this, {hooks: {}}); + initializedPlugins = null; + this.pluginName = null; + this.pluginsInitializedCallbacks = []; + this.isPluginsReady = false; + this.enabled = false; + this.initialized = false; + this.hot.addHook('afterPluginsInitialized', (function() { + return $__3.onAfterPluginsInitialized(); + })); + this.hot.addHook('afterUpdateSettings', (function() { + return $__3.onUpdateSettings(); + })); + this.hot.addHook('beforeInit', (function() { + return $__3.init(); + })); +}; +($traceurRuntime.createClass)(BasePlugin, { + init: function() { + this.pluginName = getPluginName(this.hot, this); + if (this.isEnabled && this.isEnabled()) { + this.enablePlugin(); + } + if (!initializedPlugins) { + initializedPlugins = getRegistredPluginNames(this.hot); + } + if (initializedPlugins.indexOf(this.pluginName) >= 0) { + initializedPlugins.splice(initializedPlugins.indexOf(this.pluginName), 1); + } + if (!initializedPlugins.length) { + this.hot.runHooks('afterPluginsInitialized'); + } + this.initialized = true; + }, + enablePlugin: function() { + this.enabled = true; + }, + disablePlugin: function() { + if (this.eventManager) { + this.eventManager.clear(); + } + this.clearHooks(); + this.enabled = false; + }, + addHook: function(name, callback) { + var hooks = privatePool.get(this).hooks[name] = (privatePool.get(this).hooks[name] || []); + this.hot.addHook(name, callback); + hooks.push(callback); + privatePool.get(this).hooks[name] = hooks; + }, + removeHooks: function(name) { + var $__3 = this; + arrayEach(privatePool.get(this).hooks[name] || [], (function(callback) { + $__3.hot.removeHook(name, callback); + })); + }, + clearHooks: function() { + var $__3 = this; + var hooks = privatePool.get(this).hooks; + objectEach(hooks, (function(callbacks, name) { + return $__3.removeHooks(name); + })); + hooks.length = 0; + }, + callOnPluginsReady: function(callback) { + if (this.isPluginsReady) { + callback(); + } else { + this.pluginsInitializedCallbacks.push(callback); + } + }, + onAfterPluginsInitialized: function() { + arrayEach(this.pluginsInitializedCallbacks, (function(callback) { + return callback(); + })); + this.pluginsInitializedCallbacks.length = 0; + this.isPluginsReady = true; + }, + onUpdateSettings: function() { + if (this.isEnabled) { + if (this.enabled && !this.isEnabled()) { + this.disablePlugin(); + } + if (!this.enabled && this.isEnabled()) { + this.enablePlugin(); + } + if (this.enabled && this.isEnabled()) { + this.updatePlugin(); + } + } + }, + updatePlugin: function() {}, + destroy: function() { + var $__3 = this; + if (this.eventManager) { + this.eventManager.destroy(); + } + this.clearHooks(); + objectEach(this, (function(value, property) { + if (property !== 'hot') { + $__3[property] = null; + } + })); + delete this.hot; + } +}, {}); +var $__default = BasePlugin; +Handsontable.plugins.BasePlugin = BasePlugin; + +//# +},{"helpers/array":42,"helpers/object":50,"plugins":57}],59:[function(require,module,exports){ +"use strict"; +Object.defineProperties(exports, { + AutoColumnSize: {get: function() { + return AutoColumnSize; + }}, + __esModule: {value: true} +}); +var $___46__46__47__95_base__, + $___46__46__47__46__46__47_helpers_47_array__, + $___46__46__47__46__46__47_helpers_47_dom_47_element__, + $___46__46__47__46__46__47_utils_47_ghostTable__, + $___46__46__47__46__46__47_helpers_47_object__, + $___46__46__47__46__46__47_helpers_47_number__, + $___46__46__47__46__46__47_plugins__, + $___46__46__47__46__46__47_utils_47_samplesGenerator__, + $___46__46__47__46__46__47_helpers_47_string__, + $___46__46__47__46__46__47_3rdparty_47_walkontable_47_src_47_calculator_47_viewportColumns__; +var BasePlugin = ($___46__46__47__95_base__ = require("_base"), $___46__46__47__95_base__ && $___46__46__47__95_base__.__esModule && $___46__46__47__95_base__ || {default: $___46__46__47__95_base__}).default; +var $__1 = ($___46__46__47__46__46__47_helpers_47_array__ = require("helpers/array"), $___46__46__47__46__46__47_helpers_47_array__ && $___46__46__47__46__46__47_helpers_47_array__.__esModule && $___46__46__47__46__46__47_helpers_47_array__ || {default: $___46__46__47__46__46__47_helpers_47_array__}), + arrayEach = $__1.arrayEach, + arrayFilter = $__1.arrayFilter; +var $__2 = ($___46__46__47__46__46__47_helpers_47_dom_47_element__ = require("helpers/dom/element"), $___46__46__47__46__46__47_helpers_47_dom_47_element__ && $___46__46__47__46__46__47_helpers_47_dom_47_element__.__esModule && $___46__46__47__46__46__47_helpers_47_dom_47_element__ || {default: $___46__46__47__46__46__47_helpers_47_dom_47_element__}), + cancelAnimationFrame = $__2.cancelAnimationFrame, + requestAnimationFrame = $__2.requestAnimationFrame, + isVisible = $__2.isVisible; +var GhostTable = ($___46__46__47__46__46__47_utils_47_ghostTable__ = require("utils/ghostTable"), $___46__46__47__46__46__47_utils_47_ghostTable__ && $___46__46__47__46__46__47_utils_47_ghostTable__.__esModule && $___46__46__47__46__46__47_utils_47_ghostTable__ || {default: $___46__46__47__46__46__47_utils_47_ghostTable__}).GhostTable; +var $__4 = ($___46__46__47__46__46__47_helpers_47_object__ = require("helpers/object"), $___46__46__47__46__46__47_helpers_47_object__ && $___46__46__47__46__46__47_helpers_47_object__.__esModule && $___46__46__47__46__46__47_helpers_47_object__ || {default: $___46__46__47__46__46__47_helpers_47_object__}), + isObject = $__4.isObject, + objectEach = $__4.objectEach; +var $__5 = ($___46__46__47__46__46__47_helpers_47_number__ = require("helpers/number"), $___46__46__47__46__46__47_helpers_47_number__ && $___46__46__47__46__46__47_helpers_47_number__.__esModule && $___46__46__47__46__46__47_helpers_47_number__ || {default: $___46__46__47__46__46__47_helpers_47_number__}), + valueAccordingPercent = $__5.valueAccordingPercent, + rangeEach = $__5.rangeEach; +var registerPlugin = ($___46__46__47__46__46__47_plugins__ = require("plugins"), $___46__46__47__46__46__47_plugins__ && $___46__46__47__46__46__47_plugins__.__esModule && $___46__46__47__46__46__47_plugins__ || {default: $___46__46__47__46__46__47_plugins__}).registerPlugin; +var SamplesGenerator = ($___46__46__47__46__46__47_utils_47_samplesGenerator__ = require("utils/samplesGenerator"), $___46__46__47__46__46__47_utils_47_samplesGenerator__ && $___46__46__47__46__46__47_utils_47_samplesGenerator__.__esModule && $___46__46__47__46__46__47_utils_47_samplesGenerator__ || {default: $___46__46__47__46__46__47_utils_47_samplesGenerator__}).SamplesGenerator; +var isPercentValue = ($___46__46__47__46__46__47_helpers_47_string__ = require("helpers/string"), $___46__46__47__46__46__47_helpers_47_string__ && $___46__46__47__46__46__47_helpers_47_string__.__esModule && $___46__46__47__46__46__47_helpers_47_string__ || {default: $___46__46__47__46__46__47_helpers_47_string__}).isPercentValue; +var WalkontableViewportColumnsCalculator = ($___46__46__47__46__46__47_3rdparty_47_walkontable_47_src_47_calculator_47_viewportColumns__ = require("3rdparty/walkontable/src/calculator/viewportColumns"), $___46__46__47__46__46__47_3rdparty_47_walkontable_47_src_47_calculator_47_viewportColumns__ && $___46__46__47__46__46__47_3rdparty_47_walkontable_47_src_47_calculator_47_viewportColumns__.__esModule && $___46__46__47__46__46__47_3rdparty_47_walkontable_47_src_47_calculator_47_viewportColumns__ || {default: $___46__46__47__46__46__47_3rdparty_47_walkontable_47_src_47_calculator_47_viewportColumns__}).WalkontableViewportColumnsCalculator; +var AutoColumnSize = function AutoColumnSize(hotInstance) { + var $__10 = this; + $traceurRuntime.superConstructor($AutoColumnSize).call(this, hotInstance); + this.widths = []; + this.ghostTable = new GhostTable(this.hot); + this.samplesGenerator = new SamplesGenerator((function(row, col) { + return $__10.hot.getDataAtCell(row, col); + })); + this.firstCalculation = true; + this.inProgress = false; + this.addHook('beforeColumnResize', (function(col, size, isDblClick) { + return $__10.onBeforeColumnResize(col, size, isDblClick); + })); +}; +var $AutoColumnSize = AutoColumnSize; +($traceurRuntime.createClass)(AutoColumnSize, { + isEnabled: function() { + return this.hot.getSettings().autoColumnSize !== false && !this.hot.getSettings().colWidths; + }, + enablePlugin: function() { + var $__10 = this; + if (this.enabled) { + return; + } + this.addHook('afterLoadData', (function() { + return $__10.onAfterLoadData(); + })); + this.addHook('beforeChange', (function(changes) { + return $__10.onBeforeChange(changes); + })); + this.addHook('beforeRender', (function(force) { + return $__10.onBeforeRender(force); + })); + this.addHook('modifyColWidth', (function(width, col) { + return $__10.getColumnWidth(col, width); + })); + $traceurRuntime.superGet(this, $AutoColumnSize.prototype, "enablePlugin").call(this); + }, + disablePlugin: function() { + $traceurRuntime.superGet(this, $AutoColumnSize.prototype, "disablePlugin").call(this); + }, + calculateColumnsWidth: function() { + var colRange = arguments[0] !== (void 0) ? arguments[0] : { + from: 0, + to: this.hot.countCols() - 1 + }; + var rowRange = arguments[1] !== (void 0) ? arguments[1] : { + from: 0, + to: this.hot.countRows() - 1 + }; + var force = arguments[2] !== (void 0) ? arguments[2] : false; + var $__10 = this; + if (typeof colRange === 'number') { + colRange = { + from: colRange, + to: colRange + }; + } + if (typeof rowRange === 'number') { + rowRange = { + from: rowRange, + to: rowRange + }; + } + rangeEach(colRange.from, colRange.to, (function(col) { + if (force || ($__10.widths[col] === void 0 && !$__10.hot._getColWidthFromSettings(col))) { + var samples = $__10.samplesGenerator.generateColumnSamples(col, rowRange); + samples.forEach((function(sample, col) { + return $__10.ghostTable.addColumn(col, sample); + })); + } + })); + if (this.ghostTable.columns.length) { + this.ghostTable.getWidths((function(col, width) { + return $__10.widths[col] = width; + })); + this.ghostTable.clean(); + } + }, + calculateAllColumnsWidth: function() { + var rowRange = arguments[0] !== (void 0) ? arguments[0] : { + from: 0, + to: this.hot.countRows() - 1 + }; + var $__10 = this; + var current = 0; + var length = this.hot.countCols() - 1; + var timer = null; + this.inProgress = true; + var loop = (function() { + if (!$__10.hot) { + cancelAnimationFrame(timer); + $__10.inProgress = false; + return; + } + $__10.calculateColumnsWidth({ + from: current, + to: Math.min(current + $AutoColumnSize.CALCULATION_STEP, length) + }, rowRange); + current = current + $AutoColumnSize.CALCULATION_STEP + 1; + if (current < length) { + timer = requestAnimationFrame(loop); + } else { + cancelAnimationFrame(timer); + $__10.inProgress = false; + $__10.hot.view.wt.wtOverlays.adjustElementsSize(true); + if ($__10.hot.view.wt.wtOverlays.leftOverlay.needFullRender) { + $__10.hot.view.wt.wtOverlays.leftOverlay.clone.draw(); + } + } + }); + if (this.firstCalculation && this.getSyncCalculationLimit()) { + this.calculateColumnsWidth({ + from: 0, + to: this.getSyncCalculationLimit() + }, rowRange); + this.firstCalculation = false; + current = this.getSyncCalculationLimit() + 1; + } + if (current < length) { + loop(); + } else { + this.inProgress = false; + } + }, + recalculateAllColumnsWidth: function() { + if (this.hot.view && isVisible(this.hot.view.wt.wtTable.TABLE)) { + this.clearCache(); + this.calculateAllColumnsWidth(); + } + }, + getSyncCalculationLimit: function() { + var limit = $AutoColumnSize.SYNC_CALCULATION_LIMIT; + var colsLimit = this.hot.countCols() - 1; + if (isObject(this.hot.getSettings().autoColumnSize)) { + limit = this.hot.getSettings().autoColumnSize.syncLimit; + if (isPercentValue(limit)) { + limit = valueAccordingPercent(colsLimit, limit); + } else { + limit = limit >> 0; + } + } + return Math.min(limit, colsLimit); + }, + getColumnWidth: function(col) { + var defaultWidth = arguments[1]; + var keepMinimum = arguments[2] !== (void 0) ? arguments[2] : true; + var width = defaultWidth; + if (width === void 0) { + width = this.widths[col]; + if (keepMinimum && typeof width === 'number') { + width = Math.max(width, WalkontableViewportColumnsCalculator.DEFAULT_WIDTH); + } + } + return width; + }, + getFirstVisibleColumn: function() { + var wot = this.hot.view.wt; + if (wot.wtViewport.columnsVisibleCalculator) { + return wot.wtTable.getFirstVisibleColumn(); + } + if (wot.wtViewport.columnsRenderCalculator) { + return wot.wtTable.getFirstRenderedColumn(); + } + return -1; + }, + getLastVisibleColumn: function() { + var wot = this.hot.view.wt; + if (wot.wtViewport.columnsVisibleCalculator) { + return wot.wtTable.getLastVisibleColumn(); + } + if (wot.wtViewport.columnsRenderCalculator) { + return wot.wtTable.getLastRenderedColumn(); + } + return -1; + }, + clearCache: function() { + this.widths.length = 0; + }, + isNeedRecalculate: function() { + return arrayFilter(this.widths, (function(item) { + return (item === void 0); + })).length ? true : false; + }, + onBeforeRender: function() { + var force = this.hot.renderCall; + this.calculateColumnsWidth({ + from: this.getFirstVisibleColumn(), + to: this.getLastVisibleColumn() + }, void 0, force); + if (this.isNeedRecalculate() && !this.inProgress) { + this.calculateAllColumnsWidth(); + } + }, + onAfterLoadData: function() { + var $__10 = this; + if (this.hot.view) { + this.recalculateAllColumnsWidth(); + } else { + setTimeout((function() { + if ($__10.hot) { + $__10.recalculateAllColumnsWidth(); + } + }), 0); + } + }, + onBeforeChange: function(changes) { + var $__10 = this; + arrayEach(changes, (function(data) { + return $__10.widths[data[1]] = void 0; + })); + }, + onBeforeColumnResize: function(col, size, isDblClick) { + if (isDblClick) { + this.calculateColumnsWidth(col, void 0, true); + size = this.getColumnWidth(col, void 0, false); + } + return size; + }, + destroy: function() { + this.ghostTable.clean(); + $traceurRuntime.superGet(this, $AutoColumnSize.prototype, "destroy").call(this); + } +}, { + get CALCULATION_STEP() { + return 50; + }, + get SYNC_CALCULATION_LIMIT() { + return 50; + } +}, BasePlugin); +; +registerPlugin('autoColumnSize', AutoColumnSize); + +//# +},{"3rdparty/walkontable/src/calculator/viewportColumns":3,"_base":58,"helpers/array":42,"helpers/dom/element":45,"helpers/number":49,"helpers/object":50,"helpers/string":52,"plugins":57,"utils/ghostTable":98,"utils/samplesGenerator":99}],60:[function(require,module,exports){ +"use strict"; +Object.defineProperties(exports, { + AutoRowSize: {get: function() { + return AutoRowSize; + }}, + __esModule: {value: true} +}); +var $___46__46__47__95_base__, + $___46__46__47__46__46__47_helpers_47_array__, + $___46__46__47__46__46__47_helpers_47_dom_47_element__, + $___46__46__47__46__46__47_utils_47_ghostTable__, + $___46__46__47__46__46__47_helpers_47_object__, + $___46__46__47__46__46__47_helpers_47_number__, + $___46__46__47__46__46__47_plugins__, + $___46__46__47__46__46__47_utils_47_samplesGenerator__, + $___46__46__47__46__46__47_helpers_47_string__; +var BasePlugin = ($___46__46__47__95_base__ = require("_base"), $___46__46__47__95_base__ && $___46__46__47__95_base__.__esModule && $___46__46__47__95_base__ || {default: $___46__46__47__95_base__}).default; +var $__1 = ($___46__46__47__46__46__47_helpers_47_array__ = require("helpers/array"), $___46__46__47__46__46__47_helpers_47_array__ && $___46__46__47__46__46__47_helpers_47_array__.__esModule && $___46__46__47__46__46__47_helpers_47_array__ || {default: $___46__46__47__46__46__47_helpers_47_array__}), + arrayEach = $__1.arrayEach, + arrayFilter = $__1.arrayFilter; +var $__2 = ($___46__46__47__46__46__47_helpers_47_dom_47_element__ = require("helpers/dom/element"), $___46__46__47__46__46__47_helpers_47_dom_47_element__ && $___46__46__47__46__46__47_helpers_47_dom_47_element__.__esModule && $___46__46__47__46__46__47_helpers_47_dom_47_element__ || {default: $___46__46__47__46__46__47_helpers_47_dom_47_element__}), + cancelAnimationFrame = $__2.cancelAnimationFrame, + requestAnimationFrame = $__2.requestAnimationFrame, + isVisible = $__2.isVisible; +var GhostTable = ($___46__46__47__46__46__47_utils_47_ghostTable__ = require("utils/ghostTable"), $___46__46__47__46__46__47_utils_47_ghostTable__ && $___46__46__47__46__46__47_utils_47_ghostTable__.__esModule && $___46__46__47__46__46__47_utils_47_ghostTable__ || {default: $___46__46__47__46__46__47_utils_47_ghostTable__}).GhostTable; +var $__4 = ($___46__46__47__46__46__47_helpers_47_object__ = require("helpers/object"), $___46__46__47__46__46__47_helpers_47_object__ && $___46__46__47__46__46__47_helpers_47_object__.__esModule && $___46__46__47__46__46__47_helpers_47_object__ || {default: $___46__46__47__46__46__47_helpers_47_object__}), + isObject = $__4.isObject, + objectEach = $__4.objectEach; +var $__5 = ($___46__46__47__46__46__47_helpers_47_number__ = require("helpers/number"), $___46__46__47__46__46__47_helpers_47_number__ && $___46__46__47__46__46__47_helpers_47_number__.__esModule && $___46__46__47__46__46__47_helpers_47_number__ || {default: $___46__46__47__46__46__47_helpers_47_number__}), + valueAccordingPercent = $__5.valueAccordingPercent, + rangeEach = $__5.rangeEach; +var registerPlugin = ($___46__46__47__46__46__47_plugins__ = require("plugins"), $___46__46__47__46__46__47_plugins__ && $___46__46__47__46__46__47_plugins__.__esModule && $___46__46__47__46__46__47_plugins__ || {default: $___46__46__47__46__46__47_plugins__}).registerPlugin; +var SamplesGenerator = ($___46__46__47__46__46__47_utils_47_samplesGenerator__ = require("utils/samplesGenerator"), $___46__46__47__46__46__47_utils_47_samplesGenerator__ && $___46__46__47__46__46__47_utils_47_samplesGenerator__.__esModule && $___46__46__47__46__46__47_utils_47_samplesGenerator__ || {default: $___46__46__47__46__46__47_utils_47_samplesGenerator__}).SamplesGenerator; +var isPercentValue = ($___46__46__47__46__46__47_helpers_47_string__ = require("helpers/string"), $___46__46__47__46__46__47_helpers_47_string__ && $___46__46__47__46__46__47_helpers_47_string__.__esModule && $___46__46__47__46__46__47_helpers_47_string__ || {default: $___46__46__47__46__46__47_helpers_47_string__}).isPercentValue; +var AutoRowSize = function AutoRowSize(hotInstance) { + var $__9 = this; + $traceurRuntime.superConstructor($AutoRowSize).call(this, hotInstance); + this.heights = []; + this.ghostTable = new GhostTable(this.hot); + this.samplesGenerator = new SamplesGenerator((function(row, col) { + return $__9.hot.getDataAtCell(row, col); + })); + this.firstCalculation = true; + this.inProgress = false; + this.addHook('beforeRowResize', (function(row, size, isDblClick) { + return $__9.onBeforeRowResize(row, size, isDblClick); + })); +}; +var $AutoRowSize = AutoRowSize; +($traceurRuntime.createClass)(AutoRowSize, { + isEnabled: function() { + return this.hot.getSettings().autoRowSize === true || isObject(this.hot.getSettings().autoRowSize); + }, + enablePlugin: function() { + var $__9 = this; + if (this.enabled) { + return; + } + this.addHook('afterLoadData', (function() { + return $__9.onAfterLoadData(); + })); + this.addHook('beforeChange', (function(changes) { + return $__9.onBeforeChange(changes); + })); + this.addHook('beforeColumnMove', (function() { + return $__9.recalculateAllRowsHeight(); + })); + this.addHook('beforeColumnResize', (function() { + return $__9.recalculateAllRowsHeight(); + })); + this.addHook('beforeColumnSort', (function() { + return $__9.clearCache(); + })); + this.addHook('beforeRender', (function(force) { + return $__9.onBeforeRender(force); + })); + this.addHook('beforeRowMove', (function(rowStart, rowEnd) { + return $__9.onBeforeRowMove(rowStart, rowEnd); + })); + this.addHook('modifyRowHeight', (function(height, row) { + return $__9.getRowHeight(row, height); + })); + $traceurRuntime.superGet(this, $AutoRowSize.prototype, "enablePlugin").call(this); + }, + disablePlugin: function() { + $traceurRuntime.superGet(this, $AutoRowSize.prototype, "disablePlugin").call(this); + }, + calculateRowsHeight: function() { + var rowRange = arguments[0] !== (void 0) ? arguments[0] : { + from: 0, + to: this.hot.countRows() - 1 + }; + var colRange = arguments[1] !== (void 0) ? arguments[1] : { + from: 0, + to: this.hot.countCols() - 1 + }; + var force = arguments[2] !== (void 0) ? arguments[2] : false; + var $__9 = this; + if (typeof rowRange === 'number') { + rowRange = { + from: rowRange, + to: rowRange + }; + } + if (typeof colRange === 'number') { + colRange = { + from: colRange, + to: colRange + }; + } + rangeEach(rowRange.from, rowRange.to, (function(row) { + if (force || $__9.heights[row] === void 0) { + var samples = $__9.samplesGenerator.generateRowSamples(row, colRange); + samples.forEach((function(sample, row) { + return $__9.ghostTable.addRow(row, sample); + })); + } + })); + if (this.ghostTable.rows.length) { + this.ghostTable.getHeights((function(row, height) { + return $__9.heights[row] = height; + })); + this.ghostTable.clean(); + } + }, + calculateAllRowsHeight: function() { + var colRange = arguments[0] !== (void 0) ? arguments[0] : { + from: 0, + to: this.hot.countCols() - 1 + }; + var $__9 = this; + var current = 0; + var length = this.hot.countRows() - 1; + var timer = null; + this.inProgress = true; + var loop = (function() { + if (!$__9.hot) { + cancelAnimationFrame(timer); + $__9.inProgress = false; + return; + } + $__9.calculateRowsHeight({ + from: current, + to: Math.min(current + $AutoRowSize.CALCULATION_STEP, length) + }, colRange); + current = current + $AutoRowSize.CALCULATION_STEP + 1; + if (current < length) { + timer = requestAnimationFrame(loop); + } else { + cancelAnimationFrame(timer); + $__9.inProgress = false; + $__9.hot.view.wt.wtOverlays.adjustElementsSize(true); + if ($__9.hot.view.wt.wtOverlays.leftOverlay.needFullRender) { + $__9.hot.view.wt.wtOverlays.leftOverlay.clone.draw(); + } + } + }); + if (this.firstCalculation && this.getSyncCalculationLimit()) { + this.calculateRowsHeight({ + from: 0, + to: this.getSyncCalculationLimit() + }, colRange); + this.firstCalculation = false; + current = this.getSyncCalculationLimit() + 1; + } + if (current < length) { + loop(); + } else { + this.inProgress = false; + } + }, + recalculateAllRowsHeight: function() { + if (isVisible(this.hot.view.wt.wtTable.TABLE)) { + this.clearCache(); + this.calculateAllRowsHeight(); + } + }, + getSyncCalculationLimit: function() { + var limit = $AutoRowSize.SYNC_CALCULATION_LIMIT; + var rowsLimit = this.hot.countRows() - 1; + if (isObject(this.hot.getSettings().autoRowSize)) { + limit = this.hot.getSettings().autoRowSize.syncLimit; + if (isPercentValue(limit)) { + limit = valueAccordingPercent(rowsLimit, limit); + } else { + limit = limit >> 0; + } + } + return Math.min(limit, rowsLimit); + }, + getRowHeight: function(row) { + var defaultHeight = arguments[1]; + var height = defaultHeight; + if (this.heights[row] !== void 0 && this.heights[row] > (defaultHeight || 0)) { + height = this.heights[row]; + } + return height; + }, + getFirstVisibleRow: function() { + var wot = this.hot.view.wt; + if (wot.wtViewport.rowsVisibleCalculator) { + return wot.wtTable.getFirstVisibleRow(); + } + if (wot.wtViewport.rowsRenderCalculator) { + return wot.wtTable.getFirstRenderedRow(); + } + return -1; + }, + getLastVisibleRow: function() { + var wot = this.hot.view.wt; + if (wot.wtViewport.rowsVisibleCalculator) { + return wot.wtTable.getLastVisibleRow(); + } + if (wot.wtViewport.rowsRenderCalculator) { + return wot.wtTable.getLastRenderedRow(); + } + return -1; + }, + clearCache: function() { + this.heights.length = 0; + }, + clearCacheByRange: function(range) { + var $__9 = this; + if (typeof range === 'number') { + range = { + from: range, + to: range + }; + } + rangeEach(Math.min(range.from, range.to), Math.max(range.from, range.to), (function(row) { + return $__9.heights[row] = void 0; + })); + }, + isNeedRecalculate: function() { + return arrayFilter(this.heights, (function(item) { + return (item === void 0); + })).length ? true : false; + }, + onBeforeRender: function() { + var force = this.hot.renderCall; + this.calculateRowsHeight({ + from: this.getFirstVisibleRow(), + to: this.getLastVisibleRow() + }, void 0, force); + if (this.isNeedRecalculate() && !this.inProgress) { + this.calculateAllRowsHeight(); + } + }, + onBeforeRowMove: function(from, to) { + this.clearCacheByRange({ + from: from, + to: to + }); + this.calculateAllRowsHeight(); + }, + onBeforeRowResize: function(row, size, isDblClick) { + if (isDblClick) { + this.calculateRowsHeight(row, void 0, true); + size = this.getRowHeight(row); + } + return size; + }, + onAfterLoadData: function() { + var $__9 = this; + if (this.hot.view) { + this.recalculateAllRowsHeight(); + } else { + setTimeout((function() { + if ($__9.hot) { + $__9.recalculateAllRowsHeight(); + } + }), 0); + } + }, + onBeforeChange: function(changes) { + var range = null; + if (changes.length === 1) { + range = changes[0][0]; + } else if (changes.length > 1) { + range = { + from: changes[0][0], + to: changes[changes.length - 1][0] + }; + } + if (range !== null) { + this.clearCacheByRange(range); + } + }, + destroy: function() { + this.ghostTable.clean(); + $traceurRuntime.superGet(this, $AutoRowSize.prototype, "destroy").call(this); + } +}, { + get CALCULATION_STEP() { + return 50; + }, + get SYNC_CALCULATION_LIMIT() { + return 500; + } +}, BasePlugin); +; +registerPlugin('autoRowSize', AutoRowSize); + +//# +},{"_base":58,"helpers/array":42,"helpers/dom/element":45,"helpers/number":49,"helpers/object":50,"helpers/string":52,"plugins":57,"utils/ghostTable":98,"utils/samplesGenerator":99}],61:[function(require,module,exports){ +"use strict"; +Object.defineProperties(exports, { + Autofill: {get: function() { + return Autofill; + }}, + __esModule: {value: true} +}); +var $___46__46__47__46__46__47_helpers_47_dom_47_element__, + $___46__46__47__46__46__47_eventManager__, + $___46__46__47__46__46__47_plugins__, + $___46__46__47__46__46__47_3rdparty_47_walkontable_47_src_47_cell_47_coords__; +var $__0 = ($___46__46__47__46__46__47_helpers_47_dom_47_element__ = require("helpers/dom/element"), $___46__46__47__46__46__47_helpers_47_dom_47_element__ && $___46__46__47__46__46__47_helpers_47_dom_47_element__.__esModule && $___46__46__47__46__46__47_helpers_47_dom_47_element__ || {default: $___46__46__47__46__46__47_helpers_47_dom_47_element__}), + offset = $__0.offset, + outerHeight = $__0.outerHeight, + outerWidth = $__0.outerWidth; +var eventManagerObject = ($___46__46__47__46__46__47_eventManager__ = require("eventManager"), $___46__46__47__46__46__47_eventManager__ && $___46__46__47__46__46__47_eventManager__.__esModule && $___46__46__47__46__46__47_eventManager__ || {default: $___46__46__47__46__46__47_eventManager__}).eventManager; +var registerPlugin = ($___46__46__47__46__46__47_plugins__ = require("plugins"), $___46__46__47__46__46__47_plugins__ && $___46__46__47__46__46__47_plugins__.__esModule && $___46__46__47__46__46__47_plugins__ || {default: $___46__46__47__46__46__47_plugins__}).registerPlugin; +var WalkontableCellCoords = ($___46__46__47__46__46__47_3rdparty_47_walkontable_47_src_47_cell_47_coords__ = require("3rdparty/walkontable/src/cell/coords"), $___46__46__47__46__46__47_3rdparty_47_walkontable_47_src_47_cell_47_coords__ && $___46__46__47__46__46__47_3rdparty_47_walkontable_47_src_47_cell_47_coords__.__esModule && $___46__46__47__46__46__47_3rdparty_47_walkontable_47_src_47_cell_47_coords__ || {default: $___46__46__47__46__46__47_3rdparty_47_walkontable_47_src_47_cell_47_coords__}).WalkontableCellCoords; +; +function getDeltas(start, end, data, direction) { + var rlength = data.length, + clength = data ? data[0].length : 0, + deltas = [], + arr = [], + diffRow, + diffCol, + startValue, + endValue, + delta; + diffRow = end.row - start.row; + diffCol = end.col - start.col; + if (['down', 'up'].indexOf(direction) !== -1) { + for (var col = 0; col <= diffCol; col++) { + startValue = parseInt(data[0][col], 10); + endValue = parseInt(data[rlength - 1][col], 10); + delta = (direction === 'down' ? (endValue - startValue) : (startValue - endValue)) / (rlength - 1) || 0; + arr.push(delta); + } + deltas.push(arr); + } + if (['right', 'left'].indexOf(direction) !== -1) { + for (var row = 0; row <= diffRow; row++) { + startValue = parseInt(data[row][0], 10); + endValue = parseInt(data[row][clength - 1], 10); + delta = (direction === 'right' ? (endValue - startValue) : (startValue - endValue)) / (clength - 1) || 0; + arr = []; + arr.push(delta); + deltas.push(arr); + } + } + return deltas; +} +function Autofill(instance) { + var _this = this, + mouseDownOnCellCorner = false, + wtOnCellCornerMouseDown, + wtOnCellMouseOver, + eventManager; + this.instance = instance; + this.addingStarted = false; + eventManager = eventManagerObject(instance); + function mouseUpCallback(event) { + if (!instance.autofill) { + return true; + } + if (instance.autofill.handle && instance.autofill.handle.isDragged) { + if (instance.autofill.handle.isDragged > 1) { + instance.autofill.apply(); + } + instance.autofill.handle.isDragged = 0; + mouseDownOnCellCorner = false; + } + } + function mouseMoveCallback(event) { + var tableBottom, + tableRight; + if (!_this.instance.autofill) { + return false; + } + tableBottom = offset(_this.instance.table).top - (window.pageYOffset || document.documentElement.scrollTop) + outerHeight(_this.instance.table); + tableRight = offset(_this.instance.table).left - (window.pageXOffset || document.documentElement.scrollLeft) + outerWidth(_this.instance.table); + if (_this.addingStarted === false && _this.instance.autofill.handle.isDragged > 0 && event.clientY > tableBottom && event.clientX <= tableRight) { + _this.instance.mouseDragOutside = true; + _this.addingStarted = true; + } else { + _this.instance.mouseDragOutside = false; + } + if (_this.instance.mouseDragOutside) { + setTimeout(function() { + _this.addingStarted = false; + _this.instance.alter('insert_row'); + }, 200); + } + } + eventManager.addEventListener(document, 'mouseup', mouseUpCallback); + eventManager.addEventListener(document, 'mousemove', mouseMoveCallback); + wtOnCellCornerMouseDown = this.instance.view.wt.wtSettings.settings.onCellCornerMouseDown; + this.instance.view.wt.wtSettings.settings.onCellCornerMouseDown = function(event) { + instance.autofill.handle.isDragged = 1; + mouseDownOnCellCorner = true; + wtOnCellCornerMouseDown(event); + }; + wtOnCellMouseOver = this.instance.view.wt.wtSettings.settings.onCellMouseOver; + this.instance.view.wt.wtSettings.settings.onCellMouseOver = function(event, coords, TD, wt) { + if (instance.autofill && mouseDownOnCellCorner && !instance.view.isMouseDown() && instance.autofill.handle && instance.autofill.handle.isDragged) { + instance.autofill.handle.isDragged++; + instance.autofill.showBorder(coords); + instance.autofill.checkIfNewRowNeeded(); + } + wtOnCellMouseOver(event, coords, TD, wt); + }; + this.instance.view.wt.wtSettings.settings.onCellCornerDblClick = function() { + instance.autofill.selectAdjacent(); + }; +} +Autofill.prototype.init = function() { + this.handle = {}; +}; +Autofill.prototype.disable = function() { + this.handle.disabled = true; +}; +Autofill.prototype.selectAdjacent = function() { + var select, + data, + r, + maxR, + c; + if (this.instance.selection.isMultiple()) { + select = this.instance.view.wt.selections.area.getCorners(); + } else { + select = this.instance.view.wt.selections.current.getCorners(); + } + data = this.instance.getData(); + rows: for (r = select[2] + 1; r < this.instance.countRows(); r++) { + for (c = select[1]; c <= select[3]; c++) { + if (data[r][c]) { + break rows; + } + } + if (!!data[r][select[1] - 1] || !!data[r][select[3] + 1]) { + maxR = r; + } + } + if (maxR) { + this.instance.view.wt.selections.fill.clear(); + this.instance.view.wt.selections.fill.add(new WalkontableCellCoords(select[0], select[1])); + this.instance.view.wt.selections.fill.add(new WalkontableCellCoords(maxR, select[3])); + this.apply(); + } +}; +Autofill.prototype.apply = function() { + var drag, + select, + start, + end, + _data, + direction, + deltas, + selRange; + this.handle.isDragged = 0; + if (this.instance.view.wt.selections.fill.isEmpty()) { + return; + } + drag = this.instance.view.wt.selections.fill.getCorners(); + this.instance.view.wt.selections.fill.clear(); + if (this.instance.selection.isMultiple()) { + select = this.instance.view.wt.selections.area.getCorners(); + } else { + select = this.instance.view.wt.selections.current.getCorners(); + } + Handsontable.hooks.run(this.instance, 'afterAutofillApplyValues', select, drag); + if (drag[0] === select[0] && drag[1] < select[1]) { + direction = 'left'; + start = new WalkontableCellCoords(drag[0], drag[1]); + end = new WalkontableCellCoords(drag[2], select[1] - 1); + } else if (drag[0] === select[0] && drag[3] > select[3]) { + direction = 'right'; + start = new WalkontableCellCoords(drag[0], select[3] + 1); + end = new WalkontableCellCoords(drag[2], drag[3]); + } else if (drag[0] < select[0] && drag[1] === select[1]) { + direction = 'up'; + start = new WalkontableCellCoords(drag[0], drag[1]); + end = new WalkontableCellCoords(select[0] - 1, drag[3]); + } else if (drag[2] > select[2] && drag[1] === select[1]) { + direction = 'down'; + start = new WalkontableCellCoords(select[2] + 1, drag[1]); + end = new WalkontableCellCoords(drag[2], drag[3]); + } + if (start && start.row > -1 && start.col > -1) { + selRange = { + from: this.instance.getSelectedRange().from, + to: this.instance.getSelectedRange().to + }; + _data = this.instance.getData(selRange.from.row, selRange.from.col, selRange.to.row, selRange.to.col); + deltas = getDeltas(start, end, _data, direction); + Handsontable.hooks.run(this.instance, 'beforeAutofill', start, end, _data); + this.instance.populateFromArray(start.row, start.col, _data, end.row, end.col, 'autofill', null, direction, deltas); + this.instance.selection.setRangeStart(new WalkontableCellCoords(drag[0], drag[1])); + this.instance.selection.setRangeEnd(new WalkontableCellCoords(drag[2], drag[3])); + } else { + this.instance.selection.refreshBorders(); + } +}; +Autofill.prototype.showBorder = function(coords) { + var topLeft = this.instance.getSelectedRange().getTopLeftCorner(), + bottomRight = this.instance.getSelectedRange().getBottomRightCorner(); + if (this.instance.getSettings().fillHandle !== 'horizontal' && (bottomRight.row < coords.row || topLeft.row > coords.row)) { + coords = new WalkontableCellCoords(coords.row, bottomRight.col); + } else if (this.instance.getSettings().fillHandle !== 'vertical') { + coords = new WalkontableCellCoords(bottomRight.row, coords.col); + } else { + return; + } + this.instance.view.wt.selections.fill.clear(); + this.instance.view.wt.selections.fill.add(this.instance.getSelectedRange().from); + this.instance.view.wt.selections.fill.add(this.instance.getSelectedRange().to); + this.instance.view.wt.selections.fill.add(coords); + this.instance.view.render(); +}; +Autofill.prototype.checkIfNewRowNeeded = function() { + var fillCorners, + selection, + tableRows = this.instance.countRows(), + that = this; + if (this.instance.view.wt.selections.fill.cellRange && this.addingStarted === false) { + selection = this.instance.getSelected(); + fillCorners = this.instance.view.wt.selections.fill.getCorners(); + if (selection[2] < tableRows - 1 && fillCorners[2] === tableRows - 1) { + this.addingStarted = true; + this.instance._registerTimeout(setTimeout(function() { + that.instance.alter('insert_row'); + that.addingStarted = false; + }, 200)); + } + } +}; +Handsontable.hooks.add('afterInit', function() { + var autofill = new Autofill(this); + if (typeof this.getSettings().fillHandle !== 'undefined') { + if (autofill.handle && this.getSettings().fillHandle === false) { + autofill.disable(); + } else if (!autofill.handle && this.getSettings().fillHandle !== false) { + this.autofill = autofill; + this.autofill.init(); + } + } +}); +Handsontable.Autofill = Autofill; + +//# +},{"3rdparty/walkontable/src/cell/coords":5,"eventManager":41,"helpers/dom/element":45,"plugins":57}],62:[function(require,module,exports){ +"use strict"; +Object.defineProperties(exports, { + ColumnSorting: {get: function() { + return ColumnSorting; + }}, + __esModule: {value: true} +}); +var $___46__46__47__46__46__47_helpers_47_dom_47_element__, + $___46__46__47__46__46__47_helpers_47_array__, + $___46__46__47__46__46__47_eventManager__, + $___46__46__47__95_base__, + $___46__46__47__46__46__47_plugins__; +var $__0 = ($___46__46__47__46__46__47_helpers_47_dom_47_element__ = require("helpers/dom/element"), $___46__46__47__46__46__47_helpers_47_dom_47_element__ && $___46__46__47__46__46__47_helpers_47_dom_47_element__.__esModule && $___46__46__47__46__46__47_helpers_47_dom_47_element__ || {default: $___46__46__47__46__46__47_helpers_47_dom_47_element__}), + addClass = $__0.addClass, + closest = $__0.closest, + hasClass = $__0.hasClass, + index = $__0.index, + removeClass = $__0.removeClass; +var $__1 = ($___46__46__47__46__46__47_helpers_47_array__ = require("helpers/array"), $___46__46__47__46__46__47_helpers_47_array__ && $___46__46__47__46__46__47_helpers_47_array__.__esModule && $___46__46__47__46__46__47_helpers_47_array__ || {default: $___46__46__47__46__46__47_helpers_47_array__}), + arrayEach = $__1.arrayEach, + arrayMap = $__1.arrayMap, + arrayReduce = $__1.arrayReduce; +var eventManagerObject = ($___46__46__47__46__46__47_eventManager__ = require("eventManager"), $___46__46__47__46__46__47_eventManager__ && $___46__46__47__46__46__47_eventManager__.__esModule && $___46__46__47__46__46__47_eventManager__ || {default: $___46__46__47__46__46__47_eventManager__}).eventManager; +var BasePlugin = ($___46__46__47__95_base__ = require("_base"), $___46__46__47__95_base__ && $___46__46__47__95_base__.__esModule && $___46__46__47__95_base__ || {default: $___46__46__47__95_base__}).default; +var registerPlugin = ($___46__46__47__46__46__47_plugins__ = require("plugins"), $___46__46__47__46__46__47_plugins__ && $___46__46__47__46__46__47_plugins__.__esModule && $___46__46__47__46__46__47_plugins__ || {default: $___46__46__47__46__46__47_plugins__}).registerPlugin; +Handsontable.hooks.register('beforeColumnSort'); +Handsontable.hooks.register('afterColumnSort'); +var ColumnSorting = function ColumnSorting(hotInstance) { + $traceurRuntime.superConstructor($ColumnSorting).call(this, hotInstance); + this.sortIndicators = []; +}; +var $ColumnSorting = ColumnSorting; +($traceurRuntime.createClass)(ColumnSorting, { + isEnabled: function() { + return !!(this.hot.getSettings().columnSorting); + }, + enablePlugin: function() { + var $__5 = this; + if (this.enabled) { + return; + } + var _this = this; + this.hot.sortIndex = []; + this.hot.sort = function() { + var args = Array.prototype.slice.call(arguments); + return _this.sortByColumn.apply(_this, args); + }; + if (typeof this.hot.getSettings().observeChanges === 'undefined') { + this.enableObserveChangesPlugin(); + } + this.bindColumnSortingAfterClick(); + this.addHook('afterTrimRow', (function(row) { + return $__5.sort(); + })); + this.addHook('afterUntrimRow', (function(row) { + return $__5.sort(); + })); + this.addHook('modifyRow', (function(row) { + return $__5.translateRow(row); + })); + this.addHook('afterUpdateSettings', (function() { + return $__5.onAfterUpdateSettings(); + })); + this.addHook('afterGetColHeader', (function(col, TH) { + return $__5.getColHeader(col, TH); + })); + this.addHook('afterCreateRow', function() { + _this.afterCreateRow.apply(_this, arguments); + }); + this.addHook('afterRemoveRow', function() { + _this.afterRemoveRow.apply(_this, arguments); + }); + this.addHook('afterInit', (function() { + return $__5.sortBySettings(); + })); + this.addHook('afterLoadData', (function() { + $__5.hot.sortIndex = []; + if ($__5.hot.view) { + $__5.sortBySettings(); + } + })); + if (this.hot.view) { + this.sortBySettings(); + } + $traceurRuntime.superGet(this, $ColumnSorting.prototype, "enablePlugin").call(this); + }, + disablePlugin: function() { + this.hot.sort = void 0; + $traceurRuntime.superGet(this, $ColumnSorting.prototype, "disablePlugin").call(this); + }, + onAfterUpdateSettings: function() { + this.sortBySettings(); + }, + sortBySettings: function() { + var sortingSettings = this.hot.getSettings().columnSorting; + var loadedSortingState = this.loadSortingState(); + var sortingColumn; + var sortingOrder; + if (typeof loadedSortingState === 'undefined') { + sortingColumn = sortingSettings.column; + sortingOrder = sortingSettings.sortOrder; + } else { + sortingColumn = loadedSortingState.sortColumn; + sortingOrder = loadedSortingState.sortOrder; + } + this.sortByColumn(sortingColumn, sortingOrder); + }, + setSortingColumn: function(col, order) { + if (typeof col == 'undefined') { + this.hot.sortColumn = void 0; + this.hot.sortOrder = void 0; + return; + } else if (this.hot.sortColumn === col && typeof order == 'undefined') { + if (this.hot.sortOrder === false) { + this.hot.sortOrder = void 0; + } else { + this.hot.sortOrder = !this.hot.sortOrder; + } + } else { + this.hot.sortOrder = typeof order === 'undefined' ? true : order; + } + this.hot.sortColumn = col; + }, + sortByColumn: function(col, order) { + this.setSortingColumn(col, order); + if (typeof this.hot.sortColumn == 'undefined') { + return; + } + Handsontable.hooks.run(this.hot, 'beforeColumnSort', this.hot.sortColumn, this.hot.sortOrder); + this.sort(); + this.hot.render(); + this.saveSortingState(); + Handsontable.hooks.run(this.hot, 'afterColumnSort', this.hot.sortColumn, this.hot.sortOrder); + }, + saveSortingState: function() { + var sortingState = {}; + if (typeof this.hot.sortColumn != 'undefined') { + sortingState.sortColumn = this.hot.sortColumn; + } + if (typeof this.hot.sortOrder != 'undefined') { + sortingState.sortOrder = this.hot.sortOrder; + } + if (sortingState.hasOwnProperty('sortColumn') || sortingState.hasOwnProperty('sortOrder')) { + Handsontable.hooks.run(this.hot, 'persistentStateSave', 'columnSorting', sortingState); + } + }, + loadSortingState: function() { + var storedState = {}; + Handsontable.hooks.run(this.hot, 'persistentStateLoad', 'columnSorting', storedState); + return storedState.value; + }, + bindColumnSortingAfterClick: function() { + if (this.bindedSortEvent) { + return; + } + var eventManager = eventManagerObject(this.hot), + _this = this; + this.bindedSortEvent = true; + eventManager.addEventListener(this.hot.rootElement, 'click', function(e) { + if (hasClass(e.target, 'columnSorting')) { + var col = getColumn(e.target); + if (col === this.lastSortedColumn) { + switch (_this.hot.sortOrder) { + case void 0: + _this.sortOrderClass = 'ascending'; + break; + case true: + _this.sortOrderClass = 'descending'; + break; + case false: + _this.sortOrderClass = void 0; + } + } else { + _this.sortOrderClass = 'ascending'; + } + this.lastSortedColumn = col; + _this.sortByColumn(col); + } + }); + function countRowHeaders() { + var tr = _this.hot.view.TBODY.querySelector('tr'); + var length = 1; + if (tr) { + length = tr.querySelectorAll('th').length; + } + return length; + } + function getColumn(target) { + var TH = closest(target, 'TH'); + return _this.hot.view.wt.wtTable.getFirstRenderedColumn() + index(TH) - countRowHeaders(); + } + }, + enableObserveChangesPlugin: function() { + var _this = this; + this.hot._registerTimeout(setTimeout(function() { + _this.hot.updateSettings({observeChanges: true}); + }, 0)); + }, + defaultSort: function(sortOrder) { + return function(a, b) { + if (typeof a[1] == 'string') { + a[1] = a[1].toLowerCase(); + } + if (typeof b[1] == 'string') { + b[1] = b[1].toLowerCase(); + } + if (a[1] === b[1]) { + return 0; + } + if (a[1] === null || a[1] === '') { + return 1; + } + if (b[1] === null || b[1] === '') { + return -1; + } + if (isNaN(a[1]) && !isNaN(b[1])) { + return sortOrder ? 1 : -1; + } else if (!isNaN(a[1]) && isNaN(b[1])) { + return sortOrder ? -1 : 1; + } + if (a[1] < b[1]) { + return sortOrder ? -1 : 1; + } + if (a[1] > b[1]) { + return sortOrder ? 1 : -1; + } + return 0; + }; + }, + dateSort: function(sortOrder) { + return function(a, b) { + if (a[1] === b[1]) { + return 0; + } + if (a[1] === null || a[1] === '') { + return 1; + } + if (b[1] === null || b[1] === '') { + return -1; + } + var aDate = new Date(a[1]); + var bDate = new Date(b[1]); + if (aDate < bDate) { + return sortOrder ? -1 : 1; + } + if (aDate > bDate) { + return sortOrder ? 1 : -1; + } + return 0; + }; + }, + sort: function() { + if (typeof this.hot.sortOrder == 'undefined') { + this.hot.sortIndex.length = 0; + return; + } + var colMeta, + sortFunction; + this.hot.sortingEnabled = false; + this.hot.sortIndex.length = 0; + var colOffset = this.hot.colOffset(); + for (var i = 0, + ilen = this.hot.countRows() - this.hot.getSettings().minSpareRows; i < ilen; i++) { + this.hot.sortIndex.push([i, this.hot.getDataAtCell(i, this.hot.sortColumn + colOffset)]); + } + colMeta = this.hot.getCellMeta(0, this.hot.sortColumn); + this.sortIndicators[this.hot.sortColumn] = colMeta.sortIndicator; + switch (colMeta.type) { + case 'date': + sortFunction = this.dateSort; + break; + default: + sortFunction = this.defaultSort; + } + this.hot.sortIndex.sort(sortFunction(this.hot.sortOrder)); + for (var i = this.hot.sortIndex.length; i < this.hot.countRows(); i++) { + this.hot.sortIndex.push([i, this.hot.getDataAtCell(i, this.hot.sortColumn + colOffset)]); + } + this.hot.sortingEnabled = true; + }, + translateRow: function(row) { + if (this.hot.sortingEnabled && (typeof this.hot.sortOrder !== 'undefined') && this.hot.sortIndex && this.hot.sortIndex.length && this.hot.sortIndex[row]) { + return this.hot.sortIndex[row][0]; + } + return row; + }, + untranslateRow: function(row) { + if (this.hot.sortingEnabled && this.hot.sortIndex && this.hot.sortIndex.length) { + for (var i = 0; i < this.hot.sortIndex.length; i++) { + if (this.hot.sortIndex[i][0] == row) { + return i; + } + } + } + }, + getColHeader: function(col, TH) { + var headerLink = TH.querySelector('.colHeader'); + var colspan = TH.getAttribute('colspan'); + var TRs = TH.parentNode.parentNode.childNodes; + var headerLevel = Array.prototype.indexOf.call(TRs, TH.parentNode); + headerLevel = headerLevel - TRs.length; + if (!headerLink) { + return; + } + if (this.hot.getSettings().columnSorting && col >= 0 && headerLevel === -1) { + addClass(headerLink, 'columnSorting'); + } + removeClass(headerLink, 'descending'); + removeClass(headerLink, 'ascending'); + if (this.sortIndicators[col]) { + if (col === this.hot.sortColumn) { + if (this.sortOrderClass === 'ascending') { + addClass(headerLink, 'ascending'); + } else if (this.sortOrderClass === 'descending') { + addClass(headerLink, 'descending'); + } + } + } + }, + isSorted: function() { + return typeof this.hot.sortColumn != 'undefined'; + }, + afterCreateRow: function(index, amount) { + if (!this.isSorted()) { + return; + } + for (var i = 0; i < this.hot.sortIndex.length; i++) { + if (this.hot.sortIndex[i][0] >= index) { + this.hot.sortIndex[i][0] += amount; + } + } + for (var i = 0; i < amount; i++) { + this.hot.sortIndex.splice(index + i, 0, [index + i, this.hot.getSourceData()[index + i][this.hot.sortColumn + this.hot.colOffset()]]); + } + this.saveSortingState(); + }, + afterRemoveRow: function(index, amount) { + if (!this.isSorted()) { + return; + } + var removedRows = this.hot.sortIndex.splice(index, amount); + removedRows = arrayMap(removedRows, (function(row) { + return row[0]; + })); + function countRowShift(logicalRow) { + return arrayReduce(removedRows, (function(count, removedLogicalRow) { + if (logicalRow > removedLogicalRow) { + count++; + } + return count; + }), 0); + } + this.hot.sortIndex = arrayMap(this.hot.sortIndex, (function(logicalRow, physicalRow) { + var rowShift = countRowShift(logicalRow[0]); + if (rowShift) { + logicalRow[0] -= rowShift; + } + return logicalRow; + })); + this.saveSortingState(); + } +}, {}, BasePlugin); +; +registerPlugin('columnSorting', ColumnSorting); + +//# +},{"_base":58,"eventManager":41,"helpers/array":42,"helpers/dom/element":45,"plugins":57}],63:[function(require,module,exports){ +"use strict"; +Object.defineProperties(exports, { + CommentEditor: {get: function() { + return CommentEditor; + }}, + __esModule: {value: true} +}); +var $___46__46__47__46__46__47_helpers_47_dom_47_element__; +var addClass = ($___46__46__47__46__46__47_helpers_47_dom_47_element__ = require("helpers/dom/element"), $___46__46__47__46__46__47_helpers_47_dom_47_element__ && $___46__46__47__46__46__47_helpers_47_dom_47_element__.__esModule && $___46__46__47__46__46__47_helpers_47_dom_47_element__ || {default: $___46__46__47__46__46__47_helpers_47_dom_47_element__}).addClass; +var CommentEditor = function CommentEditor() { + this.editor = this.createEditor(); + this.editorStyle = this.editor.style; + this.editorStyle.position = 'absolute'; + this.editorStyle.zIndex = 100; + this.hide(); +}; +var $CommentEditor = CommentEditor; +($traceurRuntime.createClass)(CommentEditor, { + setPosition: function(x, y) { + this.editorStyle.left = x + 'px'; + this.editorStyle.top = y + 'px'; + }, + show: function() { + this.editorStyle.display = 'block'; + }, + hide: function() { + this.editorStyle.display = 'none'; + }, + isVisible: function() { + return this.editorStyle.display === 'block'; + }, + setValue: function() { + var value = arguments[0] !== (void 0) ? arguments[0] : ''; + value = value || ''; + this.getInputElement().value = value; + }, + getValue: function() { + return this.getInputElement().value; + }, + isFocused: function() { + return document.activeElement === this.getInputElement(); + }, + focus: function() { + this.getInputElement().focus(); + }, + createEditor: function() { + var container = document.querySelector('.' + $CommentEditor.CLASS_EDITOR_CONTAINER); + var editor; + var textArea; + if (!container) { + container = document.createElement('div'); + addClass(container, $CommentEditor.CLASS_EDITOR_CONTAINER); + document.body.appendChild(container); + } + editor = document.createElement('div'); + addClass(editor, $CommentEditor.CLASS_EDITOR); + textArea = document.createElement('textarea'); + addClass(textArea, $CommentEditor.CLASS_INPUT); + editor.appendChild(textArea); + container.appendChild(editor); + return editor; + }, + getInputElement: function() { + return this.editor.querySelector('.' + $CommentEditor.CLASS_INPUT); + }, + destroy: function() { + this.editor.parentNode.removeChild(this.editor); + this.editor = null; + this.editorStyle = null; + } +}, { + get CLASS_EDITOR_CONTAINER() { + return 'htCommentsContainer'; + }, + get CLASS_EDITOR() { + return 'htComments'; + }, + get CLASS_INPUT() { + return 'htCommentTextArea'; + }, + get CLASS_CELL() { + return 'htCommentCell'; + } +}); +; + +//# +},{"helpers/dom/element":45}],64:[function(require,module,exports){ +"use strict"; +Object.defineProperties(exports, { + Comments: {get: function() { + return Comments; + }}, + __esModule: {value: true} +}); +var $___46__46__47__46__46__47_helpers_47_dom_47_element__, + $___46__46__47__46__46__47_eventManager__, + $___46__46__47__46__46__47_3rdparty_47_walkontable_47_src_47_cell_47_coords__, + $___46__46__47__46__46__47_plugins__, + $___46__46__47__95_base__, + $__commentEditor__; +var $__0 = ($___46__46__47__46__46__47_helpers_47_dom_47_element__ = require("helpers/dom/element"), $___46__46__47__46__46__47_helpers_47_dom_47_element__ && $___46__46__47__46__46__47_helpers_47_dom_47_element__.__esModule && $___46__46__47__46__46__47_helpers_47_dom_47_element__ || {default: $___46__46__47__46__46__47_helpers_47_dom_47_element__}), + addClass = $__0.addClass, + closest = $__0.closest, + getWindowScrollLeft = $__0.getWindowScrollLeft, + getWindowScrollTop = $__0.getWindowScrollTop, + hasClass = $__0.hasClass, + offset = $__0.offset; +var EventManager = ($___46__46__47__46__46__47_eventManager__ = require("eventManager"), $___46__46__47__46__46__47_eventManager__ && $___46__46__47__46__46__47_eventManager__.__esModule && $___46__46__47__46__46__47_eventManager__ || {default: $___46__46__47__46__46__47_eventManager__}).EventManager; +var WalkontableCellCoords = ($___46__46__47__46__46__47_3rdparty_47_walkontable_47_src_47_cell_47_coords__ = require("3rdparty/walkontable/src/cell/coords"), $___46__46__47__46__46__47_3rdparty_47_walkontable_47_src_47_cell_47_coords__ && $___46__46__47__46__46__47_3rdparty_47_walkontable_47_src_47_cell_47_coords__.__esModule && $___46__46__47__46__46__47_3rdparty_47_walkontable_47_src_47_cell_47_coords__ || {default: $___46__46__47__46__46__47_3rdparty_47_walkontable_47_src_47_cell_47_coords__}).WalkontableCellCoords; +var $__3 = ($___46__46__47__46__46__47_plugins__ = require("plugins"), $___46__46__47__46__46__47_plugins__ && $___46__46__47__46__46__47_plugins__.__esModule && $___46__46__47__46__46__47_plugins__ || {default: $___46__46__47__46__46__47_plugins__}), + registerPlugin = $__3.registerPlugin, + getPlugin = $__3.getPlugin; +var BasePlugin = ($___46__46__47__95_base__ = require("_base"), $___46__46__47__95_base__ && $___46__46__47__95_base__.__esModule && $___46__46__47__95_base__ || {default: $___46__46__47__95_base__}).default; +var CommentEditor = ($__commentEditor__ = require("commentEditor"), $__commentEditor__ && $__commentEditor__.__esModule && $__commentEditor__ || {default: $__commentEditor__}).CommentEditor; +var Comments = function Comments(hotInstance) { + $traceurRuntime.superConstructor($Comments).call(this, hotInstance); + this.editor = null; + this.eventManager = null; + this.range = {}; + this.mouseDown = false; + this.contextMenuEvent = false; + this.timer = null; +}; +var $Comments = Comments; +($traceurRuntime.createClass)(Comments, { + isEnabled: function() { + return this.hot.getSettings().comments; + }, + enablePlugin: function() { + var $__6 = this; + if (this.enabled) { + return; + } + if (!this.editor) { + this.editor = new CommentEditor(); + } + if (!this.eventManager) { + this.eventManager = new EventManager(this); + } + this.addHook('afterContextMenuDefaultOptions', (function(options) { + return $__6.addToContextMenu(options); + })); + this.addHook('afterRenderer', (function(TD, row, col, prop, value, cellProperties) { + return $__6.onAfterRenderer(TD, cellProperties); + })); + this.addHook('afterScrollHorizontally', (function() { + return $__6.refreshEditorPosition(); + })); + this.addHook('afterScrollVertically', (function() { + return $__6.refreshEditorPosition(); + })); + this.addHook('afterColumnResize', (function() { + return $__6.refreshEditorPosition(); + })); + this.addHook('afterRowResize', (function() { + return $__6.refreshEditorPosition(); + })); + this.registerListeners(); + $traceurRuntime.superGet(this, $Comments.prototype, "enablePlugin").call(this); + }, + disablePlugin: function() { + $traceurRuntime.superGet(this, $Comments.prototype, "disablePlugin").call(this); + }, + registerListeners: function() { + var $__6 = this; + this.eventManager.addEventListener(document, 'mouseover', (function(event) { + return $__6.onMouseOver(event); + })); + this.eventManager.addEventListener(document, 'mousedown', (function(event) { + return $__6.onMouseDown(event); + })); + this.eventManager.addEventListener(document, 'mousemove', (function(event) { + return $__6.onMouseMove(event); + })); + this.eventManager.addEventListener(document, 'mouseup', (function(event) { + return $__6.onMouseUp(event); + })); + this.eventManager.addEventListener(this.editor.getInputElement(), 'blur', (function(event) { + return $__6.onEditorBlur(event); + })); + }, + setRange: function(range) { + this.range = range; + }, + clearRange: function() { + this.range = {}; + }, + targetIsCellWithComment: function(event) { + return hasClass(event.target, 'htCommentCell') && closest(event.target, [this.hot.rootElement]) ? true : false; + }, + targetIsCommentTextArea: function(event) { + return this.editor.getInputElement() === event.target; + }, + saveComment: function() { + if (!this.range.from) { + throw new Error('Before using this method, first set cell range (hot.getPlugin("comment").setRange())'); + } + var comment = this.editor.getValue(); + var row = this.range.from.row; + var col = this.range.from.col; + this.hot.setCellMeta(row, col, 'comment', comment); + this.hot.render(); + }, + saveCommentAtCell: function(row, col) { + this.setRange({from: new WalkontableCellCoords(row, col)}); + this.saveComment(); + }, + removeComment: function() { + if (!this.range.from) { + throw new Error('Before using this method, first set cell range (hot.getPlugin("comment").setRange())'); + } + this.hot.removeCellMeta(this.range.from.row, this.range.from.col, 'comment'); + this.hot.render(); + this.hide(); + }, + removeCommentAtCell: function(row, col) { + this.setRange({from: new WalkontableCellCoords(row, col)}); + this.removeComment(); + }, + show: function() { + if (!this.range.from) { + throw new Error('Before using this method, first set cell range (hot.getPlugin("comment").setRange())'); + } + var meta = this.hot.getCellMeta(this.range.from.row, this.range.from.col); + this.refreshEditorPosition(true); + this.editor.setValue(meta.comment || ''); + this.editor.show(); + return true; + }, + showAtCell: function(row, col) { + this.setRange({from: new WalkontableCellCoords(row, col)}); + return this.show(); + }, + hide: function() { + this.editor.hide(); + }, + refreshEditorPosition: function() { + var force = arguments[0] !== (void 0) ? arguments[0] : false; + if (!force && (!this.range.from || !this.editor.isVisible())) { + return; + } + var TD = this.hot.view.wt.wtTable.getCell(this.range.from); + var cellOffset = offset(TD); + var lastColWidth = this.hot.getColWidth(this.range.from.col); + var cellTopOffset = cellOffset.top; + var cellLeftOffset = cellOffset.left; + var verticalCompensation = 0; + var horizontalCompensation = 0; + if (this.hot.view.wt.wtViewport.hasVerticalScroll()) { + cellTopOffset = cellTopOffset - this.hot.view.wt.wtOverlays.topOverlay.getScrollPosition(); + verticalCompensation = 20; + } + if (this.hot.view.wt.wtViewport.hasHorizontalScroll()) { + cellLeftOffset = cellLeftOffset - this.hot.view.wt.wtOverlays.leftOverlay.getScrollPosition(); + horizontalCompensation = 20; + } + var x = cellLeftOffset + lastColWidth; + var y = cellTopOffset; + var rect = this.hot.view.wt.wtTable.holder.getBoundingClientRect(); + var holderPos = { + left: rect.left + getWindowScrollLeft() + horizontalCompensation, + right: rect.right + getWindowScrollLeft() - 15, + top: rect.top + getWindowScrollTop() + verticalCompensation, + bottom: rect.bottom + getWindowScrollTop() + }; + if (x <= holderPos.left || x > holderPos.right || y <= holderPos.top || y > holderPos.bottom) { + this.hide(); + } else { + this.editor.setPosition(x, y); + } + }, + onMouseDown: function(event) { + this.mouseDown = true; + if (!this.hot.view || !this.hot.view.wt) { + return; + } + if (!this.contextMenuEvent && !this.targetIsCommentTextArea(event) && !this.targetIsCellWithComment(event)) { + this.hide(); + } + this.contextMenuEvent = false; + }, + onMouseOver: function(event) { + if (this.mouseDown || this.editor.isFocused()) { + return; + } + if (this.targetIsCellWithComment(event)) { + var coordinates = this.hot.view.wt.wtTable.getCoords(event.target); + var range = {from: new WalkontableCellCoords(coordinates.row, coordinates.col)}; + this.setRange(range); + this.show(); + } else if (!this.targetIsCommentTextArea(event) && !this.editor.isFocused()) { + this.hide(); + } + }, + onMouseMove: function(event) { + var $__6 = this; + if (this.targetIsCommentTextArea(event)) { + this.mouseDown = true; + clearTimeout(this.timer); + this.timer = setTimeout((function() { + $__6.mouseDown = false; + }), 200); + } + }, + onMouseUp: function(event) { + this.mouseDown = false; + }, + onAfterRenderer: function(TD, cellProperties) { + if (cellProperties.comment) { + addClass(TD, cellProperties.commentedCellClassName); + } + }, + onEditorBlur: function(event) { + this.saveComment(); + }, + checkSelectionCommentsConsistency: function() { + var selected = this.hot.getSelectedRange(); + if (!selected) { + return false; + } + var hasComment = false; + var cell = selected.from; + if (this.hot.getCellMeta(cell.row, cell.col).comment) { + hasComment = true; + } + return hasComment; + }, + onContextMenuAddComment: function() { + var $__6 = this; + var coords = this.hot.getSelectedRange(); + this.contextMenuEvent = true; + this.setRange({from: coords.from}); + this.show(); + setTimeout((function() { + if ($__6.hot) { + $__6.hot.deselectCell(); + $__6.editor.focus(); + } + }), 10); + }, + onContextMenuRemoveComment: function(key, selection) { + this.contextMenuEvent = true; + this.removeCommentAtCell(selection.start.row, selection.start.col); + }, + addToContextMenu: function(defaultOptions) { + var $__6 = this; + defaultOptions.items.push(Handsontable.plugins.ContextMenu.SEPARATOR, { + key: 'commentsAddEdit', + name: (function() { + return $__6.checkSelectionCommentsConsistency() ? 'Edit Comment' : 'Add Comment'; + }), + callback: (function() { + return $__6.onContextMenuAddComment(); + }), + disabled: function() { + return this.getSelected() ? false : true; + } + }, { + key: 'commentsRemove', + name: function() { + return 'Delete Comment'; + }, + callback: (function(key, selection) { + return $__6.onContextMenuRemoveComment(key, selection); + }), + disabled: (function() { + return !$__6.checkSelectionCommentsConsistency(); + }) + }); + }, + destroy: function() { + if (this.editor) { + this.editor.destroy(); + } + $traceurRuntime.superGet(this, $Comments.prototype, "destroy").call(this); + } +}, {}, BasePlugin); +; +registerPlugin('comments', Comments); + +//# +},{"3rdparty/walkontable/src/cell/coords":5,"_base":58,"commentEditor":63,"eventManager":41,"helpers/dom/element":45,"plugins":57}],65:[function(require,module,exports){ +"use strict"; +Object.defineProperties(exports, { + CommandExecutor: {get: function() { + return CommandExecutor; + }}, + __esModule: {value: true} +}); +var $___46__46__47__46__46__47_helpers_47_array__; +var arrayEach = ($___46__46__47__46__46__47_helpers_47_array__ = require("helpers/array"), $___46__46__47__46__46__47_helpers_47_array__ && $___46__46__47__46__46__47_helpers_47_array__.__esModule && $___46__46__47__46__46__47_helpers_47_array__ || {default: $___46__46__47__46__46__47_helpers_47_array__}).arrayEach; +var CommandExecutor = function CommandExecutor(hotInstance) { + this.hot = hotInstance; + this.commands = {}; + this.commonCallback = null; +}; +($traceurRuntime.createClass)(CommandExecutor, { + registerCommand: function(name, commandDescriptor) { + this.commands[name] = commandDescriptor; + }, + setCommonCallback: function(callback) { + this.commonCallback = callback; + }, + execute: function(commandName) { + for (var params = [], + $__3 = 1; $__3 < arguments.length; $__3++) + params[$__3 - 1] = arguments[$__3]; + var $__1 = this; + var commandSplit = commandName.split(':'); + commandName = commandSplit[0]; + var subCommandName = commandSplit.length === 2 ? commandSplit[1] : null; + var command = this.commands[commandName]; + if (!command) { + throw new Error(("Menu command '" + commandName + "' not exists.")); + } + if (subCommandName && command.submenu) { + command = findSubCommand(subCommandName, command.submenu.items); + } + if (command.disabled === true) { + return; + } + if (typeof command.disabled == 'function' && command.disabled.call(this.hot) === true) { + return; + } + if (command.hasOwnProperty('submenu')) { + return; + } + var callbacks = []; + if (typeof command.callback === 'function') { + callbacks.push(command.callback); + } + if (typeof this.commonCallback === 'function') { + callbacks.push(this.commonCallback); + } + params.unshift(commandSplit.join(':')); + arrayEach(callbacks, (function(callback) { + return callback.apply($__1.hot, params); + })); + } +}, {}); +function findSubCommand(subCommandName, subCommands) { + var command; + arrayEach(subCommands, (function(cmd) { + var cmds = cmd.key ? cmd.key.split(':') : null; + if (Array.isArray(cmds) && cmds[1] === subCommandName) { + command = cmd; + return false; + } + })); + return command; +} +; + +//# +},{"helpers/array":42}],66:[function(require,module,exports){ +"use strict"; +Object.defineProperties(exports, { + ContextMenu: {get: function() { + return ContextMenu; + }}, + __esModule: {value: true} +}); +var $___46__46__47__95_base__, + $___46__46__47__46__46__47_helpers_47_array__, + $__commandExecutor__, + $___46__46__47__46__46__47_eventManager__, + $___46__46__47__46__46__47_helpers_47_dom_47_element__, + $__itemsFactory__, + $__menu__, + $___46__46__47__46__46__47_helpers_47_object__, + $___46__46__47__46__46__47_plugins__, + $___46__46__47__46__46__47_helpers_47_dom_47_event__, + $__predefinedItems__; +var BasePlugin = ($___46__46__47__95_base__ = require("_base"), $___46__46__47__95_base__ && $___46__46__47__95_base__.__esModule && $___46__46__47__95_base__ || {default: $___46__46__47__95_base__}).default; +var arrayEach = ($___46__46__47__46__46__47_helpers_47_array__ = require("helpers/array"), $___46__46__47__46__46__47_helpers_47_array__ && $___46__46__47__46__46__47_helpers_47_array__.__esModule && $___46__46__47__46__46__47_helpers_47_array__ || {default: $___46__46__47__46__46__47_helpers_47_array__}).arrayEach; +var CommandExecutor = ($__commandExecutor__ = require("commandExecutor"), $__commandExecutor__ && $__commandExecutor__.__esModule && $__commandExecutor__ || {default: $__commandExecutor__}).CommandExecutor; +var EventManager = ($___46__46__47__46__46__47_eventManager__ = require("eventManager"), $___46__46__47__46__46__47_eventManager__ && $___46__46__47__46__46__47_eventManager__.__esModule && $___46__46__47__46__46__47_eventManager__ || {default: $___46__46__47__46__46__47_eventManager__}).EventManager; +var hasClass = ($___46__46__47__46__46__47_helpers_47_dom_47_element__ = require("helpers/dom/element"), $___46__46__47__46__46__47_helpers_47_dom_47_element__ && $___46__46__47__46__46__47_helpers_47_dom_47_element__.__esModule && $___46__46__47__46__46__47_helpers_47_dom_47_element__ || {default: $___46__46__47__46__46__47_helpers_47_dom_47_element__}).hasClass; +var ItemsFactory = ($__itemsFactory__ = require("itemsFactory"), $__itemsFactory__ && $__itemsFactory__.__esModule && $__itemsFactory__ || {default: $__itemsFactory__}).ItemsFactory; +var Menu = ($__menu__ = require("menu"), $__menu__ && $__menu__.__esModule && $__menu__ || {default: $__menu__}).Menu; +var $__7 = ($___46__46__47__46__46__47_helpers_47_object__ = require("helpers/object"), $___46__46__47__46__46__47_helpers_47_object__ && $___46__46__47__46__46__47_helpers_47_object__.__esModule && $___46__46__47__46__46__47_helpers_47_object__ || {default: $___46__46__47__46__46__47_helpers_47_object__}), + objectEach = $__7.objectEach, + mixin = $__7.mixin; +var registerPlugin = ($___46__46__47__46__46__47_plugins__ = require("plugins"), $___46__46__47__46__46__47_plugins__ && $___46__46__47__46__46__47_plugins__.__esModule && $___46__46__47__46__46__47_plugins__ || {default: $___46__46__47__46__46__47_plugins__}).registerPlugin; +var stopPropagation = ($___46__46__47__46__46__47_helpers_47_dom_47_event__ = require("helpers/dom/event"), $___46__46__47__46__46__47_helpers_47_dom_47_event__ && $___46__46__47__46__46__47_helpers_47_dom_47_event__.__esModule && $___46__46__47__46__46__47_helpers_47_dom_47_event__ || {default: $___46__46__47__46__46__47_helpers_47_dom_47_event__}).stopPropagation; +var $__10 = ($__predefinedItems__ = require("predefinedItems"), $__predefinedItems__ && $__predefinedItems__.__esModule && $__predefinedItems__ || {default: $__predefinedItems__}), + ROW_ABOVE = $__10.ROW_ABOVE, + ROW_BELOW = $__10.ROW_BELOW, + COLUMN_LEFT = $__10.COLUMN_LEFT, + COLUMN_RIGHT = $__10.COLUMN_RIGHT, + REMOVE_ROW = $__10.REMOVE_ROW, + REMOVE_COLUMN = $__10.REMOVE_COLUMN, + UNDO = $__10.UNDO, + REDO = $__10.REDO, + READ_ONLY = $__10.READ_ONLY, + ALIGNMENT = $__10.ALIGNMENT, + SEPARATOR = $__10.SEPARATOR, + predefinedItems = $__10.predefinedItems; +var ContextMenu = function ContextMenu(hotInstance) { + $traceurRuntime.superConstructor($ContextMenu).call(this, hotInstance); + this.eventManager = new EventManager(this); + this.commandExecutor = new CommandExecutor(this.hot); + this.itemsFactory = null; + this.menu = null; +}; +var $ContextMenu = ContextMenu; +($traceurRuntime.createClass)(ContextMenu, { + isEnabled: function() { + return this.hot.getSettings().contextMenu; + }, + enablePlugin: function() { + var $__11 = this; + if (this.enabled) { + return; + } + this.itemsFactory = new ItemsFactory(this.hot, $ContextMenu.DEFAULT_ITEMS); + var settings = this.hot.getSettings().contextMenu; + var predefinedItems = {items: this.itemsFactory.getVisibleItems(settings)}; + this.registerEvents(); + if (typeof settings.callback === 'function') { + this.commandExecutor.setCommonCallback(settings.callback); + } + $traceurRuntime.superGet(this, $ContextMenu.prototype, "enablePlugin").call(this); + this.callOnPluginsReady((function() { + $__11.hot.runHooks('afterContextMenuDefaultOptions', predefinedItems); + $__11.itemsFactory.setPredefinedItems(predefinedItems.items); + var menuItems = $__11.itemsFactory.getVisibleItems(settings); + $__11.menu = new Menu($__11.hot, { + className: 'htContextMenu', + keepInViewport: true + }); + $__11.menu.setMenuItems(menuItems); + $__11.menu.addLocalHook('afterOpen', (function() { + return $__11.onMenuAfterOpen(); + })); + $__11.menu.addLocalHook('afterClose', (function() { + return $__11.onMenuAfterClose(); + })); + $__11.menu.addLocalHook('executeCommand', (function() { + for (var params = [], + $__13 = 0; $__13 < arguments.length; $__13++) + params[$__13] = arguments[$__13]; + return $__11.executeCommand.apply($__11, params); + })); + arrayEach(menuItems, (function(command) { + return $__11.commandExecutor.registerCommand(command.key, command); + })); + })); + }, + disablePlugin: function() { + this.close(); + if (this.menu) { + this.menu.destroy(); + this.menu = null; + } + $traceurRuntime.superGet(this, $ContextMenu.prototype, "disablePlugin").call(this); + }, + registerEvents: function() { + var $__11 = this; + this.eventManager.addEventListener(this.hot.rootElement, 'contextmenu', (function(event) { + return $__11.onContextMenu(event); + })); + }, + open: function(event) { + if (!this.menu) { + return; + } + this.menu.open(); + this.menu.setPosition(event); + this.menu.hotMenu.isHotTableEnv = this.hot.isHotTableEnv; + Handsontable.eventManager.isHotTableEnv = this.hot.isHotTableEnv; + }, + close: function() { + if (!this.menu) { + return; + } + this.menu.close(); + }, + executeCommand: function() { + for (var params = [], + $__13 = 0; $__13 < arguments.length; $__13++) + params[$__13] = arguments[$__13]; + this.commandExecutor.execute.apply(this.commandExecutor, params); + }, + onContextMenu: function(event) { + var settings = this.hot.getSettings(); + var showRowHeaders = settings.rowHeaders; + var showColHeaders = settings.colHeaders; + function isValidElement(element) { + return element.nodeName === 'TD' || element.parentNode.nodeName === 'TD'; + } + var element = event.realTarget; + this.close(); + event.preventDefault(); + stopPropagation(event); + if (!(showRowHeaders || showColHeaders)) { + if (!isValidElement(element) && !(hasClass(element, 'current') && hasClass(element, 'wtBorder'))) { + return; + } + } else if (showRowHeaders && showColHeaders) { + var containsCornerHeader = element.parentNode.querySelectorAll('.cornerHeader').length > 0; + if (containsCornerHeader) { + return; + } + } + this.open(event); + }, + onMenuAfterOpen: function() { + this.hot.runHooks('afterContextMenuShow', this); + }, + onMenuAfterClose: function() { + this.hot.listen(); + this.hot.runHooks('afterContextMenuHide', this); + }, + destroy: function() { + this.close(); + if (this.menu) { + this.menu.destroy(); + } + $traceurRuntime.superGet(this, $ContextMenu.prototype, "destroy").call(this); + } +}, {get DEFAULT_ITEMS() { + return [ROW_ABOVE, ROW_BELOW, SEPARATOR, COLUMN_LEFT, COLUMN_RIGHT, SEPARATOR, REMOVE_ROW, REMOVE_COLUMN, SEPARATOR, UNDO, REDO, SEPARATOR, READ_ONLY, SEPARATOR, ALIGNMENT]; + }}, BasePlugin); +ContextMenu.SEPARATOR = {name: SEPARATOR}; +Handsontable.hooks.register('afterContextMenuDefaultOptions'); +Handsontable.hooks.register('afterContextMenuShow'); +Handsontable.hooks.register('afterContextMenuHide'); +Handsontable.hooks.register('afterContextMenuExecute'); +; +registerPlugin('contextMenu', ContextMenu); + +//# +},{"_base":58,"commandExecutor":65,"eventManager":41,"helpers/array":42,"helpers/dom/element":45,"helpers/dom/event":46,"helpers/object":50,"itemsFactory":68,"menu":69,"plugins":57,"predefinedItems":70}],67:[function(require,module,exports){ +"use strict"; +Object.defineProperties(exports, { + Cursor: {get: function() { + return Cursor; + }}, + __esModule: {value: true} +}); +var $___46__46__47__46__46__47_helpers_47_dom_47_element__, + $___46__46__47__46__46__47_helpers_47_dom_47_event__; +var $__0 = ($___46__46__47__46__46__47_helpers_47_dom_47_element__ = require("helpers/dom/element"), $___46__46__47__46__46__47_helpers_47_dom_47_element__ && $___46__46__47__46__46__47_helpers_47_dom_47_element__.__esModule && $___46__46__47__46__46__47_helpers_47_dom_47_element__ || {default: $___46__46__47__46__46__47_helpers_47_dom_47_element__}), + getWindowScrollLeft = $__0.getWindowScrollLeft, + getWindowScrollTop = $__0.getWindowScrollTop; +var $__1 = ($___46__46__47__46__46__47_helpers_47_dom_47_event__ = require("helpers/dom/event"), $___46__46__47__46__46__47_helpers_47_dom_47_event__ && $___46__46__47__46__46__47_helpers_47_dom_47_event__.__esModule && $___46__46__47__46__46__47_helpers_47_dom_47_event__ || {default: $___46__46__47__46__46__47_helpers_47_dom_47_event__}), + pageX = $__1.pageX, + pageY = $__1.pageY; +var Cursor = function Cursor(object) { + var windowScrollTop = getWindowScrollTop(); + var windowScrollLeft = getWindowScrollLeft(); + var top, + topRelative; + var left, + leftRelative; + var scrollTop, + scrollLeft; + var cellHeight, + cellWidth; + this.type = this.getSourceType(object); + if (this.type === 'literal') { + top = parseInt(object.top, 10); + left = parseInt(object.left, 10); + cellHeight = object.height; + cellWidth = object.width; + } else if (this.type === 'event') { + top = parseInt(pageY(object), 10); + left = parseInt(pageX(object), 10); + cellHeight = object.target.clientHeight; + cellWidth = object.target.clientWidth; + } + topRelative = top - windowScrollTop; + leftRelative = left - windowScrollLeft; + scrollTop = windowScrollTop; + scrollLeft = windowScrollLeft; + this.top = top; + this.topRelative = topRelative; + this.left = left; + this.leftRelative = leftRelative; + this.scrollTop = scrollTop; + this.scrollLeft = scrollLeft; + this.cellHeight = cellHeight; + this.cellWidth = cellWidth; +}; +($traceurRuntime.createClass)(Cursor, { + getSourceType: function(object) { + var type = 'literal'; + if (object instanceof Event) { + type = 'event'; + } + return type; + }, + fitsAbove: function(element) { + return this.topRelative >= element.offsetHeight; + }, + fitsBelow: function(element) { + var viewportHeight = arguments[1] !== (void 0) ? arguments[1] : window.innerHeight; + return this.topRelative + element.offsetHeight <= viewportHeight; + }, + fitsOnRight: function(element) { + var viewportWidth = arguments[1] !== (void 0) ? arguments[1] : window.innerWidth; + return this.leftRelative + this.cellWidth + element.offsetWidth <= viewportWidth; + }, + fitsOnLeft: function(element) { + return this.leftRelative >= element.offsetWidth; + } +}, {}); +; +Handsontable.plugins.utils = Handsontable.plugins.utils || {}; +Handsontable.plugins.utils.Cursor = Cursor; + +//# +},{"helpers/dom/element":45,"helpers/dom/event":46}],68:[function(require,module,exports){ +"use strict"; +Object.defineProperties(exports, { + ItemsFactory: {get: function() { + return ItemsFactory; + }}, + __esModule: {value: true} +}); +var $___46__46__47__46__46__47_helpers_47_object__, + $___46__46__47__46__46__47_helpers_47_array__, + $__predefinedItems__; +var $__0 = ($___46__46__47__46__46__47_helpers_47_object__ = require("helpers/object"), $___46__46__47__46__46__47_helpers_47_object__ && $___46__46__47__46__46__47_helpers_47_object__.__esModule && $___46__46__47__46__46__47_helpers_47_object__ || {default: $___46__46__47__46__46__47_helpers_47_object__}), + objectEach = $__0.objectEach, + isObject = $__0.isObject, + extend = $__0.extend; +var arrayEach = ($___46__46__47__46__46__47_helpers_47_array__ = require("helpers/array"), $___46__46__47__46__46__47_helpers_47_array__ && $___46__46__47__46__46__47_helpers_47_array__.__esModule && $___46__46__47__46__46__47_helpers_47_array__ || {default: $___46__46__47__46__46__47_helpers_47_array__}).arrayEach; +var $__2 = ($__predefinedItems__ = require("predefinedItems"), $__predefinedItems__ && $__predefinedItems__.__esModule && $__predefinedItems__ || {default: $__predefinedItems__}), + SEPARATOR = $__2.SEPARATOR, + ITEMS = $__2.ITEMS, + predefinedItems = $__2.predefinedItems; +var ItemsFactory = function ItemsFactory(hotInstance) { + var orderPattern = arguments[1] !== (void 0) ? arguments[1] : null; + this.hot = hotInstance; + this.predefinedItems = predefinedItems(); + this.defaultOrderPattern = orderPattern; +}; +($traceurRuntime.createClass)(ItemsFactory, { + setPredefinedItems: function(predefinedItems) { + var $__3 = this; + var items = {}; + this.defaultOrderPattern.length = 0; + objectEach(predefinedItems, (function(value, key) { + var menuItemKey = ''; + if (value.name === SEPARATOR) { + items[SEPARATOR] = value; + menuItemKey = SEPARATOR; + } else if (isNaN(parseInt(key, 10))) { + value.key = value.key === void 0 ? key : value.key; + items[key] = value; + menuItemKey = value.key; + } else { + items[value.key] = value; + menuItemKey = value.key; + } + $__3.defaultOrderPattern.push(menuItemKey); + })); + this.predefinedItems = items; + }, + getVisibleItems: function() { + var pattern = arguments[0] !== (void 0) ? arguments[0] : null; + var $__3 = this; + var visibleItems = {}; + objectEach(this.predefinedItems, (function(value, key) { + if (!value.hidden || value.hidden && !value.hidden.apply($__3.hot)) { + visibleItems[key] = value; + } + })); + return getItems(pattern, this.defaultOrderPattern, visibleItems); + }, + getItems: function() { + var pattern = arguments[0] !== (void 0) ? arguments[0] : null; + return getItems(pattern, this.defaultOrderPattern, this.predefinedItems); + } +}, {}); +function getItems() { + var pattern = arguments[0] !== (void 0) ? arguments[0] : null; + var defaultPattern = arguments[1] !== (void 0) ? arguments[1] : []; + var items = arguments[2] !== (void 0) ? arguments[2] : {}; + var result = []; + if (pattern && pattern.items) { + pattern = pattern.items; + } else if (!Array.isArray(pattern)) { + pattern = defaultPattern; + } + if (isObject(pattern)) { + objectEach(pattern, (function(value, key) { + var item = items[typeof value === 'string' ? value : key]; + if (!item) { + item = value; + } + if (isObject(value)) { + extend(item, value); + } else if (typeof item === 'string') { + item = {name: item}; + } + if (item.key === void 0) { + item.key = key; + } + result.push(item); + })); + } else { + arrayEach(pattern, (function(name, key) { + var item = items[name]; + if (!item && ITEMS.indexOf(name) >= 0) { + return; + } + if (!item) { + item = { + name: name, + key: key + '' + }; + } + if (isObject(name)) { + extend(item, name); + } + if (item.key === void 0) { + item.key = key; + } + result.push(item); + })); + } + if (result[0].name === SEPARATOR) { + result.shift(); + } + return result; +} +; + +//# +},{"helpers/array":42,"helpers/object":50,"predefinedItems":70}],69:[function(require,module,exports){ +"use strict"; +Object.defineProperties(exports, { + Menu: {get: function() { + return Menu; + }}, + __esModule: {value: true} +}); +var $___46__46__47__46__46__47_helpers_47_dom_47_element__, + $___46__46__47__46__46__47_helpers_47_array__, + $__cursor__, + $___46__46__47__46__46__47_eventManager__, + $___46__46__47__46__46__47_helpers_47_object__, + $__utils__, + $___46__46__47__46__46__47_helpers_47_unicode__, + $___46__46__47__46__46__47_mixins_47_localHooks__, + $__predefinedItems__, + $___46__46__47__46__46__47_helpers_47_dom_47_event__; +var $__0 = ($___46__46__47__46__46__47_helpers_47_dom_47_element__ = require("helpers/dom/element"), $___46__46__47__46__46__47_helpers_47_dom_47_element__ && $___46__46__47__46__46__47_helpers_47_dom_47_element__.__esModule && $___46__46__47__46__46__47_helpers_47_dom_47_element__ || {default: $___46__46__47__46__46__47_helpers_47_dom_47_element__}), + addClass = $__0.addClass, + empty = $__0.empty, + fastInnerHTML = $__0.fastInnerHTML, + getComputedStyle = $__0.getComputedStyle, + getScrollbarWidth = $__0.getScrollbarWidth, + getWindowScrollLeft = $__0.getWindowScrollLeft, + getWindowScrollTop = $__0.getWindowScrollTop, + hasClass = $__0.hasClass, + isChildOf = $__0.isChildOf, + removeClass = $__0.removeClass; +var arrayEach = ($___46__46__47__46__46__47_helpers_47_array__ = require("helpers/array"), $___46__46__47__46__46__47_helpers_47_array__ && $___46__46__47__46__46__47_helpers_47_array__.__esModule && $___46__46__47__46__46__47_helpers_47_array__ || {default: $___46__46__47__46__46__47_helpers_47_array__}).arrayEach; +var Cursor = ($__cursor__ = require("cursor"), $__cursor__ && $__cursor__.__esModule && $__cursor__ || {default: $__cursor__}).Cursor; +var EventManager = ($___46__46__47__46__46__47_eventManager__ = require("eventManager"), $___46__46__47__46__46__47_eventManager__ && $___46__46__47__46__46__47_eventManager__.__esModule && $___46__46__47__46__46__47_eventManager__ || {default: $___46__46__47__46__46__47_eventManager__}).EventManager; +var $__4 = ($___46__46__47__46__46__47_helpers_47_object__ = require("helpers/object"), $___46__46__47__46__46__47_helpers_47_object__ && $___46__46__47__46__46__47_helpers_47_object__.__esModule && $___46__46__47__46__46__47_helpers_47_object__ || {default: $___46__46__47__46__46__47_helpers_47_object__}), + extend = $__4.extend, + isObject = $__4.isObject, + objectEach = $__4.objectEach, + mixin = $__4.mixin; +var $__5 = ($__utils__ = require("utils"), $__utils__ && $__utils__.__esModule && $__utils__ || {default: $__utils__}), + isSeparator = $__5.isSeparator, + isDisabled = $__5.isDisabled, + isSelectionDisabled = $__5.isSelectionDisabled, + hasSubMenu = $__5.hasSubMenu, + normalizeSelection = $__5.normalizeSelection; +var KEY_CODES = ($___46__46__47__46__46__47_helpers_47_unicode__ = require("helpers/unicode"), $___46__46__47__46__46__47_helpers_47_unicode__ && $___46__46__47__46__46__47_helpers_47_unicode__.__esModule && $___46__46__47__46__46__47_helpers_47_unicode__ || {default: $___46__46__47__46__46__47_helpers_47_unicode__}).KEY_CODES; +var localHooks = ($___46__46__47__46__46__47_mixins_47_localHooks__ = require("mixins/localHooks"), $___46__46__47__46__46__47_mixins_47_localHooks__ && $___46__46__47__46__46__47_mixins_47_localHooks__.__esModule && $___46__46__47__46__46__47_mixins_47_localHooks__ || {default: $___46__46__47__46__46__47_mixins_47_localHooks__}).localHooks; +var $__8 = ($__predefinedItems__ = require("predefinedItems"), $__predefinedItems__ && $__predefinedItems__.__esModule && $__predefinedItems__ || {default: $__predefinedItems__}), + SEPARATOR = $__8.SEPARATOR, + predefinedItems = $__8.predefinedItems; +var $__9 = ($___46__46__47__46__46__47_helpers_47_dom_47_event__ = require("helpers/dom/event"), $___46__46__47__46__46__47_helpers_47_dom_47_event__ && $___46__46__47__46__46__47_helpers_47_dom_47_event__.__esModule && $___46__46__47__46__46__47_helpers_47_dom_47_event__ || {default: $___46__46__47__46__46__47_helpers_47_dom_47_event__}), + stopPropagation = $__9.stopPropagation, + stopImmediatePropagation = $__9.stopImmediatePropagation, + pageX = $__9.pageX, + pageY = $__9.pageY; +var Menu = function Menu(hotInstance) { + var options = arguments[1] !== (void 0) ? arguments[1] : { + parent: null, + name: null, + className: '', + keepInViewport: true + }; + this.hot = hotInstance; + this.options = options; + this.eventManager = new EventManager(this); + this.container = this.createContainer(this.options.name); + this.hotMenu = null; + this.hotSubMenus = {}; + this.parentMenu = this.options.parent || null; + this.menuItems = null; + this.origOutsideClickDeselects = null; + this._afterScrollCallback = null; + this.registerEvents(); +}; +var $Menu = Menu; +($traceurRuntime.createClass)(Menu, { + registerEvents: function() { + var $__10 = this; + this.eventManager.addEventListener(document.documentElement, 'mousedown', (function(event) { + return $__10.onDocumentMouseDown(event); + })); + }, + setMenuItems: function(menuItems) { + this.menuItems = menuItems; + }, + isSubMenu: function() { + return this.parentMenu !== null; + }, + open: function() { + var $__10 = this; + this.container.removeAttribute('style'); + this.container.style.display = 'block'; + var settings = { + data: this.menuItems, + colHeaders: false, + colWidths: [200], + autoRowSize: false, + readOnly: true, + copyPaste: false, + columns: [{ + data: 'name', + renderer: (function(hot, TD, row, col, prop, value) { + return $__10.menuItemRenderer(hot, TD, row, col, prop, value); + }) + }], + renderAllRows: true, + fragmentSelection: 'cell', + beforeKeyDown: (function(event) { + return $__10.onBeforeKeyDown(event); + }), + afterOnCellMouseOver: (function(event, coords, TD) { + return $__10.openSubMenu(coords.row); + }) + }; + this.origOutsideClickDeselects = this.hot.getSettings().outsideClickDeselects; + this.hot.getSettings().outsideClickDeselects = false; + this.hotMenu = new Handsontable.Core(this.container, settings); + this.hotMenu.addHook('afterInit', (function() { + return $__10.onAfterInit(); + })); + this.hotMenu.init(); + this.hotMenu.listen(); + this.blockMainTableCallbacks(); + this.runLocalHooks('afterOpen'); + }, + close: function() { + var closeParent = arguments[0] !== (void 0) ? arguments[0] : false; + if (!this.isOpened()) { + return; + } + if (closeParent && this.parentMenu) { + this.parentMenu.close(); + } else { + this.closeAllSubMenus(); + this.container.style.display = 'none'; + this.releaseMainTableCallbacks(); + this.hotMenu.destroy(); + this.hotMenu = null; + this.hot.getSettings().outsideClickDeselects = this.origOutsideClickDeselects; + this.runLocalHooks('afterClose'); + } + }, + openSubMenu: function(row) { + var cell = this.hotMenu.getCell(row, 0); + this.closeAllSubMenus(); + if (!cell || !hasSubMenu(cell)) { + return false; + } + var dataItem = this.hotMenu.getSourceDataAtRow(row); + var subMenu = new $Menu(this.hot, { + parent: this, + name: dataItem.name, + className: this.options.className + }); + subMenu.setMenuItems(dataItem.submenu.items); + subMenu.open(); + subMenu.setPosition(cell.getBoundingClientRect()); + this.hotSubMenus[dataItem.key] = subMenu; + return subMenu; + }, + closeSubMenu: function(row) { + var dataItem = this.hotMenu.getSourceDataAtRow(row); + var menus = this.hotSubMenus[dataItem.key]; + if (menus) { + menus.destroy(); + delete this.hotSubMenus[dataItem.key]; + } + }, + closeAllSubMenus: function() { + var $__10 = this; + arrayEach(this.hotMenu.getData(), (function(value, row) { + return $__10.closeSubMenu(row); + })); + }, + isAllSubMenusClosed: function() { + return Object.keys(this.hotSubMenus).length === 0; + }, + destroy: function() { + this.clearLocalHooks(); + this.close(); + this.parentMenu = null; + this.eventManager.destroy(); + }, + isOpened: function() { + return this.hotMenu !== null; + }, + executeCommand: function(event) { + if (!this.isOpened() || !this.hotMenu.getSelected()) { + return; + } + var selectedItem = this.hotMenu.getSourceDataAtRow(this.hotMenu.getSelected()[0]); + this.runLocalHooks('select', selectedItem, event); + if (selectedItem.isCommand === false) { + return; + } + var selRange = this.hot.getSelectedRange(); + var normalizedSelection = selRange ? normalizeSelection(selRange) : {}; + this.runLocalHooks('executeCommand', selectedItem.key, normalizedSelection, event); + if (this.isSubMenu()) { + this.parentMenu.runLocalHooks('executeCommand', selectedItem.key, normalizedSelection, event); + } + this.close(true); + }, + setPosition: function(coords) { + var cursor = new Cursor(coords); + if (this.options.keepInViewport) { + if (cursor.fitsBelow(this.container)) { + this.setPositionBelowCursor(cursor); + } else if (cursor.fitsAbove(this.container)) { + this.setPositionAboveCursor(cursor); + } else { + this.setPositionBelowCursor(cursor); + } + if (cursor.fitsOnRight(this.container)) { + this.setPositionOnRightOfCursor(cursor); + } else { + this.setPositionOnLeftOfCursor(cursor); + } + } else { + this.setPositionBelowCursor(cursor); + this.setPositionOnRightOfCursor(cursor); + } + }, + setPositionAboveCursor: function(cursor) { + var top = cursor.top - this.container.offsetHeight; + if (this.isSubMenu()) { + top = window.scrollY + cursor.top + cursor.cellHeight - this.container.offsetHeight + 3; + } + this.container.style.top = top + 'px'; + }, + setPositionBelowCursor: function(cursor) { + var top = cursor.top - 1; + if (this.isSubMenu()) { + top = cursor.top + window.scrollY - 1; + } + this.container.style.top = top + 'px'; + }, + setPositionOnRightOfCursor: function(cursor) { + var left; + if (this.isSubMenu()) { + left = window.scrollX + 1 + cursor.left + cursor.cellWidth; + } else { + left = 1 + cursor.left; + } + this.container.style.left = left + 'px'; + }, + setPositionOnLeftOfCursor: function(cursor) { + this.container.style.left = (cursor.left - this.container.offsetWidth + getScrollbarWidth() + 4) + 'px'; + }, + selectFirstCell: function() { + var cell = this.hotMenu.getCell(0, 0); + if (isSeparator(cell) || isDisabled(cell) || isSelectionDisabled(cell)) { + this.selectNextCell(0, 0); + } else { + this.hotMenu.selectCell(0, 0); + } + }, + selectLastCell: function() { + var lastRow = this.hotMenu.countRows() - 1; + var cell = this.hotMenu.getCell(lastRow, 0); + if (isSeparator(cell) || isDisabled(cell) || isSelectionDisabled(cell)) { + this.selectPrevCell(lastRow, 0); + } else { + this.hotMenu.selectCell(lastRow, 0); + } + }, + selectNextCell: function(row, col) { + var nextRow = row + 1; + var cell = nextRow < this.hotMenu.countRows() ? this.hotMenu.getCell(nextRow, col) : null; + if (!cell) { + return; + } + if (isSeparator(cell) || isDisabled(cell) || isSelectionDisabled(cell)) { + this.selectNextCell(nextRow, col); + } else { + this.hotMenu.selectCell(nextRow, col); + } + }, + selectPrevCell: function(row, col) { + var prevRow = row - 1; + var cell = prevRow >= 0 ? this.hotMenu.getCell(prevRow, col) : null; + if (!cell) { + return; + } + if (isSeparator(cell) || isDisabled(cell) || isSelectionDisabled(cell)) { + this.selectPrevCell(prevRow, col); + } else { + this.hotMenu.selectCell(prevRow, col); + } + }, + menuItemRenderer: function(hot, TD, row, col, prop, value) { + var $__10 = this; + var item = hot.getSourceDataAtRow(row); + var wrapper = document.createElement('div'); + var isSubMenu = (function(item) { + return item.hasOwnProperty('submenu'); + }); + var itemIsSeparator = (function(item) { + return new RegExp(SEPARATOR, 'i').test(item.name); + }); + var itemIsDisabled = (function(item) { + return item.disabled === true || (typeof item.disabled == 'function' && item.disabled.call($__10.hot) === true); + }); + var itemIsHidden = (function(item) { + return typeof item.hidden == 'function' && item.hidden.call($__10.hot) === true; + }); + var itemIsSelectionDisabled = (function(item) { + return item.disableSelection; + }); + var isHidden = itemIsHidden(item); + if (typeof value === 'function') { + value = value.call(this.hot); + } + empty(TD); + addClass(wrapper, 'htItemWrapper'); + TD.appendChild(wrapper); + if (itemIsSeparator(item)) { + addClass(TD, 'htSeparator'); + } else if (!isHidden && typeof item.renderer === 'function') { + addClass(TD, 'htCustomMenuRenderer'); + TD.appendChild(item.renderer(hot, wrapper, row, col, prop, value)); + } else { + fastInnerHTML(wrapper, value); + } + if (isHidden) { + if (TD.parentNode) { + addClass(TD.parentNode, 'htHidden'); + } + } else if (itemIsDisabled(item)) { + addClass(TD, 'htDisabled'); + this.eventManager.addEventListener(wrapper, 'mouseenter', (function() { + return hot.deselectCell(); + })); + } else if (itemIsSelectionDisabled(item)) { + addClass(TD, 'htSelectionDisabled'); + this.eventManager.addEventListener(wrapper, 'mouseenter', (function() { + return hot.deselectCell(); + })); + } else if (isSubMenu(item)) { + addClass(TD, 'htSubmenu'); + if (itemIsSelectionDisabled(item)) { + this.eventManager.addEventListener(wrapper, 'mouseenter', (function() { + return hot.deselectCell(); + })); + } else { + this.eventManager.addEventListener(wrapper, 'mouseenter', (function() { + return hot.selectCell(row, col, void 0, void 0, void 0, false); + })); + } + } else { + removeClass(TD, 'htSubmenu'); + removeClass(TD, 'htDisabled'); + if (itemIsSelectionDisabled(item)) { + this.eventManager.addEventListener(wrapper, 'mouseenter', (function() { + return hot.deselectCell(); + })); + } else { + this.eventManager.addEventListener(wrapper, 'mouseenter', (function() { + return hot.selectCell(row, col, void 0, void 0, void 0, false); + })); + } + } + }, + createContainer: function() { + var name = arguments[0] !== (void 0) ? arguments[0] : null; + if (name) { + name = name.replace(/ /g, '_'); + name = this.options.className + 'Sub_' + name; + } + var container; + if (name) { + container = document.querySelector('.' + this.options.className + '.' + name); + } else { + container = document.querySelector('.' + this.options.className); + } + if (!container) { + container = document.createElement('div'); + addClass(container, 'htMenu ' + this.options.className); + if (name) { + addClass(container, name); + } + document.getElementsByTagName('body')[0].appendChild(container); + } + return container; + }, + blockMainTableCallbacks: function() { + this._afterScrollCallback = function() {}; + this.hot.addHook('afterScrollVertically', this._afterScrollCallback); + this.hot.addHook('afterScrollHorizontally', this._afterScrollCallback); + }, + releaseMainTableCallbacks: function() { + if (this._afterScrollCallback) { + this.hot.removeHook('afterScrollVertically', this._afterScrollCallback); + this.hot.removeHook('afterScrollHorizontally', this._afterScrollCallback); + this._afterScrollCallback = null; + } + }, + onBeforeKeyDown: function(event) { + var selection = this.hotMenu.getSelected(); + var stopEvent = false; + switch (event.keyCode) { + case KEY_CODES.ESCAPE: + this.close(); + stopEvent = true; + break; + case KEY_CODES.ENTER: + if (selection) { + if (this.hotMenu.getSourceDataAtRow(selection[0]).submenu) { + stopEvent = true; + } else { + this.executeCommand(event); + this.close(true); + } + } + break; + case KEY_CODES.ARROW_DOWN: + if (selection) { + this.selectNextCell(selection[0], selection[1]); + } else { + this.selectFirstCell(); + } + stopEvent = true; + break; + case KEY_CODES.ARROW_UP: + if (selection) { + this.selectPrevCell(selection[0], selection[1]); + } else { + this.selectLastCell(); + } + stopEvent = true; + break; + case KEY_CODES.ARROW_RIGHT: + if (selection) { + var menu = this.openSubMenu(selection[0]); + if (menu) { + menu.selectFirstCell(); + } + } + stopEvent = true; + break; + case KEY_CODES.ARROW_LEFT: + if (selection && this.isSubMenu()) { + this.close(); + if (this.parentMenu) { + this.parentMenu.hotMenu.listen(); + } + stopEvent = true; + } + break; + } + if (stopEvent) { + event.preventDefault(); + stopImmediatePropagation(event); + } + }, + onAfterInit: function() { + var data = this.hotMenu.getSettings().data; + var hiderStyle = this.hotMenu.view.wt.wtTable.hider.style; + var holderStyle = this.hotMenu.view.wt.wtTable.holder.style; + var currentHiderWidth = parseInt(hiderStyle.width, 10); + var realHeight = 0; + arrayEach(data, (function(value) { + return realHeight += value.name === SEPARATOR ? 1 : 26; + })); + holderStyle.width = currentHiderWidth + 22 + 'px'; + holderStyle.height = realHeight + 4 + 'px'; + }, + onDocumentMouseDown: function(event) { + if (!this.isOpened()) { + return; + } + if (this.container && isChildOf(event.target, this.container)) { + this.executeCommand(event); + } + if ((this.isAllSubMenusClosed() || this.isSubMenu()) && (!isChildOf(event.target, '.htMenu') && isChildOf(event.target, document))) { + this.close(true); + } + } +}, {}); +mixin(Menu, localHooks); +; + +//# +},{"cursor":67,"eventManager":41,"helpers/array":42,"helpers/dom/element":45,"helpers/dom/event":46,"helpers/object":50,"helpers/unicode":53,"mixins/localHooks":54,"predefinedItems":70,"utils":71}],70:[function(require,module,exports){ +"use strict"; +var $__4; +Object.defineProperties(exports, { + ROW_ABOVE: {get: function() { + return ROW_ABOVE; + }}, + ROW_BELOW: {get: function() { + return ROW_BELOW; + }}, + COLUMN_LEFT: {get: function() { + return COLUMN_LEFT; + }}, + COLUMN_RIGHT: {get: function() { + return COLUMN_RIGHT; + }}, + CLEAR_COLUMN: {get: function() { + return CLEAR_COLUMN; + }}, + REMOVE_ROW: {get: function() { + return REMOVE_ROW; + }}, + REMOVE_COLUMN: {get: function() { + return REMOVE_COLUMN; + }}, + UNDO: {get: function() { + return UNDO; + }}, + REDO: {get: function() { + return REDO; + }}, + READ_ONLY: {get: function() { + return READ_ONLY; + }}, + ALIGNMENT: {get: function() { + return ALIGNMENT; + }}, + SEPARATOR: {get: function() { + return SEPARATOR; + }}, + ITEMS: {get: function() { + return ITEMS; + }}, + predefinedItems: {get: function() { + return predefinedItems; + }}, + addItem: {get: function() { + return addItem; + }}, + __esModule: {value: true} +}); +var $___46__46__47__46__46__47_helpers_47_object__, + $___46__46__47__46__46__47_helpers_47_number__, + $__utils__; +var $__0 = ($___46__46__47__46__46__47_helpers_47_object__ = require("helpers/object"), $___46__46__47__46__46__47_helpers_47_object__ && $___46__46__47__46__46__47_helpers_47_object__.__esModule && $___46__46__47__46__46__47_helpers_47_object__ || {default: $___46__46__47__46__46__47_helpers_47_object__}), + objectEach = $__0.objectEach, + clone = $__0.clone; +var rangeEach = ($___46__46__47__46__46__47_helpers_47_number__ = require("helpers/number"), $___46__46__47__46__46__47_helpers_47_number__ && $___46__46__47__46__46__47_helpers_47_number__.__esModule && $___46__46__47__46__46__47_helpers_47_number__ || {default: $___46__46__47__46__46__47_helpers_47_number__}).rangeEach; +var $__2 = ($__utils__ = require("utils"), $__utils__ && $__utils__.__esModule && $__utils__ || {default: $__utils__}), + align = $__2.align, + getAlignmentClasses = $__2.getAlignmentClasses, + getValidSelection = $__2.getValidSelection, + checkSelectionConsistency = $__2.checkSelectionConsistency, + markLabelAsSelected = $__2.markLabelAsSelected; +var ROW_ABOVE = 'row_above'; +var ROW_BELOW = 'row_below'; +var COLUMN_LEFT = 'col_left'; +var COLUMN_RIGHT = 'col_right'; +var CLEAR_COLUMN = 'clear_column'; +var REMOVE_ROW = 'remove_row'; +var REMOVE_COLUMN = 'remove_col'; +var UNDO = 'undo'; +var REDO = 'redo'; +var READ_ONLY = 'make_read_only'; +var ALIGNMENT = 'alignment'; +var SEPARATOR = '---------'; +var ITEMS = [ROW_ABOVE, ROW_BELOW, COLUMN_LEFT, COLUMN_RIGHT, CLEAR_COLUMN, REMOVE_ROW, REMOVE_COLUMN, UNDO, REDO, READ_ONLY, ALIGNMENT, SEPARATOR]; +function predefinedItems() { + var items = {}; + objectEach(_predefinedItems, (function(value, key) { + return items[key] = clone(value); + })); + return items; +} +function addItem(key, item) { + if (ITEMS.indexOf(key) === -1) { + _predefinedItems[key] = item; + } +} +var _predefinedItems = ($__4 = {}, Object.defineProperty($__4, SEPARATOR, { + value: {name: SEPARATOR}, + configurable: true, + enumerable: true, + writable: true +}), Object.defineProperty($__4, ROW_ABOVE, { + value: { + key: ROW_ABOVE, + name: 'Insert row above', + callback: function(key, selection) { + this.alter('insert_row', selection.start.row); + }, + disabled: function() { + var selected = getValidSelection(this); + if (!selected) { + return true; + } + var rowCount = this.countRows(); + var entireColumnSelection = [0, selected[1], rowCount - 1, selected[1]]; + return (entireColumnSelection.join(',') === selected.join(',')) && rowCount > 1; + }, + hidden: function() { + return !this.getSettings().allowInsertRow; + } + }, + configurable: true, + enumerable: true, + writable: true +}), Object.defineProperty($__4, ROW_BELOW, { + value: { + key: ROW_BELOW, + name: 'Insert row below', + callback: function(key, selection) { + this.alter('insert_row', selection.end.row + 1); + }, + disabled: function() { + var selected = getValidSelection(this); + if (!selected) { + return true; + } + var rowCount = this.countRows(); + var entireColumnSelection = [0, selected[1], rowCount - 1, selected[1]]; + return (entireColumnSelection.join(',') === selected.join(',')) && rowCount > 1; + }, + hidden: function() { + return !this.getSettings().allowInsertRow; + } + }, + configurable: true, + enumerable: true, + writable: true +}), Object.defineProperty($__4, COLUMN_LEFT, { + value: { + key: COLUMN_LEFT, + name: 'Insert column on the left', + callback: function(key, selection) { + this.alter('insert_col', selection.start.col); + }, + disabled: function() { + var selected = getValidSelection(this); + if (!selected) { + return true; + } + if (!this.isColumnModificationAllowed()) { + return true; + } + var entireRowSelection = [selected[0], 0, selected[0], this.countCols() - 1]; + var rowSelected = entireRowSelection.join(',') == selected.join(','); + return selected[1] < 0 || this.countCols() >= this.getSettings().maxCols || rowSelected; + }, + hidden: function() { + return !this.getSettings().allowInsertColumn; + } + }, + configurable: true, + enumerable: true, + writable: true +}), Object.defineProperty($__4, COLUMN_RIGHT, { + value: { + key: COLUMN_RIGHT, + name: 'Insert column on the right', + callback: function(key, selection) { + this.alter('insert_col', selection.end.col + 1); + }, + disabled: function() { + var selected = getValidSelection(this); + if (!selected) { + return true; + } + if (!this.isColumnModificationAllowed()) { + return true; + } + var entireRowSelection = [selected[0], 0, selected[0], this.countCols() - 1]; + var rowSelected = entireRowSelection.join(',') == selected.join(','); + return selected[1] < 0 || this.countCols() >= this.getSettings().maxCols || rowSelected; + }, + hidden: function() { + return !this.getSettings().allowInsertColumn; + } + }, + configurable: true, + enumerable: true, + writable: true +}), Object.defineProperty($__4, CLEAR_COLUMN, { + value: { + key: CLEAR_COLUMN, + name: 'Clear column', + callback: function(key, selection) { + var column = selection.start.col; + if (this.countRows()) { + this.populateFromArray(0, column, [[null]], Math.max(selection.start.row, selection.end.row), column); + } + }, + disabled: function() { + var selected = getValidSelection(this); + if (!selected) { + return true; + } + var entireRowSelection = [selected[0], 0, selected[0], this.countCols() - 1]; + var rowSelected = entireRowSelection.join(',') == selected.join(','); + return selected[1] < 0 || this.countCols() >= this.getSettings().maxCols || rowSelected; + } + }, + configurable: true, + enumerable: true, + writable: true +}), Object.defineProperty($__4, REMOVE_ROW, { + value: { + key: REMOVE_ROW, + name: 'Remove row', + callback: function(key, selection) { + var amount = selection.end.row - selection.start.row + 1; + this.alter('remove_row', selection.start.row, amount); + }, + disabled: function() { + var selected = getValidSelection(this); + if (!selected) { + return true; + } + var entireColumnSelection = [0, selected[1], this.countRows() - 1, selected[1]]; + return entireColumnSelection.join(',') === selected.join(','); + }, + hidden: function() { + return !this.getSettings().allowRemoveRow; + } + }, + configurable: true, + enumerable: true, + writable: true +}), Object.defineProperty($__4, REMOVE_COLUMN, { + value: { + key: REMOVE_COLUMN, + name: 'Remove column', + callback: function(key, selection) { + var amount = selection.end.col - selection.start.col + 1; + this.alter('remove_col', selection.start.col, amount); + }, + disabled: function() { + var selected = getValidSelection(this); + if (!selected) { + return true; + } + if (!this.isColumnModificationAllowed()) { + return true; + } + var entireRowSelection = [selected[0], 0, selected[0], this.countCols() - 1]; + var rowSelected = entireRowSelection.join(',') == selected.join(','); + return (selected[1] < 0 || rowSelected); + }, + hidden: function() { + return !this.getSettings().allowRemoveColumn; + } + }, + configurable: true, + enumerable: true, + writable: true +}), Object.defineProperty($__4, UNDO, { + value: { + key: UNDO, + name: 'Undo', + callback: function() { + this.undo(); + }, + disabled: function() { + return this.undoRedo && !this.undoRedo.isUndoAvailable(); + } + }, + configurable: true, + enumerable: true, + writable: true +}), Object.defineProperty($__4, REDO, { + value: { + key: REDO, + name: 'Redo', + callback: function() { + this.redo(); + }, + disabled: function() { + return this.undoRedo && !this.undoRedo.isRedoAvailable(); + } + }, + configurable: true, + enumerable: true, + writable: true +}), Object.defineProperty($__4, READ_ONLY, { + value: { + key: READ_ONLY, + name: function() { + var $__3 = this; + var label = 'Read only'; + var atLeastOneReadOnly = checkSelectionConsistency(this.getSelectedRange(), (function(row, col) { + return $__3.getCellMeta(row, col).readOnly; + })); + if (atLeastOneReadOnly) { + label = markLabelAsSelected(label); + } + return label; + }, + callback: function() { + var $__3 = this; + var range = this.getSelectedRange(); + var atLeastOneReadOnly = checkSelectionConsistency(range, (function(row, col) { + return $__3.getCellMeta(row, col).readOnly; + })); + range.forAll((function(row, col) { + $__3.getCellMeta(row, col).readOnly = atLeastOneReadOnly ? false : true; + })); + this.render(); + }, + disabled: function() { + return this.getSelectedRange() ? false : true; + } + }, + configurable: true, + enumerable: true, + writable: true +}), Object.defineProperty($__4, ALIGNMENT, { + value: { + key: ALIGNMENT, + name: 'Alignment', + disabled: function() { + return this.getSelectedRange() ? false : true; + }, + submenu: {items: [{ + key: (ALIGNMENT + ":left"), + name: function() { + var $__3 = this; + var label = 'Left'; + var hasClass = checkSelectionConsistency(this.getSelectedRange(), (function(row, col) { + var className = $__3.getCellMeta(row, col).className; + if (className && className.indexOf('htLeft') !== -1) { + return true; + } + })); + if (hasClass) { + label = markLabelAsSelected(label); + } + return label; + }, + callback: function() { + var $__3 = this; + var range = this.getSelectedRange(); + var stateBefore = getAlignmentClasses(range, (function(row, col) { + return $__3.getCellMeta(row, col).className; + })); + var type = 'horizontal'; + var alignment = 'htLeft'; + this.runHooks('beforeCellAlignment', stateBefore, range, type, alignment); + align(range, type, alignment, (function(row, col) { + return $__3.getCellMeta(row, col); + })); + this.render(); + }, + disabled: false + }, { + key: (ALIGNMENT + ":center"), + name: function() { + var $__3 = this; + var label = 'Center'; + var hasClass = checkSelectionConsistency(this.getSelectedRange(), (function(row, col) { + var className = $__3.getCellMeta(row, col).className; + if (className && className.indexOf('htCenter') !== -1) { + return true; + } + })); + if (hasClass) { + label = markLabelAsSelected(label); + } + return label; + }, + callback: function() { + var $__3 = this; + var range = this.getSelectedRange(); + var stateBefore = getAlignmentClasses(range, (function(row, col) { + return $__3.getCellMeta(row, col).className; + })); + var type = 'horizontal'; + var alignment = 'htCenter'; + this.runHooks('beforeCellAlignment', stateBefore, range, type, alignment); + align(range, type, alignment, (function(row, col) { + return $__3.getCellMeta(row, col); + })); + this.render(); + }, + disabled: false + }, { + key: (ALIGNMENT + ":right"), + name: function() { + var $__3 = this; + var label = 'Right'; + var hasClass = checkSelectionConsistency(this.getSelectedRange(), (function(row, col) { + var className = $__3.getCellMeta(row, col).className; + if (className && className.indexOf('htRight') !== -1) { + return true; + } + })); + if (hasClass) { + label = markLabelAsSelected(label); + } + return label; + }, + callback: function() { + var $__3 = this; + var range = this.getSelectedRange(); + var stateBefore = getAlignmentClasses(range, (function(row, col) { + return $__3.getCellMeta(row, col).className; + })); + var type = 'horizontal'; + var alignment = 'htRight'; + this.runHooks('beforeCellAlignment', stateBefore, range, type, alignment); + align(range, type, alignment, (function(row, col) { + return $__3.getCellMeta(row, col); + })); + this.render(); + }, + disabled: false + }, { + key: (ALIGNMENT + ":justify"), + name: function() { + var $__3 = this; + var label = 'Justify'; + var hasClass = checkSelectionConsistency(this.getSelectedRange(), (function(row, col) { + var className = $__3.getCellMeta(row, col).className; + if (className && className.indexOf('htJustify') !== -1) { + return true; + } + })); + if (hasClass) { + label = markLabelAsSelected(label); + } + return label; + }, + callback: function() { + var $__3 = this; + var range = this.getSelectedRange(); + var stateBefore = getAlignmentClasses(range, (function(row, col) { + return $__3.getCellMeta(row, col).className; + })); + var type = 'horizontal'; + var alignment = 'htJustify'; + this.runHooks('beforeCellAlignment', stateBefore, range, type, alignment); + align(range, type, alignment, (function(row, col) { + return $__3.getCellMeta(row, col); + })); + this.render(); + }, + disabled: false + }, {name: SEPARATOR}, { + key: (ALIGNMENT + ":top"), + name: function() { + var $__3 = this; + var label = 'Top'; + var hasClass = checkSelectionConsistency(this.getSelectedRange(), (function(row, col) { + var className = $__3.getCellMeta(row, col).className; + if (className && className.indexOf('htTop') !== -1) { + return true; + } + })); + if (hasClass) { + label = markLabelAsSelected(label); + } + return label; + }, + callback: function() { + var $__3 = this; + var range = this.getSelectedRange(); + var stateBefore = getAlignmentClasses(range, (function(row, col) { + return $__3.getCellMeta(row, col).className; + })); + var type = 'vertical'; + var alignment = 'htTop'; + this.runHooks('beforeCellAlignment', stateBefore, range, type, alignment); + align(range, type, alignment, (function(row, col) { + return $__3.getCellMeta(row, col); + })); + this.render(); + }, + disabled: false + }, { + key: (ALIGNMENT + ":middle"), + name: function() { + var $__3 = this; + var label = 'Middle'; + var hasClass = checkSelectionConsistency(this.getSelectedRange(), (function(row, col) { + var className = $__3.getCellMeta(row, col).className; + if (className && className.indexOf('htMiddle') !== -1) { + return true; + } + })); + if (hasClass) { + label = markLabelAsSelected(label); + } + return label; + }, + callback: function() { + var $__3 = this; + var range = this.getSelectedRange(); + var stateBefore = getAlignmentClasses(range, (function(row, col) { + return $__3.getCellMeta(row, col).className; + })); + var type = 'vertical'; + var alignment = 'htMiddle'; + this.runHooks('beforeCellAlignment', stateBefore, range, type, alignment); + align(range, type, alignment, (function(row, col) { + return $__3.getCellMeta(row, col); + })); + this.render(); + }, + disabled: false + }, { + key: (ALIGNMENT + ":bottom"), + name: function() { + var $__3 = this; + var label = 'Bottom'; + var hasClass = checkSelectionConsistency(this.getSelectedRange(), (function(row, col) { + var className = $__3.getCellMeta(row, col).className; + if (className && className.indexOf('htBottom') !== -1) { + return true; + } + })); + if (hasClass) { + label = markLabelAsSelected(label); + } + return label; + }, + callback: function() { + var $__3 = this; + var range = this.getSelectedRange(); + var stateBefore = getAlignmentClasses(range, (function(row, col) { + return $__3.getCellMeta(row, col).className; + })); + var type = 'vertical'; + var alignment = 'htBottom'; + this.runHooks('beforeCellAlignment', stateBefore, range, type, alignment); + align(range, type, alignment, (function(row, col) { + return $__3.getCellMeta(row, col); + })); + this.render(); + }, + disabled: false + }]} + }, + configurable: true, + enumerable: true, + writable: true +}), $__4); + +//# +},{"helpers/number":49,"helpers/object":50,"utils":71}],71:[function(require,module,exports){ +"use strict"; +Object.defineProperties(exports, { + normalizeSelection: {get: function() { + return normalizeSelection; + }}, + isSeparator: {get: function() { + return isSeparator; + }}, + hasSubMenu: {get: function() { + return hasSubMenu; + }}, + isDisabled: {get: function() { + return isDisabled; + }}, + isSelectionDisabled: {get: function() { + return isSelectionDisabled; + }}, + getValidSelection: {get: function() { + return getValidSelection; + }}, + prepareVerticalAlignClass: {get: function() { + return prepareVerticalAlignClass; + }}, + prepareHorizontalAlignClass: {get: function() { + return prepareHorizontalAlignClass; + }}, + getAlignmentClasses: {get: function() { + return getAlignmentClasses; + }}, + align: {get: function() { + return align; + }}, + checkSelectionConsistency: {get: function() { + return checkSelectionConsistency; + }}, + markLabelAsSelected: {get: function() { + return markLabelAsSelected; + }}, + __esModule: {value: true} +}); +var $___46__46__47__46__46__47_helpers_47_dom_47_element__; +var hasClass = ($___46__46__47__46__46__47_helpers_47_dom_47_element__ = require("helpers/dom/element"), $___46__46__47__46__46__47_helpers_47_dom_47_element__ && $___46__46__47__46__46__47_helpers_47_dom_47_element__.__esModule && $___46__46__47__46__46__47_helpers_47_dom_47_element__ || {default: $___46__46__47__46__46__47_helpers_47_dom_47_element__}).hasClass; +function normalizeSelection(selRange) { + return { + start: selRange.getTopLeftCorner(), + end: selRange.getBottomRightCorner() + }; +} +function isSeparator(cell) { + return hasClass(cell, 'htSeparator'); +} +function hasSubMenu(cell) { + return hasClass(cell, 'htSubmenu'); +} +function isDisabled(cell) { + return hasClass(cell, 'htDisabled'); +} +function isSelectionDisabled(cell) { + return hasClass(cell, 'htSelectionDisabled'); +} +function getValidSelection(hot) { + var selected = hot.getSelected(); + if (!selected) { + return null; + } + if (selected[0] < 0) { + return null; + } + if (hot.countRows() >= hot.getSettings().maxRows) { + return null; + } + return selected; +} +function prepareVerticalAlignClass(className, alignment) { + if (className.indexOf(alignment) != -1) { + return className; + } + className = className.replace('htTop', '').replace('htMiddle', '').replace('htBottom', '').replace(' ', ''); + className += ' ' + alignment; + return className; +} +function prepareHorizontalAlignClass(className, alignment) { + if (className.indexOf(alignment) != -1) { + return className; + } + className = className.replace('htLeft', '').replace('htCenter', '').replace('htRight', '').replace('htJustify', '').replace(' ', ''); + className += ' ' + alignment; + return className; +} +function getAlignmentClasses(range, callback) { + var classes = {}; + for (var row = range.from.row; row <= range.to.row; row++) { + for (var col = range.from.col; col <= range.to.col; col++) { + if (!classes[row]) { + classes[row] = []; + } + classes[row][col] = callback(row, col); + } + } + return classes; +} +function align(range, type, alignment, cellDescriptor) { + if (range.from.row == range.to.row && range.from.col == range.to.col) { + applyAlignClassName(range.from.row, range.from.col, type, alignment, cellDescriptor); + } else { + for (var row = range.from.row; row <= range.to.row; row++) { + for (var col = range.from.col; col <= range.to.col; col++) { + applyAlignClassName(row, col, type, alignment, cellDescriptor); + } + } + } +} +function applyAlignClassName(row, col, type, alignment, cellDescriptor) { + var cellMeta = cellDescriptor(row, col); + var className = alignment; + if (cellMeta.className) { + if (type === 'vertical') { + className = prepareVerticalAlignClass(cellMeta.className, alignment); + } else { + className = prepareHorizontalAlignClass(cellMeta.className, alignment); + } + } + cellMeta.className = className; +} +function checkSelectionConsistency(range, comparator) { + var result = false; + if (range) { + range.forAll(function(row, col) { + if (comparator(row, col)) { + result = true; + return false; + } + }); + } + return result; +} +function markLabelAsSelected(label) { + return '' + String.fromCharCode(10003) + '' + label; +} + +//# +},{"helpers/dom/element":45}],72:[function(require,module,exports){ +"use strict"; +Object.defineProperties(exports, { + ContextMenuCopyPaste: {get: function() { + return ContextMenuCopyPaste; + }}, + __esModule: {value: true} +}); +var $___46__46__47__46__46__47_helpers_47_dom_47_element__, + $___46__46__47__46__46__47_helpers_47_array__, + $___46__46__47__46__46__47_eventManager__, + $___46__46__47__46__46__47_plugins__, + $___46__46__47__95_base__, + $__zeroclipboard__; +var removeClass = ($___46__46__47__46__46__47_helpers_47_dom_47_element__ = require("helpers/dom/element"), $___46__46__47__46__46__47_helpers_47_dom_47_element__ && $___46__46__47__46__46__47_helpers_47_dom_47_element__.__esModule && $___46__46__47__46__46__47_helpers_47_dom_47_element__ || {default: $___46__46__47__46__46__47_helpers_47_dom_47_element__}).removeClass; +var arrayEach = ($___46__46__47__46__46__47_helpers_47_array__ = require("helpers/array"), $___46__46__47__46__46__47_helpers_47_array__ && $___46__46__47__46__46__47_helpers_47_array__.__esModule && $___46__46__47__46__46__47_helpers_47_array__ || {default: $___46__46__47__46__46__47_helpers_47_array__}).arrayEach; +var EventManager = ($___46__46__47__46__46__47_eventManager__ = require("eventManager"), $___46__46__47__46__46__47_eventManager__ && $___46__46__47__46__46__47_eventManager__.__esModule && $___46__46__47__46__46__47_eventManager__ || {default: $___46__46__47__46__46__47_eventManager__}).EventManager; +var registerPlugin = ($___46__46__47__46__46__47_plugins__ = require("plugins"), $___46__46__47__46__46__47_plugins__ && $___46__46__47__46__46__47_plugins__.__esModule && $___46__46__47__46__46__47_plugins__ || {default: $___46__46__47__46__46__47_plugins__}).registerPlugin; +var BasePlugin = ($___46__46__47__95_base__ = require("_base"), $___46__46__47__95_base__ && $___46__46__47__95_base__.__esModule && $___46__46__47__95_base__ || {default: $___46__46__47__95_base__}).default; +var ZeroClipboard = ($__zeroclipboard__ = require("zeroclipboard"), $__zeroclipboard__ && $__zeroclipboard__.__esModule && $__zeroclipboard__ || {default: $__zeroclipboard__}).default; +var ContextMenuCopyPaste = function ContextMenuCopyPaste(hotInstance) { + $traceurRuntime.superConstructor($ContextMenuCopyPaste).call(this, hotInstance); + this.eventManager = new EventManager(this); + this.swfPath = null; + this.outsideClickDeselectsCache = null; +}; +var $ContextMenuCopyPaste = ContextMenuCopyPaste; +($traceurRuntime.createClass)(ContextMenuCopyPaste, { + isEnabled: function() { + return this.hot.getSettings().contextMenuCopyPaste; + }, + enablePlugin: function() { + var $__6 = this; + if (this.enabled) { + return; + } + if (typeof this.hot.getSettings().contextMenuCopyPaste === 'object') { + this.swfPath = this.hot.getSettings().contextMenuCopyPaste.swfPath; + } + if (typeof ZeroClipboard === 'undefined') { + console.error('To be able to use the Copy/Paste feature from the context menu, you need to manually include ZeroClipboard.js file to your website.'); + } + try { + new ActiveXObject('ShockwaveFlash.ShockwaveFlash'); + } catch (exception) { + if (typeof navigator.mimeTypes['application/x-shockwave-flash'] == 'undefined') { + console.error('To be able to use the Copy/Paste feature from the context menu, your browser needs to have Flash Plugin installed.'); + } + } + if (this.swfPath) { + ZeroClipboard.config({swfPath: this.swfPath}); + } + this.hot.addHook('afterContextMenuShow', (function() { + return $__6.onAfterContextMenuShow(); + })); + this.hot.addHook('afterContextMenuDefaultOptions', (function(options) { + return $__6.onAfterContextMenuDefaultOptions(options); + })); + this.registerEvents(); + $traceurRuntime.superGet(this, $ContextMenuCopyPaste.prototype, "enablePlugin").call(this); + }, + disablePlugin: function() { + $traceurRuntime.superGet(this, $ContextMenuCopyPaste.prototype, "disablePlugin").call(this); + }, + registerEvents: function() { + var $__6 = this; + this.eventManager.addEventListener(document, 'mouseenter', (function() { + return $__6.removeCurrentClass(); + })); + this.eventManager.addEventListener(document, 'mouseleave', (function() { + return $__6.removeZeroClipboardClass(); + })); + }, + getCopyValue: function() { + this.hot.copyPaste.setCopyableText(); + return this.hot.copyPaste.copyPasteInstance.elTextarea.value; + }, + onAfterContextMenuDefaultOptions: function(defaultOptions) { + defaultOptions.items.unshift({ + key: 'copy', + name: 'Copy' + }, { + key: 'paste', + name: 'Paste', + callback: function() { + this.copyPaste.triggerPaste(); + } + }, Handsontable.plugins.ContextMenu.SEPARATOR); + }, + onAfterContextMenuShow: function() { + var $__6 = this; + var contextMenu = this.hot.getPlugin('contextMenu'); + var data = contextMenu.menu.hotMenu.getSourceData(); + arrayEach(data, (function(item, index) { + if (item.key === 'copy') { + var zeroClipboardInstance = new ZeroClipboard(contextMenu.menu.hotMenu.getCell(index, 0)); + zeroClipboardInstance.off(); + zeroClipboardInstance.on('copy', (function(event) { + var clipboard = event.clipboardData; + clipboard.setData('text/plain', $__6.getCopyValue()); + $__6.hot.getSettings().outsideClickDeselects = $__6.outsideClickDeselectsCache; + })); + return false; + } + })); + }, + removeCurrentClass: function() { + var contextMenu = this.hot.getPlugin('contextMenu'); + if (contextMenu.menu.isOpened()) { + var element = contextMenu.menu.hotMenu.rootElement.querySelector('td.current'); + if (element) { + removeClass(element, 'current'); + } + } + this.outsideClickDeselectsCache = this.hot.getSettings().outsideClickDeselects; + this.hot.getSettings().outsideClickDeselects = false; + }, + removeZeroClipboardClass: function() { + var contextMenu = this.hot.getPlugin('contextMenu'); + if (contextMenu.menu.isOpened()) { + var element = contextMenu.menu.hotMenu.rootElement.querySelector('td.zeroclipboard-is-hover'); + if (element) { + removeClass(element, 'zeroclipboard-is-hover'); + } + } + this.hot.getSettings().outsideClickDeselects = this.outsideClickDeselectsCache; + } +}, {}, BasePlugin); +; +registerPlugin('contextMenuCopyPaste', ContextMenuCopyPaste); + +//# +},{"_base":58,"eventManager":41,"helpers/array":42,"helpers/dom/element":45,"plugins":57,"zeroclipboard":"zeroclipboard"}],73:[function(require,module,exports){ +"use strict"; +Object.defineProperties(exports, { + CopyPastePlugin: {get: function() { + return CopyPastePlugin; + }}, + __esModule: {value: true} +}); +var $__copyPaste__, + $__SheetClip__, + $___46__46__47__46__46__47_helpers_47_unicode__, + $___46__46__47__46__46__47_helpers_47_array__, + $___46__46__47__46__46__47_helpers_47_number__, + $___46__46__47__46__46__47_helpers_47_dom_47_event__, + $___46__46__47__46__46__47_helpers_47_dom_47_element__, + $___46__46__47__46__46__47_helpers_47_function__, + $___46__46__47__46__46__47_plugins__, + $___46__46__47__46__46__47_3rdparty_47_walkontable_47_src_47_cell_47_coords__, + $___46__46__47__46__46__47_3rdparty_47_walkontable_47_src_47_cell_47_range__; +var copyPaste = ($__copyPaste__ = require("copyPaste"), $__copyPaste__ && $__copyPaste__.__esModule && $__copyPaste__ || {default: $__copyPaste__}).default; +var SheetClip = ($__SheetClip__ = require("SheetClip"), $__SheetClip__ && $__SheetClip__.__esModule && $__SheetClip__ || {default: $__SheetClip__}).default; +var $__2 = ($___46__46__47__46__46__47_helpers_47_unicode__ = require("helpers/unicode"), $___46__46__47__46__46__47_helpers_47_unicode__ && $___46__46__47__46__46__47_helpers_47_unicode__.__esModule && $___46__46__47__46__46__47_helpers_47_unicode__ || {default: $___46__46__47__46__46__47_helpers_47_unicode__}), + KEY_CODES = $__2.KEY_CODES, + isCtrlKey = $__2.isCtrlKey; +var arrayEach = ($___46__46__47__46__46__47_helpers_47_array__ = require("helpers/array"), $___46__46__47__46__46__47_helpers_47_array__ && $___46__46__47__46__46__47_helpers_47_array__.__esModule && $___46__46__47__46__46__47_helpers_47_array__ || {default: $___46__46__47__46__46__47_helpers_47_array__}).arrayEach; +var rangeEach = ($___46__46__47__46__46__47_helpers_47_number__ = require("helpers/number"), $___46__46__47__46__46__47_helpers_47_number__ && $___46__46__47__46__46__47_helpers_47_number__.__esModule && $___46__46__47__46__46__47_helpers_47_number__ || {default: $___46__46__47__46__46__47_helpers_47_number__}).rangeEach; +var $__5 = ($___46__46__47__46__46__47_helpers_47_dom_47_event__ = require("helpers/dom/event"), $___46__46__47__46__46__47_helpers_47_dom_47_event__ && $___46__46__47__46__46__47_helpers_47_dom_47_event__.__esModule && $___46__46__47__46__46__47_helpers_47_dom_47_event__ || {default: $___46__46__47__46__46__47_helpers_47_dom_47_event__}), + stopImmediatePropagation = $__5.stopImmediatePropagation, + isImmediatePropagationStopped = $__5.isImmediatePropagationStopped; +var getSelectionText = ($___46__46__47__46__46__47_helpers_47_dom_47_element__ = require("helpers/dom/element"), $___46__46__47__46__46__47_helpers_47_dom_47_element__ && $___46__46__47__46__46__47_helpers_47_dom_47_element__.__esModule && $___46__46__47__46__46__47_helpers_47_dom_47_element__ || {default: $___46__46__47__46__46__47_helpers_47_dom_47_element__}).getSelectionText; +var proxy = ($___46__46__47__46__46__47_helpers_47_function__ = require("helpers/function"), $___46__46__47__46__46__47_helpers_47_function__ && $___46__46__47__46__46__47_helpers_47_function__.__esModule && $___46__46__47__46__46__47_helpers_47_function__ || {default: $___46__46__47__46__46__47_helpers_47_function__}).proxy; +var registerPlugin = ($___46__46__47__46__46__47_plugins__ = require("plugins"), $___46__46__47__46__46__47_plugins__ && $___46__46__47__46__46__47_plugins__.__esModule && $___46__46__47__46__46__47_plugins__ || {default: $___46__46__47__46__46__47_plugins__}).registerPlugin; +var WalkontableCellCoords = ($___46__46__47__46__46__47_3rdparty_47_walkontable_47_src_47_cell_47_coords__ = require("3rdparty/walkontable/src/cell/coords"), $___46__46__47__46__46__47_3rdparty_47_walkontable_47_src_47_cell_47_coords__ && $___46__46__47__46__46__47_3rdparty_47_walkontable_47_src_47_cell_47_coords__.__esModule && $___46__46__47__46__46__47_3rdparty_47_walkontable_47_src_47_cell_47_coords__ || {default: $___46__46__47__46__46__47_3rdparty_47_walkontable_47_src_47_cell_47_coords__}).WalkontableCellCoords; +var WalkontableCellRange = ($___46__46__47__46__46__47_3rdparty_47_walkontable_47_src_47_cell_47_range__ = require("3rdparty/walkontable/src/cell/range"), $___46__46__47__46__46__47_3rdparty_47_walkontable_47_src_47_cell_47_range__ && $___46__46__47__46__46__47_3rdparty_47_walkontable_47_src_47_cell_47_range__.__esModule && $___46__46__47__46__46__47_3rdparty_47_walkontable_47_src_47_cell_47_range__ || {default: $___46__46__47__46__46__47_3rdparty_47_walkontable_47_src_47_cell_47_range__}).WalkontableCellRange; +function CopyPastePlugin(instance) { + var _this = this; + this.copyPasteInstance = copyPaste(); + this.copyPasteInstance.onCut(onCut); + this.copyPasteInstance.onPaste(onPaste); + this.onPaste = onPaste; + instance.addHook('beforeKeyDown', onBeforeKeyDown); + function onCut() { + if (!instance.isListening()) { + return; + } + instance.selection.empty(); + } + function onPaste(str) { + var input, + inputArray, + selected, + coordsFrom, + coordsTo, + cellRange, + topLeftCorner, + bottomRightCorner, + areaStart, + areaEnd; + if (!instance.isListening() || !instance.selection.isSelected()) { + return; + } + input = str; + inputArray = SheetClip.parse(input); + selected = instance.getSelected(); + coordsFrom = new WalkontableCellCoords(selected[0], selected[1]); + coordsTo = new WalkontableCellCoords(selected[2], selected[3]); + cellRange = new WalkontableCellRange(coordsFrom, coordsFrom, coordsTo); + topLeftCorner = cellRange.getTopLeftCorner(); + bottomRightCorner = cellRange.getBottomRightCorner(); + areaStart = topLeftCorner; + areaEnd = new WalkontableCellCoords(Math.max(bottomRightCorner.row, inputArray.length - 1 + topLeftCorner.row), Math.max(bottomRightCorner.col, inputArray[0].length - 1 + topLeftCorner.col)); + var isSelRowAreaCoverInputValue = coordsTo.row - coordsFrom.row >= inputArray.length - 1; + var isSelColAreaCoverInputValue = coordsTo.col - coordsFrom.col >= inputArray[0].length - 1; + instance.addHookOnce('afterChange', (function(changes, source) { + var changesLength = changes ? changes.length : 0; + if (changesLength) { + var offset = { + row: 0, + col: 0 + }; + var highestColumnIndex = -1; + arrayEach(changes, (function(change, index) { + var nextChange = changesLength > index + 1 ? changes[index + 1] : null; + if (nextChange) { + if (!isSelRowAreaCoverInputValue) { + offset.row = offset.row + Math.max(nextChange[0] - change[0] - 1, 0); + } + if (!isSelColAreaCoverInputValue && change[1] > highestColumnIndex) { + highestColumnIndex = change[1]; + offset.col = offset.col + Math.max(nextChange[1] - change[1] - 1, 0); + } + } + })); + instance.selectCell(areaStart.row, areaStart.col, areaEnd.row + offset.row, areaEnd.col + offset.col); + } + })); + instance.populateFromArray(areaStart.row, areaStart.col, inputArray, areaEnd.row, areaEnd.col, 'paste', instance.getSettings().pasteMode); + } + function onBeforeKeyDown(event) { + if (!instance.getSelected()) { + return; + } + if (instance.getActiveEditor() && instance.getActiveEditor().isOpened()) { + return; + } + if (isImmediatePropagationStopped(event)) { + return; + } + if (isCtrlKey(event.keyCode)) { + if (instance.getSettings().fragmentSelection && getSelectionText()) { + return; + } + _this.setCopyableText(); + stopImmediatePropagation(event); + return; + } + var ctrlDown = (event.ctrlKey || event.metaKey) && !event.altKey; + if (event.keyCode == KEY_CODES.A && ctrlDown) { + instance._registerTimeout(setTimeout(proxy(_this.setCopyableText, _this), 0)); + } + } + this.destroy = function() { + if (this.copyPasteInstance) { + this.copyPasteInstance.removeCallback(onCut); + this.copyPasteInstance.removeCallback(onPaste); + this.copyPasteInstance.destroy(); + this.copyPasteInstance = null; + } + instance.removeHook('beforeKeyDown', onBeforeKeyDown); + }; + instance.addHook('afterDestroy', proxy(this.destroy, this)); + this.triggerPaste = proxy(this.copyPasteInstance.triggerPaste, this.copyPasteInstance); + this.triggerCut = proxy(this.copyPasteInstance.triggerCut, this.copyPasteInstance); + this.setCopyableText = function() { + var settings = instance.getSettings(); + var copyRowsLimit = settings.copyRowsLimit; + var copyColsLimit = settings.copyColsLimit; + var selRange = instance.getSelectedRange(); + var topLeft = selRange.getTopLeftCorner(); + var bottomRight = selRange.getBottomRightCorner(); + var startRow = topLeft.row; + var startCol = topLeft.col; + var endRow = bottomRight.row; + var endCol = bottomRight.col; + var finalEndRow = Math.min(endRow, startRow + copyRowsLimit - 1); + var finalEndCol = Math.min(endCol, startCol + copyColsLimit - 1); + var copyableRanges = []; + copyableRanges.push({ + startRow: startRow, + startCol: startCol, + endRow: finalEndRow, + endCol: finalEndCol + }); + copyableRanges = Handsontable.hooks.run(instance, 'modifyCopyableRange', copyableRanges); + var copyableData = this.getRangedCopyableData(copyableRanges); + instance.copyPaste.copyPasteInstance.copyable(copyableData); + if (endRow !== finalEndRow || endCol !== finalEndCol) { + Handsontable.hooks.run(instance, 'afterCopyLimit', endRow - startRow + 1, endCol - startCol + 1, copyRowsLimit, copyColsLimit); + } + }; + this.getRangedCopyableData = function(ranges) { + var dataSet = []; + var copyableRows = []; + var copyableColumns = []; + arrayEach(ranges, (function(range) { + rangeEach(range.startRow, range.endRow, (function(row) { + if (copyableRows.indexOf(row) === -1) { + copyableRows.push(row); + } + })); + rangeEach(range.startCol, range.endCol, (function(column) { + if (copyableColumns.indexOf(column) === -1) { + copyableColumns.push(column); + } + })); + })); + arrayEach(copyableRows, (function(row) { + var rowSet = []; + arrayEach(copyableColumns, (function(column) { + rowSet.push(instance.getCopyableData(row, column)); + })); + dataSet.push(rowSet); + })); + return SheetClip.stringify(dataSet); + }; +} +function init() { + var instance = this, + pluginEnabled = instance.getSettings().copyPaste !== false; + if (pluginEnabled && !instance.copyPaste) { + instance.copyPaste = new CopyPastePlugin(instance); + } else if (!pluginEnabled && instance.copyPaste) { + instance.copyPaste.destroy(); + instance.copyPaste = null; + } +} +Handsontable.hooks.add('afterInit', init); +Handsontable.hooks.add('afterUpdateSettings', init); +Handsontable.hooks.register('afterCopyLimit'); +Handsontable.hooks.register('modifyCopyableRange'); +; + +//# +},{"3rdparty/walkontable/src/cell/coords":5,"3rdparty/walkontable/src/cell/range":6,"SheetClip":"SheetClip","copyPaste":"copyPaste","helpers/array":42,"helpers/dom/element":45,"helpers/dom/event":46,"helpers/function":47,"helpers/number":49,"helpers/unicode":53,"plugins":57}],74:[function(require,module,exports){ +"use strict"; +var $___46__46__47__46__46__47_plugins__, + $___46__46__47__46__46__47_3rdparty_47_walkontable_47_src_47_cell_47_range__, + $___46__46__47__46__46__47_3rdparty_47_walkontable_47_src_47_selection__; +var registerPlugin = ($___46__46__47__46__46__47_plugins__ = require("plugins"), $___46__46__47__46__46__47_plugins__ && $___46__46__47__46__46__47_plugins__.__esModule && $___46__46__47__46__46__47_plugins__ || {default: $___46__46__47__46__46__47_plugins__}).registerPlugin; +var WalkontableCellRange = ($___46__46__47__46__46__47_3rdparty_47_walkontable_47_src_47_cell_47_range__ = require("3rdparty/walkontable/src/cell/range"), $___46__46__47__46__46__47_3rdparty_47_walkontable_47_src_47_cell_47_range__ && $___46__46__47__46__46__47_3rdparty_47_walkontable_47_src_47_cell_47_range__.__esModule && $___46__46__47__46__46__47_3rdparty_47_walkontable_47_src_47_cell_47_range__ || {default: $___46__46__47__46__46__47_3rdparty_47_walkontable_47_src_47_cell_47_range__}).WalkontableCellRange; +var WalkontableSelection = ($___46__46__47__46__46__47_3rdparty_47_walkontable_47_src_47_selection__ = require("3rdparty/walkontable/src/selection"), $___46__46__47__46__46__47_3rdparty_47_walkontable_47_src_47_selection__ && $___46__46__47__46__46__47_3rdparty_47_walkontable_47_src_47_selection__.__esModule && $___46__46__47__46__46__47_3rdparty_47_walkontable_47_src_47_selection__ || {default: $___46__46__47__46__46__47_3rdparty_47_walkontable_47_src_47_selection__}).WalkontableSelection; +function CustomBorders() {} +var instance; +var checkEnable = function(customBorders) { + if (typeof customBorders === 'boolean') { + if (customBorders === true) { + return true; + } + } + if (typeof customBorders === 'object') { + if (customBorders.length > 0) { + return true; + } + } + return false; +}; +var init = function() { + if (checkEnable(this.getSettings().customBorders)) { + if (!this.customBorders) { + instance = this; + this.customBorders = new CustomBorders(); + } + } +}; +var getSettingIndex = function(className) { + for (var i = 0; i < instance.view.wt.selections.length; i++) { + if (instance.view.wt.selections[i].settings.className == className) { + return i; + } + } + return -1; +}; +var insertBorderIntoSettings = function(border) { + var coordinates = { + row: border.row, + col: border.col + }; + var selection = new WalkontableSelection(border, new WalkontableCellRange(coordinates, coordinates, coordinates)); + var index = getSettingIndex(border.className); + if (index >= 0) { + instance.view.wt.selections[index] = selection; + } else { + instance.view.wt.selections.push(selection); + } +}; +var prepareBorderFromCustomAdded = function(row, col, borderObj) { + var border = createEmptyBorders(row, col); + border = extendDefaultBorder(border, borderObj); + this.setCellMeta(row, col, 'borders', border); + insertBorderIntoSettings(border); +}; +var prepareBorderFromCustomAddedRange = function(rowObj) { + var range = rowObj.range; + for (var row = range.from.row; row <= range.to.row; row++) { + for (var col = range.from.col; col <= range.to.col; col++) { + var border = createEmptyBorders(row, col); + var add = 0; + if (row == range.from.row) { + add++; + if (rowObj.hasOwnProperty('top')) { + border.top = rowObj.top; + } + } + if (row == range.to.row) { + add++; + if (rowObj.hasOwnProperty('bottom')) { + border.bottom = rowObj.bottom; + } + } + if (col == range.from.col) { + add++; + if (rowObj.hasOwnProperty('left')) { + border.left = rowObj.left; + } + } + if (col == range.to.col) { + add++; + if (rowObj.hasOwnProperty('right')) { + border.right = rowObj.right; + } + } + if (add > 0) { + this.setCellMeta(row, col, 'borders', border); + insertBorderIntoSettings(border); + } + } + } +}; +var createClassName = function(row, col) { + return 'border_row' + row + 'col' + col; +}; +var createDefaultCustomBorder = function() { + return { + width: 1, + color: '#000' + }; +}; +var createSingleEmptyBorder = function() { + return {hide: true}; +}; +var createDefaultHtBorder = function() { + return { + width: 1, + color: '#000', + cornerVisible: false + }; +}; +var createEmptyBorders = function(row, col) { + return { + className: createClassName(row, col), + border: createDefaultHtBorder(), + row: row, + col: col, + top: createSingleEmptyBorder(), + right: createSingleEmptyBorder(), + bottom: createSingleEmptyBorder(), + left: createSingleEmptyBorder() + }; +}; +var extendDefaultBorder = function(defaultBorder, customBorder) { + if (customBorder.hasOwnProperty('border')) { + defaultBorder.border = customBorder.border; + } + if (customBorder.hasOwnProperty('top')) { + defaultBorder.top = customBorder.top; + } + if (customBorder.hasOwnProperty('right')) { + defaultBorder.right = customBorder.right; + } + if (customBorder.hasOwnProperty('bottom')) { + defaultBorder.bottom = customBorder.bottom; + } + if (customBorder.hasOwnProperty('left')) { + defaultBorder.left = customBorder.left; + } + return defaultBorder; +}; +var removeBordersFromDom = function(borderClassName) { + var borders = document.querySelectorAll('.' + borderClassName); + for (var i = 0; i < borders.length; i++) { + if (borders[i]) { + if (borders[i].nodeName != 'TD') { + var parent = borders[i].parentNode; + if (parent.parentNode) { + parent.parentNode.removeChild(parent); + } + } + } + } +}; +var removeAllBorders = function(row, col) { + var borderClassName = createClassName(row, col); + removeBordersFromDom(borderClassName); + this.removeCellMeta(row, col, 'borders'); +}; +var setBorder = function(row, col, place, remove) { + var bordersMeta = this.getCellMeta(row, col).borders; + if (!bordersMeta || bordersMeta.border == undefined) { + bordersMeta = createEmptyBorders(row, col); + } + if (remove) { + bordersMeta[place] = createSingleEmptyBorder(); + } else { + bordersMeta[place] = createDefaultCustomBorder(); + } + this.setCellMeta(row, col, 'borders', bordersMeta); + var borderClassName = createClassName(row, col); + removeBordersFromDom(borderClassName); + insertBorderIntoSettings(bordersMeta); + this.render(); +}; +var prepareBorder = function(range, place, remove) { + if (range.from.row == range.to.row && range.from.col == range.to.col) { + if (place == 'noBorders') { + removeAllBorders.call(this, range.from.row, range.from.col); + } else { + setBorder.call(this, range.from.row, range.from.col, place, remove); + } + } else { + switch (place) { + case 'noBorders': + for (var column = range.from.col; column <= range.to.col; column++) { + for (var row = range.from.row; row <= range.to.row; row++) { + removeAllBorders.call(this, row, column); + } + } + break; + case 'top': + for (var topCol = range.from.col; topCol <= range.to.col; topCol++) { + setBorder.call(this, range.from.row, topCol, place, remove); + } + break; + case 'right': + for (var rowRight = range.from.row; rowRight <= range.to.row; rowRight++) { + setBorder.call(this, rowRight, range.to.col, place); + } + break; + case 'bottom': + for (var bottomCol = range.from.col; bottomCol <= range.to.col; bottomCol++) { + setBorder.call(this, range.to.row, bottomCol, place); + } + break; + case 'left': + for (var rowLeft = range.from.row; rowLeft <= range.to.row; rowLeft++) { + setBorder.call(this, rowLeft, range.from.col, place); + } + break; + } + } +}; +var checkSelectionBorders = function(hot, direction) { + var atLeastOneHasBorder = false; + hot.getSelectedRange().forAll(function(r, c) { + var metaBorders = hot.getCellMeta(r, c).borders; + if (metaBorders) { + if (direction) { + if (!metaBorders[direction].hasOwnProperty('hide')) { + atLeastOneHasBorder = true; + return false; + } + } else { + atLeastOneHasBorder = true; + return false; + } + } + }); + return atLeastOneHasBorder; +}; +var markSelected = function(label) { + return '' + String.fromCharCode(10003) + '' + label; +}; +var addBordersOptionsToContextMenu = function(defaultOptions) { + if (!this.getSettings().customBorders) { + return; + } + defaultOptions.items.push(Handsontable.plugins.ContextMenu.SEPARATOR); + defaultOptions.items.push({ + key: 'borders', + name: 'Borders', + submenu: {items: [{ + key: 'borders:top', + name: function() { + var label = 'Top'; + var hasBorder = checkSelectionBorders(this, 'top'); + if (hasBorder) { + label = markSelected(label); + } + return label; + }, + callback: function() { + var hasBorder = checkSelectionBorders(this, 'top'); + prepareBorder.call(this, this.getSelectedRange(), 'top', hasBorder); + }, + disabled: false + }, { + key: 'borders:right', + name: function() { + var label = 'Right'; + var hasBorder = checkSelectionBorders(this, 'right'); + if (hasBorder) { + label = markSelected(label); + } + return label; + }, + callback: function() { + var hasBorder = checkSelectionBorders(this, 'right'); + prepareBorder.call(this, this.getSelectedRange(), 'right', hasBorder); + }, + disabled: false + }, { + key: 'borders:bottom', + name: function() { + var label = 'Bottom'; + var hasBorder = checkSelectionBorders(this, 'bottom'); + if (hasBorder) { + label = markSelected(label); + } + return label; + }, + callback: function() { + var hasBorder = checkSelectionBorders(this, 'bottom'); + prepareBorder.call(this, this.getSelectedRange(), 'bottom', hasBorder); + }, + disabled: false + }, { + key: 'borders:left', + name: function() { + var label = 'Left'; + var hasBorder = checkSelectionBorders(this, 'left'); + if (hasBorder) { + label = markSelected(label); + } + return label; + }, + callback: function() { + var hasBorder = checkSelectionBorders(this, 'left'); + prepareBorder.call(this, this.getSelectedRange(), 'left', hasBorder); + }, + disabled: false + }, { + key: 'borders:no_borders', + name: 'Remove border(s)', + callback: function() { + prepareBorder.call(this, this.getSelectedRange(), 'noBorders'); + }, + disabled: function() { + return !checkSelectionBorders(this); + } + }]} + }); +}; +Handsontable.hooks.add('beforeInit', init); +Handsontable.hooks.add('afterContextMenuDefaultOptions', addBordersOptionsToContextMenu); +Handsontable.hooks.add('afterInit', function() { + var customBorders = this.getSettings().customBorders; + if (customBorders) { + for (var i = 0; i < customBorders.length; i++) { + if (customBorders[i].range) { + prepareBorderFromCustomAddedRange.call(this, customBorders[i]); + } else { + prepareBorderFromCustomAdded.call(this, customBorders[i].row, customBorders[i].col, customBorders[i]); + } + } + this.render(); + this.view.wt.draw(true); + } +}); +Handsontable.CustomBorders = CustomBorders; + +//# +},{"3rdparty/walkontable/src/cell/range":6,"3rdparty/walkontable/src/selection":18,"plugins":57}],75:[function(require,module,exports){ +"use strict"; +Object.defineProperties(exports, { + DragToScroll: {get: function() { + return DragToScroll; + }}, + __esModule: {value: true} +}); +var $___46__46__47__46__46__47_eventManager__, + $___46__46__47__46__46__47_plugins__; +var eventManagerObject = ($___46__46__47__46__46__47_eventManager__ = require("eventManager"), $___46__46__47__46__46__47_eventManager__ && $___46__46__47__46__46__47_eventManager__.__esModule && $___46__46__47__46__46__47_eventManager__ || {default: $___46__46__47__46__46__47_eventManager__}).eventManager; +var registerPlugin = ($___46__46__47__46__46__47_plugins__ = require("plugins"), $___46__46__47__46__46__47_plugins__ && $___46__46__47__46__46__47_plugins__.__esModule && $___46__46__47__46__46__47_plugins__ || {default: $___46__46__47__46__46__47_plugins__}).registerPlugin; +; +Handsontable.plugins.DragToScroll = DragToScroll; +function DragToScroll() { + this.boundaries = null; + this.callback = null; +} +DragToScroll.prototype.setBoundaries = function(boundaries) { + this.boundaries = boundaries; +}; +DragToScroll.prototype.setCallback = function(callback) { + this.callback = callback; +}; +DragToScroll.prototype.check = function(x, y) { + var diffX = 0; + var diffY = 0; + if (y < this.boundaries.top) { + diffY = y - this.boundaries.top; + } else if (y > this.boundaries.bottom) { + diffY = y - this.boundaries.bottom; + } + if (x < this.boundaries.left) { + diffX = x - this.boundaries.left; + } else if (x > this.boundaries.right) { + diffX = x - this.boundaries.right; + } + this.callback(diffX, diffY); +}; +var dragToScroll; +var instance; +var setupListening = function(instance) { + instance.dragToScrollListening = false; + var scrollHandler = instance.view.wt.wtTable.holder; + dragToScroll = new DragToScroll(); + if (scrollHandler === window) { + return; + } else { + dragToScroll.setBoundaries(scrollHandler.getBoundingClientRect()); + } + dragToScroll.setCallback(function(scrollX, scrollY) { + if (scrollX < 0) { + scrollHandler.scrollLeft -= 50; + } else if (scrollX > 0) { + scrollHandler.scrollLeft += 50; + } + if (scrollY < 0) { + scrollHandler.scrollTop -= 20; + } else if (scrollY > 0) { + scrollHandler.scrollTop += 20; + } + }); + instance.dragToScrollListening = true; +}; +Handsontable.hooks.add('afterInit', function() { + var instance = this; + var eventManager = eventManagerObject(this); + eventManager.addEventListener(document, 'mouseup', function() { + instance.dragToScrollListening = false; + }); + eventManager.addEventListener(document, 'mousemove', function(event) { + if (instance.dragToScrollListening) { + dragToScroll.check(event.clientX, event.clientY); + } + }); +}); +Handsontable.hooks.add('afterDestroy', function() { + eventManagerObject(this).clear(); +}); +Handsontable.hooks.add('afterOnCellMouseDown', function() { + setupListening(this); +}); +Handsontable.hooks.add('afterOnCellCornerMouseDown', function() { + setupListening(this); +}); +Handsontable.plugins.DragToScroll = DragToScroll; + +//# +},{"eventManager":41,"plugins":57}],76:[function(require,module,exports){ +"use strict"; +Object.defineProperties(exports, { + ManualColumnFreeze: {get: function() { + return ManualColumnFreeze; + }}, + __esModule: {value: true} +}); +var $___46__46__47__95_base__, + $___46__46__47__46__46__47_plugins__; +var BasePlugin = ($___46__46__47__95_base__ = require("_base"), $___46__46__47__95_base__ && $___46__46__47__95_base__.__esModule && $___46__46__47__95_base__ || {default: $___46__46__47__95_base__}).default; +var registerPlugin = ($___46__46__47__46__46__47_plugins__ = require("plugins"), $___46__46__47__46__46__47_plugins__ && $___46__46__47__46__46__47_plugins__.__esModule && $___46__46__47__46__46__47_plugins__ || {default: $___46__46__47__46__46__47_plugins__}).registerPlugin; +var ManualColumnFreeze = function ManualColumnFreeze(hotInstance) { + $traceurRuntime.superConstructor($ManualColumnFreeze).call(this, hotInstance); +}; +var $ManualColumnFreeze = ManualColumnFreeze; +($traceurRuntime.createClass)(ManualColumnFreeze, { + isEnabled: function() { + return !!this.hot.getSettings().manualColumnFreeze; + }, + enablePlugin: function() { + var $__2 = this; + if (this.enabled) { + return; + } + this.addHook('modifyCol', (function(col) { + return $__2.onModifyCol(col); + })); + this.addHook('afterContextMenuDefaultOptions', (function(defaultOptions) { + return $__2.addContextMenuEntry(defaultOptions); + })); + $traceurRuntime.superGet(this, $ManualColumnFreeze.prototype, "enablePlugin").call(this); + }, + disablePlugin: function() { + $traceurRuntime.superGet(this, $ManualColumnFreeze.prototype, "disablePlugin").call(this); + }, + init: function() { + $traceurRuntime.superGet(this, $ManualColumnFreeze.prototype, "init").call(this); + if (typeof this.hot.manualColumnPositionsPluginUsages === 'undefined') { + this.hot.manualColumnPositionsPluginUsages = ['manualColumnFreeze']; + } else { + this.hot.manualColumnPositionsPluginUsages.push('manualColumnFreeze'); + } + this.fixedColumnsCount = this.hot.getSettings().fixedColumnsLeft; + }, + onModifyCol: function(column) { + if (this.hot.manualColumnPositionsPluginUsages.length > 1) { + return column; + } + return this.getModifiedColumnIndex(column); + }, + getModifiedColumnIndex: function(column) { + return this.hot.manualColumnPositions[column]; + }, + addContextMenuEntry: function(defaultOptions) { + var _this = this; + defaultOptions.items.push(Handsontable.plugins.ContextMenu.SEPARATOR, { + key: 'freeze_column', + name: function() { + var selectedColumn = _this.hot.getSelected()[1]; + if (selectedColumn > _this.fixedColumnsCount - 1) { + return 'Freeze this column'; + } else { + return 'Unfreeze this column'; + } + }, + disabled: function() { + var selection = _this.hot.getSelected(); + return selection[1] !== selection[3]; + }, + callback: function() { + var selectedColumn = _this.hot.getSelected()[1]; + if (selectedColumn > _this.fixedColumnsCount - 1) { + _this.freezeColumn(selectedColumn); + } else { + _this.unfreezeColumn(selectedColumn); + } + } + }); + }, + freezeColumn: function(column) { + if (column <= this.fixedColumnsCount - 1) { + return; + } + var modifiedColumn = this.getModifiedColumnIndex(column) || column; + this.checkPositionData(modifiedColumn); + this.modifyColumnOrder(modifiedColumn, column, null, 'freeze'); + this.addFixedColumn(); + this.hot.view.wt.wtOverlays.leftOverlay.refresh(); + this.hot.view.wt.wtOverlays.adjustElementsSize(); + }, + unfreezeColumn: function(column) { + if (column > this.fixedColumnsCount - 1) { + return; + } + var returnCol = this.getBestColumnReturnPosition(column); + var modifiedColumn = this.getModifiedColumnIndex(column) || column; + this.checkPositionData(modifiedColumn); + this.modifyColumnOrder(modifiedColumn, column, returnCol, 'unfreeze'); + this.removeFixedColumn(); + this.hot.view.wt.wtOverlays.leftOverlay.refresh(); + this.hot.view.wt.wtOverlays.adjustElementsSize(); + }, + addFixedColumn: function() { + this.hot.updateSettings({fixedColumnsLeft: this.fixedColumnsCount + 1}); + this.fixedColumnsCount++; + }, + removeFixedColumn: function() { + this.hot.updateSettings({fixedColumnsLeft: this.fixedColumnsCount - 1}); + this.fixedColumnsCount--; + }, + checkPositionData: function(column) { + if (!this.hot.manualColumnPositions || this.hot.manualColumnPositions.length === 0) { + if (!this.hot.manualColumnPositions) { + this.hot.manualColumnPositions = []; + } + } + if (column) { + if (!this.hot.manualColumnPositions[column]) { + this.createPositionData(column + 1); + } + } else { + this.createPositionData(this.hot.countCols()); + } + }, + createPositionData: function(length) { + if (this.hot.manualColumnPositions.length < length) { + for (var i = this.hot.manualColumnPositions.length; i < length; i++) { + this.hot.manualColumnPositions[i] = i; + } + } + }, + modifyColumnOrder: function(column, actualColumn, returnColumn, action) { + if (returnColumn == null) { + returnColumn = column; + } + if (action === 'freeze') { + this.hot.manualColumnPositions.splice(this.fixedColumnsCount, 0, this.hot.manualColumnPositions.splice(actualColumn, 1)[0]); + } else if (action === 'unfreeze') { + this.hot.manualColumnPositions.splice(returnColumn, 0, this.hot.manualColumnPositions.splice(actualColumn, 1)[0]); + } + }, + getBestColumnReturnPosition: function(column) { + var i = this.fixedColumnsCount; + var j = this.getModifiedColumnIndex(i); + var initialCol = this.getModifiedColumnIndex(column); + while (j < initialCol) { + i++; + j = this.getModifiedColumnIndex(i); + } + return i - 1; + } +}, {}, BasePlugin); +; +registerPlugin('manualColumnFreeze', ManualColumnFreeze); + +//# +},{"_base":58,"plugins":57}],77:[function(require,module,exports){ +"use strict"; +Object.defineProperties(exports, { + ManualColumnMove: {get: function() { + return ManualColumnMove; + }}, + __esModule: {value: true} +}); +var $___46__46__47__46__46__47_helpers_47_dom_47_element__, + $___46__46__47__46__46__47_eventManager__, + $___46__46__47__46__46__47_helpers_47_dom_47_event__, + $___46__46__47__46__46__47_plugins__; +var $__0 = ($___46__46__47__46__46__47_helpers_47_dom_47_element__ = require("helpers/dom/element"), $___46__46__47__46__46__47_helpers_47_dom_47_element__ && $___46__46__47__46__46__47_helpers_47_dom_47_element__.__esModule && $___46__46__47__46__46__47_helpers_47_dom_47_element__ || {default: $___46__46__47__46__46__47_helpers_47_dom_47_element__}), + addClass = $__0.addClass, + hasClass = $__0.hasClass, + removeClass = $__0.removeClass; +var eventManagerObject = ($___46__46__47__46__46__47_eventManager__ = require("eventManager"), $___46__46__47__46__46__47_eventManager__ && $___46__46__47__46__46__47_eventManager__.__esModule && $___46__46__47__46__46__47_eventManager__ || {default: $___46__46__47__46__46__47_eventManager__}).eventManager; +var $__2 = ($___46__46__47__46__46__47_helpers_47_dom_47_event__ = require("helpers/dom/event"), $___46__46__47__46__46__47_helpers_47_dom_47_event__ && $___46__46__47__46__46__47_helpers_47_dom_47_event__.__esModule && $___46__46__47__46__46__47_helpers_47_dom_47_event__ || {default: $___46__46__47__46__46__47_helpers_47_dom_47_event__}), + pageX = $__2.pageX, + pageY = $__2.pageY; +var registerPlugin = ($___46__46__47__46__46__47_plugins__ = require("plugins"), $___46__46__47__46__46__47_plugins__ && $___46__46__47__46__46__47_plugins__.__esModule && $___46__46__47__46__46__47_plugins__ || {default: $___46__46__47__46__46__47_plugins__}).registerPlugin; +; +function ManualColumnMove() { + var startCol, + endCol, + startX, + startOffset, + currentCol, + instance, + currentTH, + handle = document.createElement('DIV'), + guide = document.createElement('DIV'), + eventManager = eventManagerObject(this); + handle.className = 'manualColumnMover'; + guide.className = 'manualColumnMoverGuide'; + var saveManualColumnPositions = function() { + var instance = this; + Handsontable.hooks.run(instance, 'persistentStateSave', 'manualColumnPositions', instance.manualColumnPositions); + }; + var loadManualColumnPositions = function() { + var instance = this; + var storedState = {}; + Handsontable.hooks.run(instance, 'persistentStateLoad', 'manualColumnPositions', storedState); + return storedState.value; + }; + function setupHandlePosition(TH) { + instance = this; + currentTH = TH; + var col = this.view.wt.wtTable.getCoords(TH).col; + if (col >= 0) { + currentCol = col; + var box = currentTH.getBoundingClientRect(); + startOffset = box.left; + handle.style.top = box.top + 'px'; + handle.style.left = startOffset + 'px'; + instance.rootElement.appendChild(handle); + } + } + function refreshHandlePosition(TH, delta) { + var box = TH.getBoundingClientRect(); + var handleWidth = 6; + if (delta > 0) { + handle.style.left = (box.left + box.width - handleWidth) + 'px'; + } else { + handle.style.left = box.left + 'px'; + } + } + function setupGuidePosition() { + var instance = this; + addClass(handle, 'active'); + addClass(guide, 'active'); + var box = currentTH.getBoundingClientRect(); + guide.style.width = box.width + 'px'; + guide.style.height = instance.view.maximumVisibleElementHeight(0) + 'px'; + guide.style.top = handle.style.top; + guide.style.left = startOffset + 'px'; + instance.rootElement.appendChild(guide); + } + function refreshGuidePosition(diff) { + guide.style.left = startOffset + diff + 'px'; + } + function hideHandleAndGuide() { + removeClass(handle, 'active'); + removeClass(guide, 'active'); + } + var checkColumnHeader = function(element) { + if (element.tagName != 'BODY') { + if (element.parentNode.tagName == 'THEAD') { + return true; + } else { + element = element.parentNode; + return checkColumnHeader(element); + } + } + return false; + }; + var getTHFromTargetElement = function(element) { + if (element.tagName != 'TABLE') { + if (element.tagName == 'TH') { + return element; + } else { + return getTHFromTargetElement(element.parentNode); + } + } + return null; + }; + var bindEvents = function() { + var instance = this; + var pressed; + eventManager.addEventListener(instance.rootElement, 'mouseover', function(e) { + if (checkColumnHeader(e.target)) { + var th = getTHFromTargetElement(e.target); + if (th) { + if (pressed) { + var col = instance.view.wt.wtTable.getCoords(th).col; + if (col >= 0) { + endCol = col; + refreshHandlePosition(e.target, endCol - startCol); + } + } else { + setupHandlePosition.call(instance, th); + } + } + } + }); + eventManager.addEventListener(instance.rootElement, 'mousedown', function(e) { + if (hasClass(e.target, 'manualColumnMover')) { + startX = pageX(e); + setupGuidePosition.call(instance); + pressed = instance; + startCol = currentCol; + endCol = currentCol; + } + }); + eventManager.addEventListener(window, 'mousemove', function(e) { + if (pressed) { + refreshGuidePosition(pageX(e) - startX); + } + }); + eventManager.addEventListener(window, 'mouseup', function(e) { + if (pressed) { + hideHandleAndGuide(); + pressed = false; + createPositionData(instance.manualColumnPositions, instance.countCols()); + instance.manualColumnPositions.splice(endCol, 0, instance.manualColumnPositions.splice(startCol, 1)[0]); + Handsontable.hooks.run(instance, 'beforeColumnMove', startCol, endCol); + instance.forceFullRender = true; + instance.view.render(); + saveManualColumnPositions.call(instance); + Handsontable.hooks.run(instance, 'afterColumnMove', startCol, endCol); + setupHandlePosition.call(instance, currentTH); + } + }); + instance.addHook('afterDestroy', unbindEvents); + }; + var unbindEvents = function() { + eventManager.clear(); + }; + var createPositionData = function(positionArr, len) { + if (positionArr.length < len) { + for (var i = positionArr.length; i < len; i++) { + positionArr[i] = i; + } + } + }; + this.beforeInit = function() { + this.manualColumnPositions = []; + }; + this.init = function(source) { + var instance = this; + var manualColMoveEnabled = !!(this.getSettings().manualColumnMove); + if (manualColMoveEnabled) { + var initialManualColumnPositions = this.getSettings().manualColumnMove; + var loadedManualColumnPositions = loadManualColumnPositions.call(instance); + if (typeof loadedManualColumnPositions != 'undefined') { + this.manualColumnPositions = loadedManualColumnPositions; + } else if (Array.isArray(initialManualColumnPositions)) { + this.manualColumnPositions = initialManualColumnPositions; + } else { + this.manualColumnPositions = []; + } + if (source === 'afterInit' || source === 'afterUpdateSettings' && eventManager.context.eventListeners.length === 0) { + if (typeof instance.manualColumnPositionsPluginUsages === 'undefined') { + instance.manualColumnPositionsPluginUsages = ['manualColumnMove']; + } else { + instance.manualColumnPositionsPluginUsages.push('manualColumnMove'); + } + bindEvents.call(this); + if (this.manualColumnPositions.length > 0) { + this.forceFullRender = true; + this.render(); + } + } + } else { + var pluginUsagesIndex = instance.manualColumnPositionsPluginUsages ? instance.manualColumnPositionsPluginUsages.indexOf('manualColumnMove') : -1; + if (pluginUsagesIndex > -1) { + unbindEvents.call(this); + this.manualColumnPositions = []; + instance.manualColumnPositionsPluginUsages[pluginUsagesIndex] = void 0; + } + } + }; + this.modifyCol = function(col) { + if (this.getSettings().manualColumnMove) { + if (typeof this.manualColumnPositions[col] === 'undefined') { + createPositionData(this.manualColumnPositions, col + 1); + } + return this.manualColumnPositions[col]; + } + return col; + }; + this.afterRemoveCol = function(index, amount) { + if (!this.getSettings().manualColumnMove) { + return; + } + var rmindx, + colpos = this.manualColumnPositions; + rmindx = colpos.splice(index, amount); + colpos = colpos.map(function(colpos) { + var i, + newpos = colpos; + for (i = 0; i < rmindx.length; i++) { + if (colpos > rmindx[i]) { + newpos--; + } + } + return newpos; + }); + this.manualColumnPositions = colpos; + }; + this.afterCreateCol = function(index, amount) { + if (!this.getSettings().manualColumnMove) { + return; + } + var colpos = this.manualColumnPositions; + if (!colpos.length) { + return; + } + var addindx = []; + for (var i = 0; i < amount; i++) { + addindx.push(index + i); + } + if (index >= colpos.length) { + colpos.concat(addindx); + } else { + colpos = colpos.map(function(colpos) { + return (colpos >= index) ? (colpos + amount) : colpos; + }); + colpos.splice.apply(colpos, [index, 0].concat(addindx)); + } + this.manualColumnPositions = colpos; + }; +} +var htManualColumnMove = new ManualColumnMove(); +Handsontable.hooks.add('beforeInit', htManualColumnMove.beforeInit); +Handsontable.hooks.add('afterInit', function() { + htManualColumnMove.init.call(this, 'afterInit'); +}); +Handsontable.hooks.add('afterUpdateSettings', function() { + htManualColumnMove.init.call(this, 'afterUpdateSettings'); +}); +Handsontable.hooks.add('modifyCol', htManualColumnMove.modifyCol); +Handsontable.hooks.add('afterRemoveCol', htManualColumnMove.afterRemoveCol); +Handsontable.hooks.add('afterCreateCol', htManualColumnMove.afterCreateCol); +Handsontable.hooks.register('beforeColumnMove'); +Handsontable.hooks.register('afterColumnMove'); + +//# +},{"eventManager":41,"helpers/dom/element":45,"helpers/dom/event":46,"plugins":57}],78:[function(require,module,exports){ +"use strict"; +Object.defineProperties(exports, { + ManualColumnResize: {get: function() { + return ManualColumnResize; + }}, + __esModule: {value: true} +}); +var $___46__46__47__95_base_46_js__, + $___46__46__47__46__46__47_helpers_47_dom_47_element__, + $___46__46__47__46__46__47_eventManager__, + $___46__46__47__46__46__47_helpers_47_dom_47_event__, + $___46__46__47__46__46__47_plugins__; +var BasePlugin = ($___46__46__47__95_base_46_js__ = require("_base.js"), $___46__46__47__95_base_46_js__ && $___46__46__47__95_base_46_js__.__esModule && $___46__46__47__95_base_46_js__ || {default: $___46__46__47__95_base_46_js__}).default; +var $__1 = ($___46__46__47__46__46__47_helpers_47_dom_47_element__ = require("helpers/dom/element"), $___46__46__47__46__46__47_helpers_47_dom_47_element__ && $___46__46__47__46__46__47_helpers_47_dom_47_element__.__esModule && $___46__46__47__46__46__47_helpers_47_dom_47_element__ || {default: $___46__46__47__46__46__47_helpers_47_dom_47_element__}), + addClass = $__1.addClass, + hasClass = $__1.hasClass, + removeClass = $__1.removeClass; +var eventManagerObject = ($___46__46__47__46__46__47_eventManager__ = require("eventManager"), $___46__46__47__46__46__47_eventManager__ && $___46__46__47__46__46__47_eventManager__.__esModule && $___46__46__47__46__46__47_eventManager__ || {default: $___46__46__47__46__46__47_eventManager__}).eventManager; +var $__3 = ($___46__46__47__46__46__47_helpers_47_dom_47_event__ = require("helpers/dom/event"), $___46__46__47__46__46__47_helpers_47_dom_47_event__ && $___46__46__47__46__46__47_helpers_47_dom_47_event__.__esModule && $___46__46__47__46__46__47_helpers_47_dom_47_event__ || {default: $___46__46__47__46__46__47_helpers_47_dom_47_event__}), + pageX = $__3.pageX, + pageY = $__3.pageY; +var registerPlugin = ($___46__46__47__46__46__47_plugins__ = require("plugins"), $___46__46__47__46__46__47_plugins__ && $___46__46__47__46__46__47_plugins__.__esModule && $___46__46__47__46__46__47_plugins__ || {default: $___46__46__47__46__46__47_plugins__}).registerPlugin; +var ManualColumnResize = function ManualColumnResize(hotInstance) { + $traceurRuntime.superConstructor($ManualColumnResize).call(this, hotInstance); + this.currentTH = null; + this.currentCol = null; + this.currentWidth = null; + this.newSize = null; + this.startY = null; + this.startWidth = null; + this.startOffset = null; + this.handle = document.createElement('DIV'); + this.guide = document.createElement('DIV'); + this.eventManager = eventManagerObject(this); + this.pressed = null; + this.dblclick = 0; + this.autoresizeTimeout = null; + this.manualColumnWidths = []; + addClass(this.handle, 'manualColumnResizer'); + addClass(this.guide, 'manualColumnResizerGuide'); +}; +var $ManualColumnResize = ManualColumnResize; +($traceurRuntime.createClass)(ManualColumnResize, { + isEnabled: function() { + return this.hot.getSettings().manualColumnResize; + }, + enablePlugin: function() { + var $__5 = this; + if (this.enabled) { + return; + } + this.manualColumnWidths = []; + var initialColumnWidth = this.hot.getSettings().manualColumnResize; + var loadedManualColumnWidths = this.loadManualColumnWidths(); + this.addHook('modifyColWidth', (function(width, col) { + return $__5.onModifyColWidth(width, col); + })); + if (typeof loadedManualColumnWidths != 'undefined') { + this.manualColumnWidths = loadedManualColumnWidths; + } else if (Array.isArray(initialColumnWidth)) { + this.manualColumnWidths = initialColumnWidth; + } else { + this.manualColumnWidths = []; + } + Handsontable.hooks.register('beforeColumnResize'); + Handsontable.hooks.register('afterColumnResize'); + this.bindEvents(); + $traceurRuntime.superGet(this, $ManualColumnResize.prototype, "enablePlugin").call(this); + }, + updatePlugin: function() { + var initialColumnWidth = this.hot.getSettings().manualColumnResize; + if (Array.isArray(initialColumnWidth)) { + this.manualColumnWidths = initialColumnWidth; + } else { + this.manualColumnWidths = []; + } + }, + disablePlugin: function() { + $traceurRuntime.superGet(this, $ManualColumnResize.prototype, "disablePlugin").call(this); + }, + saveManualColumnWidths: function() { + this.hot.runHooks('persistentStateSave', 'manualColumnWidths', this.manualColumnWidths); + }, + loadManualColumnWidths: function() { + var storedState = {}; + this.hot.runHooks('persistentStateLoad', 'manualColumnWidths', storedState); + return storedState.value; + }, + setupHandlePosition: function(TH) { + this.currentTH = TH; + var col = this.hot.view.wt.wtTable.getCoords(TH).col; + if (col >= 0) { + var box = this.currentTH.getBoundingClientRect(); + this.currentCol = col; + this.startOffset = box.left - 6; + this.startWidth = parseInt(box.width, 10); + this.handle.style.top = box.top + 'px'; + this.handle.style.left = this.startOffset + this.startWidth + 'px'; + this.hot.rootElement.appendChild(this.handle); + } + }, + refreshHandlePosition: function() { + this.handle.style.left = this.startOffset + this.currentWidth + 'px'; + }, + setupGuidePosition: function() { + addClass(this.handle, 'active'); + addClass(this.guide, 'active'); + this.guide.style.top = this.handle.style.top; + this.guide.style.left = this.handle.style.left; + this.guide.style.height = this.hot.view.maximumVisibleElementHeight(0) + 'px'; + this.hot.rootElement.appendChild(this.guide); + }, + refreshGuidePosition: function() { + this.guide.style.left = this.handle.style.left; + }, + hideHandleAndGuide: function() { + removeClass(this.handle, 'active'); + removeClass(this.guide, 'active'); + }, + checkIfColumnHeader: function(element) { + if (element.tagName != 'BODY') { + if (element.parentNode.tagName == 'THEAD') { + return true; + } else { + element = element.parentNode; + return this.checkIfColumnHeader(element); + } + } + return false; + }, + getTHFromTargetElement: function(element) { + if (element.tagName != 'TABLE') { + if (element.tagName == 'TH') { + return element; + } else { + return this.getTHFromTargetElement(element.parentNode); + } + } + return null; + }, + onMouseOver: function(event) { + if (this.checkIfColumnHeader(event.target)) { + var th = this.getTHFromTargetElement(event.target); + if (!th) { + return; + } + var colspan = th.getAttribute('colspan'); + if (th && (colspan === null || colspan === 1)) { + if (!this.pressed) { + this.setupHandlePosition(th); + } + } + } + }, + afterMouseDownTimeout: function() { + if (this.dblclick >= 2) { + var hookNewSize = this.hot.runHooks('beforeColumnResize', this.currentCol, this.newSize, true); + if (hookNewSize !== void 0) { + this.newSize = hookNewSize; + } + this.setManualSize(this.currentCol, this.newSize); + this.hot.forceFullRender = true; + this.hot.view.render(); + this.hot.view.wt.wtOverlays.adjustElementsSize(true); + this.hot.runHooks('afterColumnResize', this.currentCol, this.newSize, true); + } + this.dblclick = 0; + this.autoresizeTimeout = null; + }, + onMouseDown: function(event) { + var $__5 = this; + if (hasClass(event.target, 'manualColumnResizer')) { + this.setupGuidePosition(); + this.pressed = this.hot; + if (this.autoresizeTimeout === null) { + this.autoresizeTimeout = setTimeout((function() { + return $__5.afterMouseDownTimeout(); + }), 500); + this.hot._registerTimeout(this.autoresizeTimeout); + } + this.dblclick++; + this.startX = pageX(event); + this.newSize = this.startWidth; + } + }, + onMouseMove: function(event) { + if (this.pressed) { + this.currentWidth = this.startWidth + (pageX(event) - this.startX); + this.newSize = this.setManualSize(this.currentCol, this.currentWidth); + this.refreshHandlePosition(); + this.refreshGuidePosition(); + } + }, + onMouseUp: function(event) { + if (this.pressed) { + this.hideHandleAndGuide(); + this.pressed = false; + if (this.newSize != this.startWidth) { + this.hot.runHooks('beforeColumnResize', this.currentCol, this.newSize); + this.hot.forceFullRender = true; + this.hot.view.render(); + this.hot.view.wt.wtOverlays.adjustElementsSize(true); + this.saveManualColumnWidths(); + this.hot.runHooks('afterColumnResize', this.currentCol, this.newSize); + } + this.setupHandlePosition(this.currentTH); + } + }, + bindEvents: function() { + var $__5 = this; + this.eventManager.addEventListener(this.hot.rootElement, 'mouseover', (function(e) { + return $__5.onMouseOver(e); + })); + this.eventManager.addEventListener(this.hot.rootElement, 'mousedown', (function(e) { + return $__5.onMouseDown(e); + })); + this.eventManager.addEventListener(window, 'mousemove', (function(e) { + return $__5.onMouseMove(e); + })); + this.eventManager.addEventListener(window, 'mouseup', (function(e) { + return $__5.onMouseUp(e); + })); + }, + setManualSize: function(column, width) { + width = Math.max(width, 20); + column = this.hot.runHooks('modifyCol', column); + this.manualColumnWidths[column] = width; + return width; + }, + onModifyColWidth: function(width, column) { + if (this.enabled) { + column = this.hot.runHooks('modifyCol', column); + if (this.hot.getSettings().manualColumnResize && this.manualColumnWidths[column]) { + return this.manualColumnWidths[column]; + } + } + return width; + } +}, {}, BasePlugin); +; +registerPlugin('manualColumnResize', ManualColumnResize); + +//# +},{"_base.js":58,"eventManager":41,"helpers/dom/element":45,"helpers/dom/event":46,"plugins":57}],79:[function(require,module,exports){ +"use strict"; +Object.defineProperties(exports, { + ManualRowMove: {get: function() { + return ManualRowMove; + }}, + __esModule: {value: true} +}); +var $___46__46__47__46__46__47_helpers_47_dom_47_element__, + $___46__46__47__46__46__47_eventManager__, + $___46__46__47__46__46__47_helpers_47_dom_47_event__, + $___46__46__47__46__46__47_plugins__; +var $__0 = ($___46__46__47__46__46__47_helpers_47_dom_47_element__ = require("helpers/dom/element"), $___46__46__47__46__46__47_helpers_47_dom_47_element__ && $___46__46__47__46__46__47_helpers_47_dom_47_element__.__esModule && $___46__46__47__46__46__47_helpers_47_dom_47_element__ || {default: $___46__46__47__46__46__47_helpers_47_dom_47_element__}), + addClass = $__0.addClass, + hasClass = $__0.hasClass, + removeClass = $__0.removeClass; +var eventManagerObject = ($___46__46__47__46__46__47_eventManager__ = require("eventManager"), $___46__46__47__46__46__47_eventManager__ && $___46__46__47__46__46__47_eventManager__.__esModule && $___46__46__47__46__46__47_eventManager__ || {default: $___46__46__47__46__46__47_eventManager__}).eventManager; +var $__2 = ($___46__46__47__46__46__47_helpers_47_dom_47_event__ = require("helpers/dom/event"), $___46__46__47__46__46__47_helpers_47_dom_47_event__ && $___46__46__47__46__46__47_helpers_47_dom_47_event__.__esModule && $___46__46__47__46__46__47_helpers_47_dom_47_event__ || {default: $___46__46__47__46__46__47_helpers_47_dom_47_event__}), + pageX = $__2.pageX, + pageY = $__2.pageY; +var registerPlugin = ($___46__46__47__46__46__47_plugins__ = require("plugins"), $___46__46__47__46__46__47_plugins__ && $___46__46__47__46__46__47_plugins__.__esModule && $___46__46__47__46__46__47_plugins__ || {default: $___46__46__47__46__46__47_plugins__}).registerPlugin; +; +function ManualRowMove() { + var startRow, + endRow, + startY, + startOffset, + currentRow, + currentTH, + handle = document.createElement('DIV'), + guide = document.createElement('DIV'), + eventManager = eventManagerObject(this); + handle.className = 'manualRowMover'; + guide.className = 'manualRowMoverGuide'; + var saveManualRowPositions = function() { + var instance = this; + Handsontable.hooks.run(instance, 'persistentStateSave', 'manualRowPositions', instance.manualRowPositions); + }; + var loadManualRowPositions = function() { + var instance = this, + storedState = {}; + Handsontable.hooks.run(instance, 'persistentStateLoad', 'manualRowPositions', storedState); + return storedState.value; + }; + function setupHandlePosition(TH) { + var instance = this; + currentTH = TH; + var row = this.view.wt.wtTable.getCoords(TH).row; + if (row >= 0) { + currentRow = row; + var box = currentTH.getBoundingClientRect(); + startOffset = box.top; + handle.style.top = startOffset + 'px'; + handle.style.left = box.left + 'px'; + instance.rootElement.appendChild(handle); + } + } + function refreshHandlePosition(TH, delta) { + var box = TH.getBoundingClientRect(); + var handleHeight = 6; + if (delta > 0) { + handle.style.top = (box.top + box.height - handleHeight) + 'px'; + } else { + handle.style.top = box.top + 'px'; + } + } + function setupGuidePosition() { + var instance = this; + addClass(handle, 'active'); + addClass(guide, 'active'); + var box = currentTH.getBoundingClientRect(); + guide.style.width = instance.view.maximumVisibleElementWidth(0) + 'px'; + guide.style.height = box.height + 'px'; + guide.style.top = startOffset + 'px'; + guide.style.left = handle.style.left; + instance.rootElement.appendChild(guide); + } + function refreshGuidePosition(diff) { + guide.style.top = startOffset + diff + 'px'; + } + function hideHandleAndGuide() { + removeClass(handle, 'active'); + removeClass(guide, 'active'); + } + var checkRowHeader = function(element) { + if (element.tagName != 'BODY') { + if (element.parentNode.tagName == 'TBODY') { + return true; + } else { + element = element.parentNode; + return checkRowHeader(element); + } + } + return false; + }; + var getTHFromTargetElement = function(element) { + if (element.tagName != 'TABLE') { + if (element.tagName == 'TH') { + return element; + } else { + return getTHFromTargetElement(element.parentNode); + } + } + return null; + }; + var bindEvents = function() { + var instance = this; + var pressed; + eventManager.addEventListener(instance.rootElement, 'mouseover', function(e) { + if (checkRowHeader(e.target)) { + var th = getTHFromTargetElement(e.target); + if (th) { + if (pressed) { + endRow = instance.view.wt.wtTable.getCoords(th).row; + refreshHandlePosition(th, endRow - startRow); + } else { + setupHandlePosition.call(instance, th); + } + } + } + }); + eventManager.addEventListener(instance.rootElement, 'mousedown', function(e) { + if (hasClass(e.target, 'manualRowMover')) { + startY = pageY(e); + setupGuidePosition.call(instance); + pressed = instance; + startRow = currentRow; + endRow = currentRow; + } + }); + eventManager.addEventListener(window, 'mousemove', function(e) { + if (pressed) { + refreshGuidePosition(pageY(e) - startY); + } + }); + eventManager.addEventListener(window, 'mouseup', function(e) { + if (pressed) { + hideHandleAndGuide(); + pressed = false; + createPositionData(instance.manualRowPositions, instance.countRows()); + instance.manualRowPositions.splice(endRow, 0, instance.manualRowPositions.splice(startRow, 1)[0]); + Handsontable.hooks.run(instance, 'beforeRowMove', startRow, endRow); + instance.forceFullRender = true; + instance.view.render(); + saveManualRowPositions.call(instance); + Handsontable.hooks.run(instance, 'afterRowMove', startRow, endRow); + setupHandlePosition.call(instance, currentTH); + } + }); + instance.addHook('afterDestroy', unbindEvents); + }; + var unbindEvents = function() { + eventManager.clear(); + }; + var createPositionData = function(positionArr, len) { + if (positionArr.length < len) { + for (var i = positionArr.length; i < len; i++) { + positionArr[i] = i; + } + } + }; + this.beforeInit = function() { + this.manualRowPositions = []; + }; + this.init = function(source) { + var instance = this; + var manualRowMoveEnabled = !!(instance.getSettings().manualRowMove); + if (manualRowMoveEnabled) { + var initialManualRowPositions = instance.getSettings().manualRowMove; + var loadedManualRowPostions = loadManualRowPositions.call(instance); + if (typeof instance.manualRowPositionsPluginUsages === 'undefined') { + instance.manualRowPositionsPluginUsages = ['manualColumnMove']; + } else { + instance.manualRowPositionsPluginUsages.push('manualColumnMove'); + } + if (typeof loadedManualRowPostions != 'undefined') { + this.manualRowPositions = loadedManualRowPostions; + } else if (Array.isArray(initialManualRowPositions)) { + this.manualRowPositions = initialManualRowPositions; + } else { + this.manualRowPositions = []; + } + if (source === 'afterInit' || source === 'afterUpdateSettings' && eventManager.context.eventListeners.length === 0) { + bindEvents.call(this); + if (this.manualRowPositions.length > 0) { + instance.forceFullRender = true; + instance.render(); + } + } + } else { + var pluginUsagesIndex = instance.manualRowPositionsPluginUsages ? instance.manualRowPositionsPluginUsages.indexOf('manualColumnMove') : -1; + if (pluginUsagesIndex > -1) { + unbindEvents.call(this); + instance.manualRowPositions = []; + instance.manualRowPositionsPluginUsages[pluginUsagesIndex] = void 0; + } + } + }; + this.modifyRow = function(row) { + var instance = this; + if (instance.getSettings().manualRowMove) { + if (typeof instance.manualRowPositions[row] === 'undefined') { + createPositionData(this.manualRowPositions, row + 1); + } + return instance.manualRowPositions[row]; + } + return row; + }; +} +var htManualRowMove = new ManualRowMove(); +Handsontable.hooks.add('beforeInit', htManualRowMove.beforeInit); +Handsontable.hooks.add('afterInit', function() { + htManualRowMove.init.call(this, 'afterInit'); +}); +Handsontable.hooks.add('afterUpdateSettings', function() { + htManualRowMove.init.call(this, 'afterUpdateSettings'); +}); +Handsontable.hooks.add('modifyRow', htManualRowMove.modifyRow); +Handsontable.hooks.register('beforeRowMove'); +Handsontable.hooks.register('afterRowMove'); + +//# +},{"eventManager":41,"helpers/dom/element":45,"helpers/dom/event":46,"plugins":57}],80:[function(require,module,exports){ +"use strict"; +Object.defineProperties(exports, { + ManualRowResize: {get: function() { + return ManualRowResize; + }}, + __esModule: {value: true} +}); +var $___46__46__47__95_base_46_js__, + $___46__46__47__46__46__47_helpers_47_dom_47_element__, + $___46__46__47__46__46__47_eventManager__, + $___46__46__47__46__46__47_helpers_47_dom_47_event__, + $___46__46__47__46__46__47_plugins__; +var BasePlugin = ($___46__46__47__95_base_46_js__ = require("_base.js"), $___46__46__47__95_base_46_js__ && $___46__46__47__95_base_46_js__.__esModule && $___46__46__47__95_base_46_js__ || {default: $___46__46__47__95_base_46_js__}).default; +var $__1 = ($___46__46__47__46__46__47_helpers_47_dom_47_element__ = require("helpers/dom/element"), $___46__46__47__46__46__47_helpers_47_dom_47_element__ && $___46__46__47__46__46__47_helpers_47_dom_47_element__.__esModule && $___46__46__47__46__46__47_helpers_47_dom_47_element__ || {default: $___46__46__47__46__46__47_helpers_47_dom_47_element__}), + addClass = $__1.addClass, + hasClass = $__1.hasClass, + removeClass = $__1.removeClass; +var eventManagerObject = ($___46__46__47__46__46__47_eventManager__ = require("eventManager"), $___46__46__47__46__46__47_eventManager__ && $___46__46__47__46__46__47_eventManager__.__esModule && $___46__46__47__46__46__47_eventManager__ || {default: $___46__46__47__46__46__47_eventManager__}).eventManager; +var $__3 = ($___46__46__47__46__46__47_helpers_47_dom_47_event__ = require("helpers/dom/event"), $___46__46__47__46__46__47_helpers_47_dom_47_event__ && $___46__46__47__46__46__47_helpers_47_dom_47_event__.__esModule && $___46__46__47__46__46__47_helpers_47_dom_47_event__ || {default: $___46__46__47__46__46__47_helpers_47_dom_47_event__}), + pageX = $__3.pageX, + pageY = $__3.pageY; +var registerPlugin = ($___46__46__47__46__46__47_plugins__ = require("plugins"), $___46__46__47__46__46__47_plugins__ && $___46__46__47__46__46__47_plugins__.__esModule && $___46__46__47__46__46__47_plugins__ || {default: $___46__46__47__46__46__47_plugins__}).registerPlugin; +var ManualRowResize = function ManualRowResize(hotInstance) { + $traceurRuntime.superConstructor($ManualRowResize).call(this, hotInstance); + this.currentTH = null; + this.currentRow = null; + this.currentHeight = null; + this.newSize = null; + this.startY = null; + this.startHeight = null; + this.startOffset = null; + this.handle = document.createElement('DIV'); + this.guide = document.createElement('DIV'); + this.eventManager = eventManagerObject(this); + this.pressed = null; + this.dblclick = 0; + this.autoresizeTimeout = null; + this.manualRowHeights = []; + addClass(this.handle, 'manualRowResizer'); + addClass(this.guide, 'manualRowResizerGuide'); +}; +var $ManualRowResize = ManualRowResize; +($traceurRuntime.createClass)(ManualRowResize, { + isEnabled: function() { + return this.hot.getSettings().manualRowResize; + }, + enablePlugin: function() { + var $__5 = this; + if (this.enabled) { + return; + } + this.manualRowHeights = []; + var initialRowHeights = this.hot.getSettings().manualRowResize; + var loadedManualRowHeights = this.loadManualRowHeights(); + if (typeof loadedManualRowHeights != 'undefined') { + this.manualRowHeights = loadedManualRowHeights; + } else if (Array.isArray(initialRowHeights)) { + this.manualRowHeights = initialRowHeights; + } else { + this.manualRowHeights = []; + } + this.addHook('modifyRowHeight', (function(height, row) { + return $__5.onModifyRowHeight(height, row); + })); + Handsontable.hooks.register('beforeRowResize'); + Handsontable.hooks.register('afterRowResize'); + this.bindEvents(); + $traceurRuntime.superGet(this, $ManualRowResize.prototype, "enablePlugin").call(this); + }, + updatePlugin: function() { + var initialRowHeights = this.hot.getSettings().manualRowResize; + if (Array.isArray(initialRowHeights)) { + this.manualRowHeights = initialRowHeights; + } else { + this.manualRowHeights = []; + } + }, + disablePlugin: function() { + $traceurRuntime.superGet(this, $ManualRowResize.prototype, "disablePlugin").call(this); + }, + saveManualRowHeights: function() { + this.hot.runHooks('persistentStateSave', 'manualRowHeights', this.manualRowHeights); + }, + loadManualRowHeights: function() { + var storedState = {}; + this.hot.runHooks('persistentStateLoad', 'manualRowHeights', storedState); + return storedState.value; + }, + setupHandlePosition: function(TH) { + this.currentTH = TH; + var row = this.hot.view.wt.wtTable.getCoords(TH).row; + if (row >= 0) { + var box = this.currentTH.getBoundingClientRect(); + this.currentRow = row; + this.startOffset = box.top - 6; + this.startHeight = parseInt(box.height, 10); + this.handle.style.left = box.left + 'px'; + this.handle.style.top = this.startOffset + this.startHeight + 'px'; + this.hot.rootElement.appendChild(this.handle); + } + }, + refreshHandlePosition: function() { + this.handle.style.top = this.startOffset + this.currentHeight + 'px'; + }, + setupGuidePosition: function() { + addClass(this.handle, 'active'); + addClass(this.guide, 'active'); + this.guide.style.top = this.handle.style.top; + this.guide.style.left = this.handle.style.left; + this.guide.style.width = this.hot.view.maximumVisibleElementWidth(0) + 'px'; + this.hot.rootElement.appendChild(this.guide); + }, + refreshGuidePosition: function() { + this.guide.style.top = this.handle.style.top; + }, + hideHandleAndGuide: function() { + removeClass(this.handle, 'active'); + removeClass(this.guide, 'active'); + }, + checkIfRowHeader: function(element) { + if (element.tagName != 'BODY') { + if (element.parentNode.tagName == 'TBODY') { + return true; + } else { + element = element.parentNode; + return this.checkIfRowHeader(element); + } + } + return false; + }, + getTHFromTargetElement: function(element) { + if (element.tagName != 'TABLE') { + if (element.tagName == 'TH') { + return element; + } else { + return this.getTHFromTargetElement(element.parentNode); + } + } + return null; + }, + onMouseOver: function(event) { + if (this.checkIfRowHeader(event.target)) { + var th = this.getTHFromTargetElement(event.target); + if (th) { + if (!this.pressed) { + this.setupHandlePosition(th); + } + } + } + }, + afterMouseDownTimeout: function() { + if (this.dblclick >= 2) { + var hookNewSize = this.hot.runHooks('beforeRowResize', this.currentRow, this.newSize, true); + if (hookNewSize !== void 0) { + this.newSize = hookNewSize; + } + this.setManualSize(this.currentRow, this.newSize); + this.hot.forceFullRender = true; + this.hot.view.render(); + this.hot.view.wt.wtOverlays.adjustElementsSize(true); + this.hot.runHooks('afterRowResize', this.currentRow, this.newSize, true); + } + this.dblclick = 0; + this.autoresizeTimeout = null; + }, + onMouseDown: function(event) { + var $__5 = this; + if (hasClass(event.target, 'manualRowResizer')) { + this.setupGuidePosition(); + this.pressed = this.hot; + if (this.autoresizeTimeout == null) { + this.autoresizeTimeout = setTimeout((function() { + return $__5.afterMouseDownTimeout(); + }), 500); + this.hot._registerTimeout(this.autoresizeTimeout); + } + this.dblclick++; + this.startY = pageY(event); + this.newSize = this.startHeight; + } + }, + onMouseMove: function(event) { + if (this.pressed) { + this.currentHeight = this.startHeight + (pageY(event) - this.startY); + this.newSize = this.setManualSize(this.currentRow, this.currentHeight); + this.refreshHandlePosition(); + this.refreshGuidePosition(); + } + }, + onMouseUp: function(event) { + if (this.pressed) { + this.hideHandleAndGuide(); + this.pressed = false; + if (this.newSize != this.startHeight) { + this.hot.runHooks('beforeRowResize', this.currentRow, this.newSize); + this.hot.forceFullRender = true; + this.hot.view.render(); + this.hot.view.wt.wtOverlays.adjustElementsSize(true); + this.saveManualRowHeights(); + this.hot.runHooks('afterRowResize', this.currentRow, this.newSize); + } + this.setupHandlePosition(this.currentTH); + } + }, + bindEvents: function() { + var $__5 = this; + this.eventManager.addEventListener(this.hot.rootElement, 'mouseover', (function(e) { + return $__5.onMouseOver(e); + })); + this.eventManager.addEventListener(this.hot.rootElement, 'mousedown', (function(e) { + return $__5.onMouseDown(e); + })); + this.eventManager.addEventListener(window, 'mousemove', (function(e) { + return $__5.onMouseMove(e); + })); + this.eventManager.addEventListener(window, 'mouseup', (function(e) { + return $__5.onMouseUp(e); + })); + }, + setManualSize: function(row, height) { + row = this.hot.runHooks('modifyRow', row); + this.manualRowHeights[row] = height; + return height; + }, + onModifyRowHeight: function(height, row) { + if (this.enabled) { + var autoRowSizePlugin = this.hot.getPlugin('autoRowSize'); + var autoRowHeightResult = autoRowSizePlugin ? autoRowSizePlugin.heights[row] : null; + row = this.hot.runHooks('modifyRow', row); + var manualRowHeight = this.manualRowHeights[row]; + if (manualRowHeight !== void 0 && (manualRowHeight === autoRowHeightResult || manualRowHeight > (height || 0))) { + return manualRowHeight; + } + } + return height; + } +}, {}, BasePlugin); +; +registerPlugin('manualRowResize', ManualRowResize); + +//# +},{"_base.js":58,"eventManager":41,"helpers/dom/element":45,"helpers/dom/event":46,"plugins":57}],81:[function(require,module,exports){ +"use strict"; +Object.defineProperties(exports, { + MergeCells: {get: function() { + return MergeCells; + }}, + __esModule: {value: true} +}); +var $___46__46__47__46__46__47_plugins__, + $___46__46__47__46__46__47_helpers_47_dom_47_event__, + $___46__46__47__46__46__47_3rdparty_47_walkontable_47_src_47_cell_47_coords__, + $___46__46__47__46__46__47_3rdparty_47_walkontable_47_src_47_cell_47_range__, + $___46__46__47__46__46__47_3rdparty_47_walkontable_47_src_47_table__; +var registerPlugin = ($___46__46__47__46__46__47_plugins__ = require("plugins"), $___46__46__47__46__46__47_plugins__ && $___46__46__47__46__46__47_plugins__.__esModule && $___46__46__47__46__46__47_plugins__ || {default: $___46__46__47__46__46__47_plugins__}).registerPlugin; +var stopImmediatePropagation = ($___46__46__47__46__46__47_helpers_47_dom_47_event__ = require("helpers/dom/event"), $___46__46__47__46__46__47_helpers_47_dom_47_event__ && $___46__46__47__46__46__47_helpers_47_dom_47_event__.__esModule && $___46__46__47__46__46__47_helpers_47_dom_47_event__ || {default: $___46__46__47__46__46__47_helpers_47_dom_47_event__}).stopImmediatePropagation; +var WalkontableCellCoords = ($___46__46__47__46__46__47_3rdparty_47_walkontable_47_src_47_cell_47_coords__ = require("3rdparty/walkontable/src/cell/coords"), $___46__46__47__46__46__47_3rdparty_47_walkontable_47_src_47_cell_47_coords__ && $___46__46__47__46__46__47_3rdparty_47_walkontable_47_src_47_cell_47_coords__.__esModule && $___46__46__47__46__46__47_3rdparty_47_walkontable_47_src_47_cell_47_coords__ || {default: $___46__46__47__46__46__47_3rdparty_47_walkontable_47_src_47_cell_47_coords__}).WalkontableCellCoords; +var WalkontableCellRange = ($___46__46__47__46__46__47_3rdparty_47_walkontable_47_src_47_cell_47_range__ = require("3rdparty/walkontable/src/cell/range"), $___46__46__47__46__46__47_3rdparty_47_walkontable_47_src_47_cell_47_range__ && $___46__46__47__46__46__47_3rdparty_47_walkontable_47_src_47_cell_47_range__.__esModule && $___46__46__47__46__46__47_3rdparty_47_walkontable_47_src_47_cell_47_range__ || {default: $___46__46__47__46__46__47_3rdparty_47_walkontable_47_src_47_cell_47_range__}).WalkontableCellRange; +var WalkontableTable = ($___46__46__47__46__46__47_3rdparty_47_walkontable_47_src_47_table__ = require("3rdparty/walkontable/src/table"), $___46__46__47__46__46__47_3rdparty_47_walkontable_47_src_47_table__ && $___46__46__47__46__46__47_3rdparty_47_walkontable_47_src_47_table__.__esModule && $___46__46__47__46__46__47_3rdparty_47_walkontable_47_src_47_table__ || {default: $___46__46__47__46__46__47_3rdparty_47_walkontable_47_src_47_table__}).WalkontableTable; +; +function CellInfoCollection() { + var collection = []; + collection.getInfo = function(row, col) { + for (var i = 0, + ilen = this.length; i < ilen; i++) { + if (this[i].row <= row && this[i].row + this[i].rowspan - 1 >= row && this[i].col <= col && this[i].col + this[i].colspan - 1 >= col) { + return this[i]; + } + } + }; + collection.setInfo = function(info) { + for (var i = 0, + ilen = this.length; i < ilen; i++) { + if (this[i].row === info.row && this[i].col === info.col) { + this[i] = info; + return; + } + } + this.push(info); + }; + collection.removeInfo = function(row, col) { + for (var i = 0, + ilen = this.length; i < ilen; i++) { + if (this[i].row === row && this[i].col === col) { + this.splice(i, 1); + break; + } + } + }; + return collection; +} +function MergeCells(mergeCellsSetting) { + this.mergedCellInfoCollection = new CellInfoCollection(); + if (Array.isArray(mergeCellsSetting)) { + for (var i = 0, + ilen = mergeCellsSetting.length; i < ilen; i++) { + this.mergedCellInfoCollection.setInfo(mergeCellsSetting[i]); + } + } +} +MergeCells.prototype.canMergeRange = function(cellRange) { + return !cellRange.isSingle(); +}; +MergeCells.prototype.mergeRange = function(cellRange) { + if (!this.canMergeRange(cellRange)) { + return; + } + var topLeft = cellRange.getTopLeftCorner(); + var bottomRight = cellRange.getBottomRightCorner(); + var mergeParent = {}; + mergeParent.row = topLeft.row; + mergeParent.col = topLeft.col; + mergeParent.rowspan = bottomRight.row - topLeft.row + 1; + mergeParent.colspan = bottomRight.col - topLeft.col + 1; + this.mergedCellInfoCollection.setInfo(mergeParent); +}; +MergeCells.prototype.mergeOrUnmergeSelection = function(cellRange) { + var info = this.mergedCellInfoCollection.getInfo(cellRange.from.row, cellRange.from.col); + if (info) { + this.unmergeSelection(cellRange.from); + } else { + this.mergeSelection(cellRange); + } +}; +MergeCells.prototype.mergeSelection = function(cellRange) { + this.mergeRange(cellRange); +}; +MergeCells.prototype.unmergeSelection = function(cellRange) { + var info = this.mergedCellInfoCollection.getInfo(cellRange.row, cellRange.col); + this.mergedCellInfoCollection.removeInfo(info.row, info.col); +}; +MergeCells.prototype.applySpanProperties = function(TD, row, col) { + var info = this.mergedCellInfoCollection.getInfo(row, col); + if (info) { + if (info.row === row && info.col === col) { + TD.setAttribute('rowspan', info.rowspan); + TD.setAttribute('colspan', info.colspan); + } else { + TD.removeAttribute('rowspan'); + TD.removeAttribute('colspan'); + TD.style.display = 'none'; + } + } else { + TD.removeAttribute('rowspan'); + TD.removeAttribute('colspan'); + } +}; +MergeCells.prototype.modifyTransform = function(hook, currentSelectedRange, delta) { + var sameRowspan = function(merged, coords) { + if (coords.row >= merged.row && coords.row <= (merged.row + merged.rowspan - 1)) { + return true; + } + return false; + }, + sameColspan = function(merged, coords) { + if (coords.col >= merged.col && coords.col <= (merged.col + merged.colspan - 1)) { + return true; + } + return false; + }, + getNextPosition = function(newDelta) { + return new WalkontableCellCoords(currentSelectedRange.to.row + newDelta.row, currentSelectedRange.to.col + newDelta.col); + }; + var newDelta = { + row: delta.row, + col: delta.col + }; + if (hook == 'modifyTransformStart') { + if (!this.lastDesiredCoords) { + this.lastDesiredCoords = new WalkontableCellCoords(null, null); + } + var currentPosition = new WalkontableCellCoords(currentSelectedRange.highlight.row, currentSelectedRange.highlight.col), + mergedParent = this.mergedCellInfoCollection.getInfo(currentPosition.row, currentPosition.col), + currentRangeContainsMerge; + for (var i = 0, + mergesLength = this.mergedCellInfoCollection.length; i < mergesLength; i++) { + var range = this.mergedCellInfoCollection[i]; + range = new WalkontableCellCoords(range.row + range.rowspan - 1, range.col + range.colspan - 1); + if (currentSelectedRange.includes(range)) { + currentRangeContainsMerge = true; + break; + } + } + if (mergedParent) { + var mergeTopLeft = new WalkontableCellCoords(mergedParent.row, mergedParent.col), + mergeBottomRight = new WalkontableCellCoords(mergedParent.row + mergedParent.rowspan - 1, mergedParent.col + mergedParent.colspan - 1), + mergeRange = new WalkontableCellRange(mergeTopLeft, mergeTopLeft, mergeBottomRight); + if (!mergeRange.includes(this.lastDesiredCoords)) { + this.lastDesiredCoords = new WalkontableCellCoords(null, null); + } + newDelta.row = this.lastDesiredCoords.row ? this.lastDesiredCoords.row - currentPosition.row : newDelta.row; + newDelta.col = this.lastDesiredCoords.col ? this.lastDesiredCoords.col - currentPosition.col : newDelta.col; + if (delta.row > 0) { + newDelta.row = mergedParent.row + mergedParent.rowspan - 1 - currentPosition.row + delta.row; + } else if (delta.row < 0) { + newDelta.row = currentPosition.row - mergedParent.row + delta.row; + } + if (delta.col > 0) { + newDelta.col = mergedParent.col + mergedParent.colspan - 1 - currentPosition.col + delta.col; + } else if (delta.col < 0) { + newDelta.col = currentPosition.col - mergedParent.col + delta.col; + } + } + var nextPosition = new WalkontableCellCoords(currentSelectedRange.highlight.row + newDelta.row, currentSelectedRange.highlight.col + newDelta.col), + nextParentIsMerged = this.mergedCellInfoCollection.getInfo(nextPosition.row, nextPosition.col); + if (nextParentIsMerged) { + this.lastDesiredCoords = nextPosition; + newDelta = { + row: nextParentIsMerged.row - currentPosition.row, + col: nextParentIsMerged.col - currentPosition.col + }; + } + } else if (hook == 'modifyTransformEnd') { + for (var i = 0, + mergesLength = this.mergedCellInfoCollection.length; i < mergesLength; i++) { + var currentMerge = this.mergedCellInfoCollection[i], + mergeTopLeft = new WalkontableCellCoords(currentMerge.row, currentMerge.col), + mergeBottomRight = new WalkontableCellCoords(currentMerge.row + currentMerge.rowspan - 1, currentMerge.col + currentMerge.colspan - 1), + mergedRange = new WalkontableCellRange(mergeTopLeft, mergeTopLeft, mergeBottomRight), + sharedBorders = currentSelectedRange.getBordersSharedWith(mergedRange); + if (mergedRange.isEqual(currentSelectedRange)) { + currentSelectedRange.setDirection('NW-SE'); + } else if (sharedBorders.length > 0) { + var mergeHighlighted = (currentSelectedRange.highlight.isEqual(mergedRange.from)); + if (sharedBorders.indexOf('top') > -1) { + if (currentSelectedRange.to.isSouthEastOf(mergedRange.from) && mergeHighlighted) { + currentSelectedRange.setDirection('NW-SE'); + } else if (currentSelectedRange.to.isSouthWestOf(mergedRange.from) && mergeHighlighted) { + currentSelectedRange.setDirection('NE-SW'); + } + } else if (sharedBorders.indexOf('bottom') > -1) { + if (currentSelectedRange.to.isNorthEastOf(mergedRange.from) && mergeHighlighted) { + currentSelectedRange.setDirection('SW-NE'); + } else if (currentSelectedRange.to.isNorthWestOf(mergedRange.from) && mergeHighlighted) { + currentSelectedRange.setDirection('SE-NW'); + } + } + } + var nextPosition = getNextPosition(newDelta), + withinRowspan = sameRowspan(currentMerge, nextPosition), + withinColspan = sameColspan(currentMerge, nextPosition); + if (currentSelectedRange.includesRange(mergedRange) && (mergedRange.includes(nextPosition) || withinRowspan || withinColspan)) { + if (withinRowspan) { + if (newDelta.row < 0) { + newDelta.row -= currentMerge.rowspan - 1; + } else if (newDelta.row > 0) { + newDelta.row += currentMerge.rowspan - 1; + } + } + if (withinColspan) { + if (newDelta.col < 0) { + newDelta.col -= currentMerge.colspan - 1; + } else if (newDelta.col > 0) { + newDelta.col += currentMerge.colspan - 1; + } + } + } + } + } + if (newDelta.row !== 0) { + delta.row = newDelta.row; + } + if (newDelta.col !== 0) { + delta.col = newDelta.col; + } +}; +MergeCells.prototype.shiftCollection = function(direction, index, count) { + var shiftVector = [0, 0]; + switch (direction) { + case 'right': + shiftVector[0] += 1; + break; + case 'left': + shiftVector[0] -= 1; + break; + case 'down': + shiftVector[1] += 1; + break; + case 'up': + shiftVector[1] -= 1; + break; + } + for (var i = 0; i < this.mergedCellInfoCollection.length; i++) { + var currentMerge = this.mergedCellInfoCollection[i]; + if (direction === 'right' || direction === 'left') { + if (index <= currentMerge.col) { + currentMerge.col += shiftVector[0]; + } + } else { + if (index <= currentMerge.row) { + currentMerge.row += shiftVector[1]; + } + } + } +}; +var beforeInit = function() { + var instance = this; + var mergeCellsSetting = instance.getSettings().mergeCells; + if (mergeCellsSetting) { + if (!instance.mergeCells) { + instance.mergeCells = new MergeCells(mergeCellsSetting); + } + } +}; +var afterInit = function() { + var instance = this; + if (instance.mergeCells) { + instance.view.wt.wtTable.getCell = function(coords) { + if (instance.getSettings().mergeCells) { + var mergeParent = instance.mergeCells.mergedCellInfoCollection.getInfo(coords.row, coords.col); + if (mergeParent) { + coords = mergeParent; + } + } + return WalkontableTable.prototype.getCell.call(this, coords); + }; + } +}; +var afterUpdateSettings = function() { + var instance = this; + var mergeCellsSetting = instance.getSettings().mergeCells; + if (mergeCellsSetting) { + if (instance.mergeCells) { + instance.mergeCells.mergedCellInfoCollection = new CellInfoCollection(); + if (Array.isArray(mergeCellsSetting)) { + for (var i = 0, + ilen = mergeCellsSetting.length; i < ilen; i++) { + instance.mergeCells.mergedCellInfoCollection.setInfo(mergeCellsSetting[i]); + } + } + } else { + instance.mergeCells = new MergeCells(mergeCellsSetting); + } + } else { + if (instance.mergeCells) { + instance.mergeCells.mergedCellInfoCollection = new CellInfoCollection(); + } + } +}; +var onBeforeKeyDown = function(event) { + if (!this.mergeCells) { + return; + } + var ctrlDown = (event.ctrlKey || event.metaKey) && !event.altKey; + if (ctrlDown) { + if (event.keyCode === 77) { + this.mergeCells.mergeOrUnmergeSelection(this.getSelectedRange()); + this.render(); + stopImmediatePropagation(event); + } + } +}; +var addMergeActionsToContextMenu = function(defaultOptions) { + if (!this.getSettings().mergeCells) { + return; + } + defaultOptions.items.push(Handsontable.plugins.ContextMenu.SEPARATOR); + defaultOptions.items.push({ + key: 'mergeCells', + name: function() { + var sel = this.getSelected(); + var info = this.mergeCells.mergedCellInfoCollection.getInfo(sel[0], sel[1]); + if (info) { + return 'Unmerge cells'; + } else { + return 'Merge cells'; + } + }, + callback: function() { + this.mergeCells.mergeOrUnmergeSelection(this.getSelectedRange()); + this.render(); + }, + disabled: function() { + return false; + } + }); +}; +var afterRenderer = function(TD, row, col, prop, value, cellProperties) { + if (this.mergeCells) { + this.mergeCells.applySpanProperties(TD, row, col); + } +}; +var modifyTransformFactory = function(hook) { + return function(delta) { + var mergeCellsSetting = this.getSettings().mergeCells; + if (mergeCellsSetting) { + var currentSelectedRange = this.getSelectedRange(); + this.mergeCells.modifyTransform(hook, currentSelectedRange, delta); + if (hook === 'modifyTransformEnd') { + var totalRows = this.countRows(); + var totalCols = this.countCols(); + if (currentSelectedRange.from.row < 0) { + currentSelectedRange.from.row = 0; + } else if (currentSelectedRange.from.row > 0 && currentSelectedRange.from.row >= totalRows) { + currentSelectedRange.from.row = currentSelectedRange.from - 1; + } + if (currentSelectedRange.from.col < 0) { + currentSelectedRange.from.col = 0; + } else if (currentSelectedRange.from.col > 0 && currentSelectedRange.from.col >= totalCols) { + currentSelectedRange.from.col = totalCols - 1; + } + } + } + }; +}; +var beforeSetRangeEnd = function(coords) { + this.lastDesiredCoords = null; + var mergeCellsSetting = this.getSettings().mergeCells; + if (mergeCellsSetting) { + var selRange = this.getSelectedRange(); + selRange.highlight = new WalkontableCellCoords(selRange.highlight.row, selRange.highlight.col); + selRange.to = coords; + var rangeExpanded = false; + do { + rangeExpanded = false; + for (var i = 0, + ilen = this.mergeCells.mergedCellInfoCollection.length; i < ilen; i++) { + var cellInfo = this.mergeCells.mergedCellInfoCollection[i]; + var mergedCellTopLeft = new WalkontableCellCoords(cellInfo.row, cellInfo.col); + var mergedCellBottomRight = new WalkontableCellCoords(cellInfo.row + cellInfo.rowspan - 1, cellInfo.col + cellInfo.colspan - 1); + var mergedCellRange = new WalkontableCellRange(mergedCellTopLeft, mergedCellTopLeft, mergedCellBottomRight); + if (selRange.expandByRange(mergedCellRange)) { + coords.row = selRange.to.row; + coords.col = selRange.to.col; + rangeExpanded = true; + } + } + } while (rangeExpanded); + } +}; +var beforeDrawAreaBorders = function(corners, className) { + if (className && className == 'area') { + var mergeCellsSetting = this.getSettings().mergeCells; + if (mergeCellsSetting) { + var selRange = this.getSelectedRange(); + var startRange = new WalkontableCellRange(selRange.from, selRange.from, selRange.from); + var stopRange = new WalkontableCellRange(selRange.to, selRange.to, selRange.to); + for (var i = 0, + ilen = this.mergeCells.mergedCellInfoCollection.length; i < ilen; i++) { + var cellInfo = this.mergeCells.mergedCellInfoCollection[i]; + var mergedCellTopLeft = new WalkontableCellCoords(cellInfo.row, cellInfo.col); + var mergedCellBottomRight = new WalkontableCellCoords(cellInfo.row + cellInfo.rowspan - 1, cellInfo.col + cellInfo.colspan - 1); + var mergedCellRange = new WalkontableCellRange(mergedCellTopLeft, mergedCellTopLeft, mergedCellBottomRight); + if (startRange.expandByRange(mergedCellRange)) { + corners[0] = startRange.from.row; + corners[1] = startRange.from.col; + } + if (stopRange.expandByRange(mergedCellRange)) { + corners[2] = stopRange.from.row; + corners[3] = stopRange.from.col; + } + } + } + } +}; +var afterGetCellMeta = function(row, col, cellProperties) { + var mergeCellsSetting = this.getSettings().mergeCells; + if (mergeCellsSetting) { + var mergeParent = this.mergeCells.mergedCellInfoCollection.getInfo(row, col); + if (mergeParent && (mergeParent.row != row || mergeParent.col != col)) { + cellProperties.copyable = false; + } + } +}; +var afterViewportRowCalculatorOverride = function(calc) { + var mergeCellsSetting = this.getSettings().mergeCells; + if (mergeCellsSetting) { + var colCount = this.countCols(); + var mergeParent; + for (var c = 0; c < colCount; c++) { + mergeParent = this.mergeCells.mergedCellInfoCollection.getInfo(calc.startRow, c); + if (mergeParent) { + if (mergeParent.row < calc.startRow) { + calc.startRow = mergeParent.row; + return afterViewportRowCalculatorOverride.call(this, calc); + } + } + mergeParent = this.mergeCells.mergedCellInfoCollection.getInfo(calc.endRow, c); + if (mergeParent) { + var mergeEnd = mergeParent.row + mergeParent.rowspan - 1; + if (mergeEnd > calc.endRow) { + calc.endRow = mergeEnd; + return afterViewportRowCalculatorOverride.call(this, calc); + } + } + } + } +}; +var afterViewportColumnCalculatorOverride = function(calc) { + var mergeCellsSetting = this.getSettings().mergeCells; + if (mergeCellsSetting) { + var rowCount = this.countRows(); + var mergeParent; + for (var r = 0; r < rowCount; r++) { + mergeParent = this.mergeCells.mergedCellInfoCollection.getInfo(r, calc.startColumn); + if (mergeParent) { + if (mergeParent.col < calc.startColumn) { + calc.startColumn = mergeParent.col; + return afterViewportColumnCalculatorOverride.call(this, calc); + } + } + mergeParent = this.mergeCells.mergedCellInfoCollection.getInfo(r, calc.endColumn); + if (mergeParent) { + var mergeEnd = mergeParent.col + mergeParent.colspan - 1; + if (mergeEnd > calc.endColumn) { + calc.endColumn = mergeEnd; + return afterViewportColumnCalculatorOverride.call(this, calc); + } + } + } + } +}; +var isMultipleSelection = function(isMultiple) { + if (isMultiple && this.mergeCells) { + var mergedCells = this.mergeCells.mergedCellInfoCollection, + selectionRange = this.getSelectedRange(); + for (var group in mergedCells) { + if (selectionRange.highlight.row == mergedCells[group].row && selectionRange.highlight.col == mergedCells[group].col && selectionRange.to.row == mergedCells[group].row + mergedCells[group].rowspan - 1 && selectionRange.to.col == mergedCells[group].col + mergedCells[group].colspan - 1) { + return false; + } + } + } + return isMultiple; +}; +function afterAutofillApplyValues(select, drag) { + var mergeCellsSetting = this.getSettings().mergeCells; + if (!mergeCellsSetting || this.selection.isMultiple()) { + return; + } + var info = this.mergeCells.mergedCellInfoCollection.getInfo(select[0], select[1]); + if (info) { + select[0] = info.row; + select[1] = info.col; + select[2] = info.row + info.rowspan - 1; + select[3] = info.col + info.colspan - 1; + } +} +function onAfterCreateCol(col, count) { + if (this.mergeCells) { + this.mergeCells.shiftCollection('right', col, count); + } +} +function onAfterRemoveCol(col, count) { + if (this.mergeCells) { + this.mergeCells.shiftCollection('left', col, count); + } +} +function onAfterCreateRow(row, count) { + if (this.mergeCells) { + this.mergeCells.shiftCollection('down', row, count); + } +} +function onAfterRemoveRow(row, count) { + if (this.mergeCells) { + this.mergeCells.shiftCollection('up', row, count); + } +} +Handsontable.hooks.add('beforeInit', beforeInit); +Handsontable.hooks.add('afterInit', afterInit); +Handsontable.hooks.add('afterUpdateSettings', afterUpdateSettings); +Handsontable.hooks.add('beforeKeyDown', onBeforeKeyDown); +Handsontable.hooks.add('modifyTransformStart', modifyTransformFactory('modifyTransformStart')); +Handsontable.hooks.add('modifyTransformEnd', modifyTransformFactory('modifyTransformEnd')); +Handsontable.hooks.add('beforeSetRangeEnd', beforeSetRangeEnd); +Handsontable.hooks.add('beforeDrawBorders', beforeDrawAreaBorders); +Handsontable.hooks.add('afterIsMultipleSelection', isMultipleSelection); +Handsontable.hooks.add('afterRenderer', afterRenderer); +Handsontable.hooks.add('afterContextMenuDefaultOptions', addMergeActionsToContextMenu); +Handsontable.hooks.add('afterGetCellMeta', afterGetCellMeta); +Handsontable.hooks.add('afterViewportRowCalculatorOverride', afterViewportRowCalculatorOverride); +Handsontable.hooks.add('afterViewportColumnCalculatorOverride', afterViewportColumnCalculatorOverride); +Handsontable.hooks.add('afterAutofillApplyValues', afterAutofillApplyValues); +Handsontable.hooks.add('afterCreateCol', onAfterCreateCol); +Handsontable.hooks.add('afterRemoveCol', onAfterRemoveCol); +Handsontable.hooks.add('afterCreateRow', onAfterCreateRow); +Handsontable.hooks.add('afterRemoveRow', onAfterRemoveRow); +Handsontable.MergeCells = MergeCells; + +//# +},{"3rdparty/walkontable/src/cell/coords":5,"3rdparty/walkontable/src/cell/range":6,"3rdparty/walkontable/src/table":20,"helpers/dom/event":46,"plugins":57}],82:[function(require,module,exports){ +"use strict"; +Object.defineProperties(exports, { + MultipleSelectionHandles: {get: function() { + return MultipleSelectionHandles; + }}, + __esModule: {value: true} +}); +var $___46__46__47__46__46__47_helpers_47_dom_47_element__, + $___46__46__47__95_base__, + $___46__46__47__46__46__47_eventManager__, + $___46__46__47__46__46__47_plugins__; +var $__0 = ($___46__46__47__46__46__47_helpers_47_dom_47_element__ = require("helpers/dom/element"), $___46__46__47__46__46__47_helpers_47_dom_47_element__ && $___46__46__47__46__46__47_helpers_47_dom_47_element__.__esModule && $___46__46__47__46__46__47_helpers_47_dom_47_element__ || {default: $___46__46__47__46__46__47_helpers_47_dom_47_element__}), + getWindowScrollTop = $__0.getWindowScrollTop, + hasClass = $__0.hasClass, + getWindowScrollLeft = $__0.getWindowScrollLeft; +var BasePlugin = ($___46__46__47__95_base__ = require("_base"), $___46__46__47__95_base__ && $___46__46__47__95_base__.__esModule && $___46__46__47__95_base__ || {default: $___46__46__47__95_base__}).default; +var EventManager = ($___46__46__47__46__46__47_eventManager__ = require("eventManager"), $___46__46__47__46__46__47_eventManager__ && $___46__46__47__46__46__47_eventManager__.__esModule && $___46__46__47__46__46__47_eventManager__ || {default: $___46__46__47__46__46__47_eventManager__}).EventManager; +var registerPlugin = ($___46__46__47__46__46__47_plugins__ = require("plugins"), $___46__46__47__46__46__47_plugins__ && $___46__46__47__46__46__47_plugins__.__esModule && $___46__46__47__46__46__47_plugins__ || {default: $___46__46__47__46__46__47_plugins__}).registerPlugin; +var MultipleSelectionHandles = function MultipleSelectionHandles(hotInstance) { + $traceurRuntime.superConstructor($MultipleSelectionHandles).call(this, hotInstance); + this.dragged = []; + this.eventManager = null; + this.lastSetCell = null; +}; +var $MultipleSelectionHandles = MultipleSelectionHandles; +($traceurRuntime.createClass)(MultipleSelectionHandles, { + isEnabled: function() { + return Handsontable.mobileBrowser; + }, + enablePlugin: function() { + if (this.enabled) { + return; + } + if (!this.eventManager) { + this.eventManager = new EventManager(this); + } + this.registerListeners(); + $traceurRuntime.superGet(this, $MultipleSelectionHandles.prototype, "enablePlugin").call(this); + }, + registerListeners: function() { + var _this = this; + function removeFromDragged(query) { + if (_this.dragged.length === 1) { + _this.dragged.splice(0, _this.dragged.length); + return true; + } + var entryPosition = _this.dragged.indexOf(query); + if (entryPosition == -1) { + return false; + } else if (entryPosition === 0) { + _this.dragged = _this.dragged.slice(0, 1); + } else if (entryPosition == 1) { + _this.dragged = _this.dragged.slice(-1); + } + } + this.eventManager.addEventListener(this.hot.rootElement, 'touchstart', function(event) { + var selectedRange; + if (hasClass(event.target, 'topLeftSelectionHandle-HitArea')) { + selectedRange = _this.hot.getSelectedRange(); + _this.dragged.push('topLeft'); + _this.touchStartRange = { + width: selectedRange.getWidth(), + height: selectedRange.getHeight(), + direction: selectedRange.getDirection() + }; + event.preventDefault(); + return false; + } else if (hasClass(event.target, 'bottomRightSelectionHandle-HitArea')) { + selectedRange = _this.hot.getSelectedRange(); + _this.dragged.push('bottomRight'); + _this.touchStartRange = { + width: selectedRange.getWidth(), + height: selectedRange.getHeight(), + direction: selectedRange.getDirection() + }; + event.preventDefault(); + return false; + } + }); + this.eventManager.addEventListener(this.hot.rootElement, 'touchend', function(event) { + if (hasClass(event.target, 'topLeftSelectionHandle-HitArea')) { + removeFromDragged.call(_this, 'topLeft'); + _this.touchStartRange = void 0; + event.preventDefault(); + return false; + } else if (hasClass(event.target, 'bottomRightSelectionHandle-HitArea')) { + removeFromDragged.call(_this, 'bottomRight'); + _this.touchStartRange = void 0; + event.preventDefault(); + return false; + } + }); + this.eventManager.addEventListener(this.hot.rootElement, 'touchmove', function(event) { + var scrollTop = getWindowScrollTop(), + scrollLeft = getWindowScrollLeft(), + endTarget, + targetCoords, + selectedRange, + rangeWidth, + rangeHeight, + rangeDirection, + newRangeCoords; + if (_this.dragged.length === 0) { + return; + } + endTarget = document.elementFromPoint(event.touches[0].screenX - scrollLeft, event.touches[0].screenY - scrollTop); + if (!endTarget || endTarget === _this.lastSetCell) { + return; + } + if (endTarget.nodeName == 'TD' || endTarget.nodeName == 'TH') { + targetCoords = _this.hot.getCoords(endTarget); + if (targetCoords.col == -1) { + targetCoords.col = 0; + } + selectedRange = _this.hot.getSelectedRange(); + rangeWidth = selectedRange.getWidth(); + rangeHeight = selectedRange.getHeight(); + rangeDirection = selectedRange.getDirection(); + if (rangeWidth == 1 && rangeHeight == 1) { + _this.hot.selection.setRangeEnd(targetCoords); + } + newRangeCoords = _this.getCurrentRangeCoords(selectedRange, targetCoords, _this.touchStartRange.direction, rangeDirection, _this.dragged[0]); + if (newRangeCoords.start !== null) { + _this.hot.selection.setRangeStart(newRangeCoords.start); + } + _this.hot.selection.setRangeEnd(newRangeCoords.end); + _this.lastSetCell = endTarget; + } + event.preventDefault(); + }); + }, + getCurrentRangeCoords: function(selectedRange, currentTouch, touchStartDirection, currentDirection, draggedHandle) { + var topLeftCorner = selectedRange.getTopLeftCorner(), + bottomRightCorner = selectedRange.getBottomRightCorner(), + bottomLeftCorner = selectedRange.getBottomLeftCorner(), + topRightCorner = selectedRange.getTopRightCorner(); + var newCoords = { + start: null, + end: null + }; + switch (touchStartDirection) { + case 'NE-SW': + switch (currentDirection) { + case 'NE-SW': + case 'NW-SE': + if (draggedHandle == 'topLeft') { + newCoords = { + start: new WalkontableCellCoords(currentTouch.row, selectedRange.highlight.col), + end: new WalkontableCellCoords(bottomLeftCorner.row, currentTouch.col) + }; + } else { + newCoords = { + start: new WalkontableCellCoords(selectedRange.highlight.row, currentTouch.col), + end: new WalkontableCellCoords(currentTouch.row, topLeftCorner.col) + }; + } + break; + case 'SE-NW': + if (draggedHandle == 'bottomRight') { + newCoords = { + start: new WalkontableCellCoords(bottomRightCorner.row, currentTouch.col), + end: new WalkontableCellCoords(currentTouch.row, topLeftCorner.col) + }; + } + break; + } + break; + case 'NW-SE': + switch (currentDirection) { + case 'NE-SW': + if (draggedHandle == 'topLeft') { + newCoords = { + start: currentTouch, + end: bottomLeftCorner + }; + } else { + newCoords.end = currentTouch; + } + break; + case 'NW-SE': + if (draggedHandle == 'topLeft') { + newCoords = { + start: currentTouch, + end: bottomRightCorner + }; + } else { + newCoords.end = currentTouch; + } + break; + case 'SE-NW': + if (draggedHandle == 'topLeft') { + newCoords = { + start: currentTouch, + end: topLeftCorner + }; + } else { + newCoords.end = currentTouch; + } + break; + case 'SW-NE': + if (draggedHandle == 'topLeft') { + newCoords = { + start: currentTouch, + end: topRightCorner + }; + } else { + newCoords.end = currentTouch; + } + break; + } + break; + case 'SW-NE': + switch (currentDirection) { + case 'NW-SE': + if (draggedHandle == 'bottomRight') { + newCoords = { + start: new WalkontableCellCoords(currentTouch.row, topLeftCorner.col), + end: new WalkontableCellCoords(bottomLeftCorner.row, currentTouch.col) + }; + } else { + newCoords = { + start: new WalkontableCellCoords(topLeftCorner.row, currentTouch.col), + end: new WalkontableCellCoords(currentTouch.row, bottomRightCorner.col) + }; + } + break; + case 'SW-NE': + if (draggedHandle == 'topLeft') { + newCoords = { + start: new WalkontableCellCoords(selectedRange.highlight.row, currentTouch.col), + end: new WalkontableCellCoords(currentTouch.row, bottomRightCorner.col) + }; + } else { + newCoords = { + start: new WalkontableCellCoords(currentTouch.row, topLeftCorner.col), + end: new WalkontableCellCoords(topLeftCorner.row, currentTouch.col) + }; + } + break; + case 'SE-NW': + if (draggedHandle == 'bottomRight') { + newCoords = { + start: new WalkontableCellCoords(currentTouch.row, topRightCorner.col), + end: new WalkontableCellCoords(topLeftCorner.row, currentTouch.col) + }; + } else if (draggedHandle == 'topLeft') { + newCoords = { + start: bottomLeftCorner, + end: currentTouch + }; + } + break; + } + break; + case 'SE-NW': + switch (currentDirection) { + case 'NW-SE': + case 'NE-SW': + case 'SW-NE': + if (draggedHandle == 'topLeft') { + newCoords.end = currentTouch; + } + break; + case 'SE-NW': + if (draggedHandle == 'topLeft') { + newCoords.end = currentTouch; + } else { + newCoords = { + start: currentTouch, + end: topLeftCorner + }; + } + break; + } + break; + } + return newCoords; + }, + isDragged: function() { + return this.dragged.length > 0; + } +}, {}, BasePlugin); +; +registerPlugin('multipleSelectionHandles', MultipleSelectionHandles); + +//# +},{"_base":58,"eventManager":41,"helpers/dom/element":45,"plugins":57}],83:[function(require,module,exports){ +"use strict"; +Object.defineProperties(exports, { + ObserveChanges: {get: function() { + return ObserveChanges; + }}, + __esModule: {value: true} +}); +var $___46__46__47__46__46__47_plugins__, + $__jsonpatch__; +var registerPlugin = ($___46__46__47__46__46__47_plugins__ = require("plugins"), $___46__46__47__46__46__47_plugins__ && $___46__46__47__46__46__47_plugins__.__esModule && $___46__46__47__46__46__47_plugins__ || {default: $___46__46__47__46__46__47_plugins__}).registerPlugin; +var jsonpatch = ($__jsonpatch__ = require("jsonpatch"), $__jsonpatch__ && $__jsonpatch__.__esModule && $__jsonpatch__ || {default: $__jsonpatch__}).default; +; +function ObserveChanges() {} +Handsontable.hooks.add('afterLoadData', init); +Handsontable.hooks.add('afterUpdateSettings', init); +Handsontable.hooks.register('afterChangesObserved'); +function init() { + var instance = this; + var pluginEnabled = instance.getSettings().observeChanges; + if (pluginEnabled) { + if (instance.observer) { + destroy.call(instance); + } + createObserver.call(instance); + bindEvents.call(instance); + } else if (!pluginEnabled) { + destroy.call(instance); + } +} +function createObserver() { + var instance = this; + instance.observeChangesActive = true; + instance.pauseObservingChanges = function() { + instance.observeChangesActive = false; + }; + instance.resumeObservingChanges = function() { + instance.observeChangesActive = true; + }; + instance.observedData = instance.getSourceData(); + instance.observer = jsonpatch.observe(instance.observedData, function(patches) { + if (instance.observeChangesActive) { + runHookForOperation.call(instance, patches); + instance.render(); + } + instance.runHooks('afterChangesObserved'); + }); +} +function runHookForOperation(rawPatches) { + var instance = this; + var patches = cleanPatches(rawPatches); + for (var i = 0, + len = patches.length; i < len; i++) { + var patch = patches[i]; + var parsedPath = parsePath(patch.path); + switch (patch.op) { + case 'add': + if (isNaN(parsedPath.col)) { + instance.runHooks('afterCreateRow', parsedPath.row); + } else { + instance.runHooks('afterCreateCol', parsedPath.col); + } + break; + case 'remove': + if (isNaN(parsedPath.col)) { + instance.runHooks('afterRemoveRow', parsedPath.row, 1); + } else { + instance.runHooks('afterRemoveCol', parsedPath.col, 1); + } + break; + case 'replace': + instance.runHooks('afterChange', [parsedPath.row, parsedPath.col, null, patch.value], 'external'); + break; + } + } + function cleanPatches(rawPatches) { + var patches; + patches = removeLengthRelatedPatches(rawPatches); + patches = removeMultipleAddOrRemoveColPatches(patches); + return patches; + } + function removeMultipleAddOrRemoveColPatches(rawPatches) { + var newOrRemovedColumns = []; + return rawPatches.filter(function(patch) { + var parsedPath = parsePath(patch.path); + if (['add', 'remove'].indexOf(patch.op) != -1 && !isNaN(parsedPath.col)) { + if (newOrRemovedColumns.indexOf(parsedPath.col) != -1) { + return false; + } else { + newOrRemovedColumns.push(parsedPath.col); + } + } + return true; + }); + } + function removeLengthRelatedPatches(rawPatches) { + return rawPatches.filter(function(patch) { + return !/[/]length/ig.test(patch.path); + }); + } + function parsePath(path) { + var match = path.match(/^\/(\d+)\/?(.*)?$/); + return { + row: parseInt(match[1], 10), + col: /^\d*$/.test(match[2]) ? parseInt(match[2], 10) : match[2] + }; + } +} +function destroy() { + var instance = this; + if (instance.observer) { + destroyObserver.call(instance); + unbindEvents.call(instance); + } +} +function destroyObserver() { + var instance = this; + jsonpatch.unobserve(instance.observedData, instance.observer); + delete instance.observedData; + delete instance.observeChangesActive; + delete instance.pauseObservingChanges; + delete instance.resumeObservingChanges; +} +function bindEvents() { + var instance = this; + instance.addHook('afterDestroy', destroy); + instance.addHook('afterCreateRow', afterTableAlter); + instance.addHook('afterRemoveRow', afterTableAlter); + instance.addHook('afterCreateCol', afterTableAlter); + instance.addHook('afterRemoveCol', afterTableAlter); + instance.addHook('afterChange', function(changes, source) { + if (source != 'loadData') { + afterTableAlter.call(this); + } + }); +} +function unbindEvents() { + var instance = this; + instance.removeHook('afterDestroy', destroy); + instance.removeHook('afterCreateRow', afterTableAlter); + instance.removeHook('afterRemoveRow', afterTableAlter); + instance.removeHook('afterCreateCol', afterTableAlter); + instance.removeHook('afterRemoveCol', afterTableAlter); + instance.removeHook('afterChange', afterTableAlter); +} +function afterTableAlter() { + var instance = this; + instance.pauseObservingChanges(); + instance.addHookOnce('afterChangesObserved', function() { + instance.resumeObservingChanges(); + }); +} + +//# +},{"jsonpatch":"jsonpatch","plugins":57}],84:[function(require,module,exports){ +"use strict"; +Object.defineProperties(exports, { + HandsontablePersistentState: {get: function() { + return HandsontablePersistentState; + }}, + __esModule: {value: true} +}); +var $___46__46__47__46__46__47_plugins__; +var registerPlugin = ($___46__46__47__46__46__47_plugins__ = require("plugins"), $___46__46__47__46__46__47_plugins__ && $___46__46__47__46__46__47_plugins__.__esModule && $___46__46__47__46__46__47_plugins__ || {default: $___46__46__47__46__46__47_plugins__}).registerPlugin; +; +function Storage(prefix) { + var savedKeys; + var saveSavedKeys = function() { + window.localStorage[prefix + '__' + 'persistentStateKeys'] = JSON.stringify(savedKeys); + }; + var loadSavedKeys = function() { + var keysJSON = window.localStorage[prefix + '__' + 'persistentStateKeys']; + var keys = typeof keysJSON == 'string' ? JSON.parse(keysJSON) : void 0; + savedKeys = keys ? keys : []; + }; + var clearSavedKeys = function() { + savedKeys = []; + saveSavedKeys(); + }; + loadSavedKeys(); + this.saveValue = function(key, value) { + window.localStorage[prefix + '_' + key] = JSON.stringify(value); + if (savedKeys.indexOf(key) == -1) { + savedKeys.push(key); + saveSavedKeys(); + } + }; + this.loadValue = function(key, defaultValue) { + key = typeof key === 'undefined' ? defaultValue : key; + var value = window.localStorage[prefix + '_' + key]; + return typeof value == 'undefined' ? void 0 : JSON.parse(value); + }; + this.reset = function(key) { + window.localStorage.removeItem(prefix + '_' + key); + }; + this.resetAll = function() { + for (var index = 0; index < savedKeys.length; index++) { + window.localStorage.removeItem(prefix + '_' + savedKeys[index]); + } + clearSavedKeys(); + }; +} +function HandsontablePersistentState() { + var plugin = this; + this.init = function() { + var instance = this, + pluginSettings = instance.getSettings().persistentState; + plugin.enabled = !!(pluginSettings); + if (!plugin.enabled) { + removeHooks.call(instance); + return; + } + if (!instance.storage) { + instance.storage = new Storage(instance.rootElement.id); + } + instance.resetState = plugin.resetValue; + addHooks.call(instance); + }; + this.saveValue = function(key, value) { + var instance = this; + instance.storage.saveValue(key, value); + }; + this.loadValue = function(key, saveTo) { + var instance = this; + saveTo.value = instance.storage.loadValue(key); + }; + this.resetValue = function(key) { + var instance = this; + if (typeof key === 'undefined') { + instance.storage.resetAll(); + } else { + instance.storage.reset(key); + } + }; + var hooks = { + persistentStateSave: plugin.saveValue, + persistentStateLoad: plugin.loadValue, + persistentStateReset: plugin.resetValue + }; + for (var hookName in hooks) { + if (hooks.hasOwnProperty(hookName)) { + Handsontable.hooks.register(hookName); + } + } + function addHooks() { + var instance = this; + for (var hookName in hooks) { + if (hooks.hasOwnProperty(hookName)) { + instance.addHook(hookName, hooks[hookName]); + } + } + } + function removeHooks() { + var instance = this; + for (var hookName in hooks) { + if (hooks.hasOwnProperty(hookName)) { + instance.removeHook(hookName, hooks[hookName]); + } + } + } +} +var htPersistentState = new HandsontablePersistentState(); +Handsontable.hooks.add('beforeInit', htPersistentState.init); +Handsontable.hooks.add('afterUpdateSettings', htPersistentState.init); + +//# +},{"plugins":57}],85:[function(require,module,exports){ +"use strict"; +var $___46__46__47__46__46__47_helpers_47_dom_47_element__, + $___46__46__47__46__46__47_renderers__; +var $__0 = ($___46__46__47__46__46__47_helpers_47_dom_47_element__ = require("helpers/dom/element"), $___46__46__47__46__46__47_helpers_47_dom_47_element__ && $___46__46__47__46__46__47_helpers_47_dom_47_element__.__esModule && $___46__46__47__46__46__47_helpers_47_dom_47_element__ || {default: $___46__46__47__46__46__47_helpers_47_dom_47_element__}), + addClass = $__0.addClass, + removeClass = $__0.removeClass; +var $__1 = ($___46__46__47__46__46__47_renderers__ = require("renderers"), $___46__46__47__46__46__47_renderers__ && $___46__46__47__46__46__47_renderers__.__esModule && $___46__46__47__46__46__47_renderers__ || {default: $___46__46__47__46__46__47_renderers__}), + registerRenderer = $__1.registerRenderer, + getRenderer = $__1.getRenderer; +Handsontable.Search = function Search(instance) { + this.query = function(queryStr, callback, queryMethod) { + var rowCount = instance.countRows(); + var colCount = instance.countCols(); + var queryResult = []; + if (!callback) { + callback = Handsontable.Search.global.getDefaultCallback(); + } + if (!queryMethod) { + queryMethod = Handsontable.Search.global.getDefaultQueryMethod(); + } + for (var rowIndex = 0; rowIndex < rowCount; rowIndex++) { + for (var colIndex = 0; colIndex < colCount; colIndex++) { + var cellData = instance.getDataAtCell(rowIndex, colIndex); + var cellProperties = instance.getCellMeta(rowIndex, colIndex); + var cellCallback = cellProperties.search.callback || callback; + var cellQueryMethod = cellProperties.search.queryMethod || queryMethod; + var testResult = cellQueryMethod(queryStr, cellData); + if (testResult) { + var singleResult = { + row: rowIndex, + col: colIndex, + data: cellData + }; + queryResult.push(singleResult); + } + if (cellCallback) { + cellCallback(instance, rowIndex, colIndex, cellData, testResult); + } + } + } + return queryResult; + }; +}; +Handsontable.Search.DEFAULT_CALLBACK = function(instance, row, col, data, testResult) { + instance.getCellMeta(row, col).isSearchResult = testResult; +}; +Handsontable.Search.DEFAULT_QUERY_METHOD = function(query, value) { + if (typeof query == 'undefined' || query == null || !query.toLowerCase || query.length === 0) { + return false; + } + if (typeof value == 'undefined' || value == null) { + return false; + } + return value.toString().toLowerCase().indexOf(query.toLowerCase()) != -1; +}; +Handsontable.Search.DEFAULT_SEARCH_RESULT_CLASS = 'htSearchResult'; +Handsontable.Search.global = (function() { + var defaultCallback = Handsontable.Search.DEFAULT_CALLBACK; + var defaultQueryMethod = Handsontable.Search.DEFAULT_QUERY_METHOD; + var defaultSearchResultClass = Handsontable.Search.DEFAULT_SEARCH_RESULT_CLASS; + return { + getDefaultCallback: function() { + return defaultCallback; + }, + setDefaultCallback: function(newDefaultCallback) { + defaultCallback = newDefaultCallback; + }, + getDefaultQueryMethod: function() { + return defaultQueryMethod; + }, + setDefaultQueryMethod: function(newDefaultQueryMethod) { + defaultQueryMethod = newDefaultQueryMethod; + }, + getDefaultSearchResultClass: function() { + return defaultSearchResultClass; + }, + setDefaultSearchResultClass: function(newSearchResultClass) { + defaultSearchResultClass = newSearchResultClass; + } + }; +})(); +Handsontable.SearchCellDecorator = function(instance, TD, row, col, prop, value, cellProperties) { + var searchResultClass = (cellProperties.search !== null && typeof cellProperties.search == 'object' && cellProperties.search.searchResultClass) || Handsontable.Search.global.getDefaultSearchResultClass(); + if (cellProperties.isSearchResult) { + addClass(TD, searchResultClass); + } else { + removeClass(TD, searchResultClass); + } +}; +var originalBaseRenderer = getRenderer('base'); +registerRenderer('base', function(instance, TD, row, col, prop, value, cellProperties) { + originalBaseRenderer.apply(this, arguments); + Handsontable.SearchCellDecorator.apply(this, arguments); +}); +function init() { + var instance = this; + var pluginEnabled = !!instance.getSettings().search; + if (pluginEnabled) { + instance.search = new Handsontable.Search(instance); + } else { + delete instance.search; + } +} +Handsontable.hooks.add('afterInit', init); +Handsontable.hooks.add('afterUpdateSettings', init); + +//# +},{"helpers/dom/element":45,"renderers":88}],86:[function(require,module,exports){ +"use strict"; +Object.defineProperties(exports, { + TouchScroll: {get: function() { + return TouchScroll; + }}, + __esModule: {value: true} +}); +var $___46__46__47__46__46__47_helpers_47_dom_47_element__, + $___46__46__47__95_base__, + $___46__46__47__46__46__47_plugins__; +var $__0 = ($___46__46__47__46__46__47_helpers_47_dom_47_element__ = require("helpers/dom/element"), $___46__46__47__46__46__47_helpers_47_dom_47_element__ && $___46__46__47__46__46__47_helpers_47_dom_47_element__.__esModule && $___46__46__47__46__46__47_helpers_47_dom_47_element__ || {default: $___46__46__47__46__46__47_helpers_47_dom_47_element__}), + addClass = $__0.addClass, + removeClass = $__0.removeClass; +var BasePlugin = ($___46__46__47__95_base__ = require("_base"), $___46__46__47__95_base__ && $___46__46__47__95_base__.__esModule && $___46__46__47__95_base__ || {default: $___46__46__47__95_base__}).default; +var registerPlugin = ($___46__46__47__46__46__47_plugins__ = require("plugins"), $___46__46__47__46__46__47_plugins__ && $___46__46__47__46__46__47_plugins__.__esModule && $___46__46__47__46__46__47_plugins__ || {default: $___46__46__47__46__46__47_plugins__}).registerPlugin; +var TouchScroll = function TouchScroll(hotInstance) { + var $__3 = this; + $traceurRuntime.superConstructor($TouchScroll).call(this, hotInstance); + this.hot.addHook('afterInit', (function() { + return $__3.afterInit(); + })); + this.hot.addHook('afterUpdateSettings', (function() { + return $__3.onAfterUpdateSettings(); + })); + this.scrollbars = []; + this.clones = []; +}; +var $TouchScroll = TouchScroll; +($traceurRuntime.createClass)(TouchScroll, { + afterInit: function() { + this.registerEvents(); + this.onAfterUpdateSettings(); + }, + onAfterUpdateSettings: function() { + var _this = this; + this.hot.addHookOnce('afterRender', function() { + var wtOverlays = _this.hot.view.wt.wtOverlays; + _this.scrollbars = []; + _this.scrollbars.push(wtOverlays.topOverlay); + if (wtOverlays.bottomOverlay.clone) { + _this.scrollbars.push(wtOverlays.bottomOverlay); + } + _this.scrollbars.push(wtOverlays.leftOverlay); + if (wtOverlays.topLeftCornerOverlay) { + _this.scrollbars.push(wtOverlays.topLeftCornerOverlay); + } + if (wtOverlays.bottomLeftCornerOverlay && wtOverlays.bottomLeftCornerOverlay.clone) { + _this.scrollbars.push(wtOverlays.bottomLeftCornerOverlay); + } + _this.clones = []; + if (wtOverlays.topOverlay.needFullRender) { + _this.clones.push(wtOverlays.topOverlay.clone.wtTable.holder.parentNode); + } + if (wtOverlays.bottomOverlay.needFullRender) { + _this.clones.push(wtOverlays.bottomOverlay.clone.wtTable.holder.parentNode); + } + if (wtOverlays.leftOverlay.needFullRender) { + _this.clones.push(wtOverlays.leftOverlay.clone.wtTable.holder.parentNode); + } + if (wtOverlays.topLeftCornerOverlay) { + _this.clones.push(wtOverlays.topLeftCornerOverlay.clone.wtTable.holder.parentNode); + } + if (wtOverlays.bottomLeftCornerOverlay && wtOverlays.bottomLeftCornerOverlay.clone) { + _this.clones.push(wtOverlays.bottomLeftCornerOverlay.clone.wtTable.holder.parentNode); + } + }); + }, + registerEvents: function() { + var $__3 = this; + this.hot.addHook('beforeTouchScroll', (function() { + return $__3.onBeforeTouchScroll(); + })); + this.hot.addHook('afterMomentumScroll', (function() { + return $__3.onAfterMomentumScroll(); + })); + }, + onBeforeTouchScroll: function() { + Handsontable.freezeOverlays = true; + for (var i = 0, + cloneCount = this.clones.length; i < cloneCount; i++) { + addClass(this.clones[i], 'hide-tween'); + } + }, + onAfterMomentumScroll: function() { + Handsontable.freezeOverlays = false; + var _that = this; + for (var i = 0, + cloneCount = this.clones.length; i < cloneCount; i++) { + removeClass(this.clones[i], 'hide-tween'); + } + for (var i$__5 = 0, + cloneCount$__6 = this.clones.length; i$__5 < cloneCount$__6; i$__5++) { + addClass(this.clones[i$__5], 'show-tween'); + } + setTimeout(function() { + for (var i = 0, + cloneCount = _that.clones.length; i < cloneCount; i++) { + removeClass(_that.clones[i], 'show-tween'); + } + }, 400); + for (var i$__7 = 0, + cloneCount$__8 = this.scrollbars.length; i$__7 < cloneCount$__8; i$__7++) { + this.scrollbars[i$__7].refresh(); + this.scrollbars[i$__7].resetFixedPosition(); + } + this.hot.view.wt.wtOverlays.syncScrollWithMaster(); + } +}, {}, BasePlugin); +; +registerPlugin('touchScroll', TouchScroll); + +//# +},{"_base":58,"helpers/dom/element":45,"plugins":57}],87:[function(require,module,exports){ +"use strict"; +var $___46__46__47__46__46__47_helpers_47_object__, + $___46__46__47__46__46__47_helpers_47_dom_47_event__; +var $__0 = ($___46__46__47__46__46__47_helpers_47_object__ = require("helpers/object"), $___46__46__47__46__46__47_helpers_47_object__ && $___46__46__47__46__46__47_helpers_47_object__.__esModule && $___46__46__47__46__46__47_helpers_47_object__ || {default: $___46__46__47__46__46__47_helpers_47_object__}), + inherit = $__0.inherit, + deepClone = $__0.deepClone; +var stopImmediatePropagation = ($___46__46__47__46__46__47_helpers_47_dom_47_event__ = require("helpers/dom/event"), $___46__46__47__46__46__47_helpers_47_dom_47_event__ && $___46__46__47__46__46__47_helpers_47_dom_47_event__.__esModule && $___46__46__47__46__46__47_helpers_47_dom_47_event__ || {default: $___46__46__47__46__46__47_helpers_47_dom_47_event__}).stopImmediatePropagation; +Handsontable.UndoRedo = function(instance) { + var plugin = this; + this.instance = instance; + this.doneActions = []; + this.undoneActions = []; + this.ignoreNewActions = false; + instance.addHook('afterChange', function(changes, origin) { + if (changes) { + var action = new Handsontable.UndoRedo.ChangeAction(changes); + plugin.done(action); + } + }); + instance.addHook('afterCreateRow', function(index, amount, createdAutomatically) { + if (createdAutomatically) { + return; + } + var action = new Handsontable.UndoRedo.CreateRowAction(index, amount); + plugin.done(action); + }); + instance.addHook('beforeRemoveRow', function(index, amount) { + var originalData = plugin.instance.getSourceData(); + index = (originalData.length + index) % originalData.length; + var removedData = originalData.slice(index, index + amount); + var action = new Handsontable.UndoRedo.RemoveRowAction(index, removedData); + plugin.done(action); + }); + instance.addHook('afterCreateCol', function(index, amount, createdAutomatically) { + if (createdAutomatically) { + return; + } + var action = new Handsontable.UndoRedo.CreateColumnAction(index, amount); + plugin.done(action); + }); + instance.addHook('beforeRemoveCol', function(index, amount) { + var originalData = plugin.instance.getSourceData(); + index = (plugin.instance.countCols() + index) % plugin.instance.countCols(); + var removedData = []; + for (var i = 0, + len = originalData.length; i < len; i++) { + removedData[i] = originalData[i].slice(index, index + amount); + } + var headers; + if (Array.isArray(instance.getSettings().colHeaders)) { + headers = instance.getSettings().colHeaders.slice(index, index + removedData.length); + } + var action = new Handsontable.UndoRedo.RemoveColumnAction(index, removedData, headers); + plugin.done(action); + }); + instance.addHook('beforeCellAlignment', function(stateBefore, range, type, alignment) { + var action = new Handsontable.UndoRedo.CellAlignmentAction(stateBefore, range, type, alignment); + plugin.done(action); + }); +}; +Handsontable.UndoRedo.prototype.done = function(action) { + if (!this.ignoreNewActions) { + this.doneActions.push(action); + this.undoneActions.length = 0; + } +}; +Handsontable.UndoRedo.prototype.undo = function() { + if (this.isUndoAvailable()) { + var action = this.doneActions.pop(); + this.ignoreNewActions = true; + var that = this; + action.undo(this.instance, function() { + that.ignoreNewActions = false; + that.undoneActions.push(action); + }); + } +}; +Handsontable.UndoRedo.prototype.redo = function() { + if (this.isRedoAvailable()) { + var action = this.undoneActions.pop(); + this.ignoreNewActions = true; + var that = this; + action.redo(this.instance, function() { + that.ignoreNewActions = false; + that.doneActions.push(action); + }); + } +}; +Handsontable.UndoRedo.prototype.isUndoAvailable = function() { + return this.doneActions.length > 0; +}; +Handsontable.UndoRedo.prototype.isRedoAvailable = function() { + return this.undoneActions.length > 0; +}; +Handsontable.UndoRedo.prototype.clear = function() { + this.doneActions.length = 0; + this.undoneActions.length = 0; +}; +Handsontable.UndoRedo.Action = function() {}; +Handsontable.UndoRedo.Action.prototype.undo = function() {}; +Handsontable.UndoRedo.Action.prototype.redo = function() {}; +Handsontable.UndoRedo.ChangeAction = function(changes) { + this.changes = changes; +}; +inherit(Handsontable.UndoRedo.ChangeAction, Handsontable.UndoRedo.Action); +Handsontable.UndoRedo.ChangeAction.prototype.undo = function(instance, undoneCallback) { + var data = deepClone(this.changes), + emptyRowsAtTheEnd = instance.countEmptyRows(true), + emptyColsAtTheEnd = instance.countEmptyCols(true); + for (var i = 0, + len = data.length; i < len; i++) { + data[i].splice(3, 1); + } + instance.addHookOnce('afterChange', undoneCallback); + instance.setDataAtRowProp(data, null, null, 'undo'); + for (var i = 0, + len = data.length; i < len; i++) { + if (instance.getSettings().minSpareRows && data[i][0] + 1 + instance.getSettings().minSpareRows === instance.countRows() && emptyRowsAtTheEnd == instance.getSettings().minSpareRows) { + instance.alter('remove_row', parseInt(data[i][0] + 1, 10), instance.getSettings().minSpareRows); + instance.undoRedo.doneActions.pop(); + } + if (instance.getSettings().minSpareCols && data[i][1] + 1 + instance.getSettings().minSpareCols === instance.countCols() && emptyColsAtTheEnd == instance.getSettings().minSpareCols) { + instance.alter('remove_col', parseInt(data[i][1] + 1, 10), instance.getSettings().minSpareCols); + instance.undoRedo.doneActions.pop(); + } + } +}; +Handsontable.UndoRedo.ChangeAction.prototype.redo = function(instance, onFinishCallback) { + var data = deepClone(this.changes); + for (var i = 0, + len = data.length; i < len; i++) { + data[i].splice(2, 1); + } + instance.addHookOnce('afterChange', onFinishCallback); + instance.setDataAtRowProp(data, null, null, 'redo'); +}; +Handsontable.UndoRedo.CreateRowAction = function(index, amount) { + this.index = index; + this.amount = amount; +}; +inherit(Handsontable.UndoRedo.CreateRowAction, Handsontable.UndoRedo.Action); +Handsontable.UndoRedo.CreateRowAction.prototype.undo = function(instance, undoneCallback) { + var rowCount = instance.countRows(), + minSpareRows = instance.getSettings().minSpareRows; + if (this.index >= rowCount && this.index - minSpareRows < rowCount) { + this.index -= minSpareRows; + } + instance.addHookOnce('afterRemoveRow', undoneCallback); + instance.alter('remove_row', this.index, this.amount); +}; +Handsontable.UndoRedo.CreateRowAction.prototype.redo = function(instance, redoneCallback) { + instance.addHookOnce('afterCreateRow', redoneCallback); + instance.alter('insert_row', this.index + 1, this.amount); +}; +Handsontable.UndoRedo.RemoveRowAction = function(index, data) { + this.index = index; + this.data = data; +}; +inherit(Handsontable.UndoRedo.RemoveRowAction, Handsontable.UndoRedo.Action); +Handsontable.UndoRedo.RemoveRowAction.prototype.undo = function(instance, undoneCallback) { + var spliceArgs = [this.index, 0]; + Array.prototype.push.apply(spliceArgs, this.data); + Array.prototype.splice.apply(instance.getSourceData(), spliceArgs); + instance.addHookOnce('afterRender', undoneCallback); + instance.render(); +}; +Handsontable.UndoRedo.RemoveRowAction.prototype.redo = function(instance, redoneCallback) { + instance.addHookOnce('afterRemoveRow', redoneCallback); + instance.alter('remove_row', this.index, this.data.length); +}; +Handsontable.UndoRedo.CreateColumnAction = function(index, amount) { + this.index = index; + this.amount = amount; +}; +inherit(Handsontable.UndoRedo.CreateColumnAction, Handsontable.UndoRedo.Action); +Handsontable.UndoRedo.CreateColumnAction.prototype.undo = function(instance, undoneCallback) { + instance.addHookOnce('afterRemoveCol', undoneCallback); + instance.alter('remove_col', this.index, this.amount); +}; +Handsontable.UndoRedo.CreateColumnAction.prototype.redo = function(instance, redoneCallback) { + instance.addHookOnce('afterCreateCol', redoneCallback); + instance.alter('insert_col', this.index + 1, this.amount); +}; +Handsontable.UndoRedo.CellAlignmentAction = function(stateBefore, range, type, alignment) { + this.stateBefore = stateBefore; + this.range = range; + this.type = type; + this.alignment = alignment; +}; +Handsontable.UndoRedo.CellAlignmentAction.prototype.undo = function(instance, undoneCallback) { + if (!instance.getPlugin('contextMenu').isEnabled()) { + return; + } + for (var row = this.range.from.row; row <= this.range.to.row; row++) { + for (var col = this.range.from.col; col <= this.range.to.col; col++) { + instance.setCellMeta(row, col, 'className', this.stateBefore[row][col] || ' htLeft'); + } + } + instance.addHookOnce('afterRender', undoneCallback); + instance.render(); +}; +Handsontable.UndoRedo.CellAlignmentAction.prototype.redo = function(instance, undoneCallback) { + if (!instance.getPlugin('contextMenu').isEnabled()) { + return; + } + instance.selectCell(this.range.from.row, this.range.from.col, this.range.to.row, this.range.to.col); + instance.getPlugin('contextMenu').executeCommand('alignment:' + this.alignment.replace('ht', '').toLowerCase()); + instance.addHookOnce('afterRender', undoneCallback); + instance.render(); +}; +Handsontable.UndoRedo.RemoveColumnAction = function(index, data, headers) { + this.index = index; + this.data = data; + this.amount = this.data[0].length; + this.headers = headers; +}; +inherit(Handsontable.UndoRedo.RemoveColumnAction, Handsontable.UndoRedo.Action); +Handsontable.UndoRedo.RemoveColumnAction.prototype.undo = function(instance, undoneCallback) { + var row, + spliceArgs; + for (var i = 0, + len = instance.getSourceData().length; i < len; i++) { + row = instance.getSourceDataAtRow(i); + spliceArgs = [this.index, 0]; + Array.prototype.push.apply(spliceArgs, this.data[i]); + Array.prototype.splice.apply(row, spliceArgs); + } + if (typeof this.headers != 'undefined') { + spliceArgs = [this.index, 0]; + Array.prototype.push.apply(spliceArgs, this.headers); + Array.prototype.splice.apply(instance.getSettings().colHeaders, spliceArgs); + } + instance.addHookOnce('afterRender', undoneCallback); + instance.render(); +}; +Handsontable.UndoRedo.RemoveColumnAction.prototype.redo = function(instance, redoneCallback) { + instance.addHookOnce('afterRemoveCol', redoneCallback); + instance.alter('remove_col', this.index, this.amount); +}; +function init() { + var instance = this; + var pluginEnabled = typeof instance.getSettings().undo == 'undefined' || instance.getSettings().undo; + if (pluginEnabled) { + if (!instance.undoRedo) { + instance.undoRedo = new Handsontable.UndoRedo(instance); + exposeUndoRedoMethods(instance); + instance.addHook('beforeKeyDown', onBeforeKeyDown); + instance.addHook('afterChange', onAfterChange); + } + } else { + if (instance.undoRedo) { + delete instance.undoRedo; + removeExposedUndoRedoMethods(instance); + instance.removeHook('beforeKeyDown', onBeforeKeyDown); + instance.removeHook('afterChange', onAfterChange); + } + } +} +function onBeforeKeyDown(event) { + var instance = this; + var ctrlDown = (event.ctrlKey || event.metaKey) && !event.altKey; + if (ctrlDown) { + if (event.keyCode === 89 || (event.shiftKey && event.keyCode === 90)) { + instance.undoRedo.redo(); + stopImmediatePropagation(event); + } else if (event.keyCode === 90) { + instance.undoRedo.undo(); + stopImmediatePropagation(event); + } + } +} +function onAfterChange(changes, source) { + var instance = this; + if (source == 'loadData') { + return instance.undoRedo.clear(); + } +} +function exposeUndoRedoMethods(instance) { + instance.undo = function() { + return instance.undoRedo.undo(); + }; + instance.redo = function() { + return instance.undoRedo.redo(); + }; + instance.isUndoAvailable = function() { + return instance.undoRedo.isUndoAvailable(); + }; + instance.isRedoAvailable = function() { + return instance.undoRedo.isRedoAvailable(); + }; + instance.clearUndo = function() { + return instance.undoRedo.clear(); + }; +} +function removeExposedUndoRedoMethods(instance) { + delete instance.undo; + delete instance.redo; + delete instance.isUndoAvailable; + delete instance.isRedoAvailable; + delete instance.clearUndo; +} +Handsontable.hooks.add('afterInit', init); +Handsontable.hooks.add('afterUpdateSettings', init); + +//# +},{"helpers/dom/event":46,"helpers/object":50}],88:[function(require,module,exports){ +"use strict"; +Object.defineProperties(exports, { + registerRenderer: {get: function() { + return registerRenderer; + }}, + getRenderer: {get: function() { + return getRenderer; + }}, + hasRenderer: {get: function() { + return hasRenderer; + }}, + __esModule: {value: true} +}); +var $__helpers_47_string__; +var toUpperCaseFirst = ($__helpers_47_string__ = require("helpers/string"), $__helpers_47_string__ && $__helpers_47_string__.__esModule && $__helpers_47_string__ || {default: $__helpers_47_string__}).toUpperCaseFirst; +var registeredRenderers = {}; +Handsontable.renderers = Handsontable.renderers || {}; +Handsontable.renderers.registerRenderer = registerRenderer; +Handsontable.renderers.getRenderer = getRenderer; +function registerRenderer(rendererName, rendererFunction) { + var registerName; + registeredRenderers[rendererName] = rendererFunction; + registerName = toUpperCaseFirst(rendererName) + 'Renderer'; + Handsontable.renderers[registerName] = rendererFunction; + Handsontable[registerName] = rendererFunction; +} +function getRenderer(rendererName) { + if (typeof rendererName == 'function') { + return rendererName; + } + if (typeof rendererName != 'string') { + throw Error('Only strings and functions can be passed as "renderer" parameter'); + } + if (!(rendererName in registeredRenderers)) { + throw Error('No editor registered under name "' + rendererName + '"'); + } + return registeredRenderers[rendererName]; +} +function hasRenderer(rendererName) { + return rendererName in registeredRenderers; +} +; + +//# +},{"helpers/string":52}],89:[function(require,module,exports){ +"use strict"; +Object.defineProperties(exports, { + cellDecorator: {get: function() { + return cellDecorator; + }}, + __esModule: {value: true} +}); +var $___46__46__47_helpers_47_dom_47_element__, + $___46__46__47_renderers__; +var $__0 = ($___46__46__47_helpers_47_dom_47_element__ = require("helpers/dom/element"), $___46__46__47_helpers_47_dom_47_element__ && $___46__46__47_helpers_47_dom_47_element__.__esModule && $___46__46__47_helpers_47_dom_47_element__ || {default: $___46__46__47_helpers_47_dom_47_element__}), + addClass = $__0.addClass, + removeClass = $__0.removeClass; +var registerRenderer = ($___46__46__47_renderers__ = require("renderers"), $___46__46__47_renderers__ && $___46__46__47_renderers__.__esModule && $___46__46__47_renderers__ || {default: $___46__46__47_renderers__}).registerRenderer; +; +registerRenderer('base', cellDecorator); +Handsontable.renderers.cellDecorator = cellDecorator; +function cellDecorator(instance, TD, row, col, prop, value, cellProperties) { + if (cellProperties.className) { + if (TD.className) { + TD.className = TD.className + ' ' + cellProperties.className; + } else { + TD.className = cellProperties.className; + } + } + if (cellProperties.readOnly) { + addClass(TD, cellProperties.readOnlyCellClassName); + } + if (cellProperties.valid === false && cellProperties.invalidCellClassName) { + addClass(TD, cellProperties.invalidCellClassName); + } else { + removeClass(TD, cellProperties.invalidCellClassName); + } + if (cellProperties.wordWrap === false && cellProperties.noWordWrapClassName) { + addClass(TD, cellProperties.noWordWrapClassName); + } + if (!value && cellProperties.placeholder) { + addClass(TD, cellProperties.placeholderCellClassName); + } +} + +//# +},{"helpers/dom/element":45,"renderers":88}],90:[function(require,module,exports){ +"use strict"; +Object.defineProperties(exports, { + autocompleteRenderer: {get: function() { + return autocompleteRenderer; + }}, + __esModule: {value: true} +}); +var $___46__46__47_helpers_47_dom_47_element__, + $___46__46__47_eventManager__, + $___46__46__47_renderers__, + $___46__46__47_3rdparty_47_walkontable_47_src_47_cell_47_coords__; +var $__0 = ($___46__46__47_helpers_47_dom_47_element__ = require("helpers/dom/element"), $___46__46__47_helpers_47_dom_47_element__ && $___46__46__47_helpers_47_dom_47_element__.__esModule && $___46__46__47_helpers_47_dom_47_element__ || {default: $___46__46__47_helpers_47_dom_47_element__}), + addClass = $__0.addClass, + hasClass = $__0.hasClass, + empty = $__0.empty; +var eventManagerObject = ($___46__46__47_eventManager__ = require("eventManager"), $___46__46__47_eventManager__ && $___46__46__47_eventManager__.__esModule && $___46__46__47_eventManager__ || {default: $___46__46__47_eventManager__}).eventManager; +var $__2 = ($___46__46__47_renderers__ = require("renderers"), $___46__46__47_renderers__ && $___46__46__47_renderers__.__esModule && $___46__46__47_renderers__ || {default: $___46__46__47_renderers__}), + getRenderer = $__2.getRenderer, + registerRenderer = $__2.registerRenderer; +var WalkontableCellCoords = ($___46__46__47_3rdparty_47_walkontable_47_src_47_cell_47_coords__ = require("3rdparty/walkontable/src/cell/coords"), $___46__46__47_3rdparty_47_walkontable_47_src_47_cell_47_coords__ && $___46__46__47_3rdparty_47_walkontable_47_src_47_cell_47_coords__.__esModule && $___46__46__47_3rdparty_47_walkontable_47_src_47_cell_47_coords__ || {default: $___46__46__47_3rdparty_47_walkontable_47_src_47_cell_47_coords__}).WalkontableCellCoords; +var clonableWRAPPER = document.createElement('DIV'); +clonableWRAPPER.className = 'htAutocompleteWrapper'; +var clonableARROW = document.createElement('DIV'); +clonableARROW.className = 'htAutocompleteArrow'; +clonableARROW.appendChild(document.createTextNode(String.fromCharCode(9660))); +var wrapTdContentWithWrapper = function(TD, WRAPPER) { + WRAPPER.innerHTML = TD.innerHTML; + empty(TD); + TD.appendChild(WRAPPER); +}; +function autocompleteRenderer(instance, TD, row, col, prop, value, cellProperties) { + var WRAPPER = clonableWRAPPER.cloneNode(true); + var ARROW = clonableARROW.cloneNode(true); + getRenderer('text')(instance, TD, row, col, prop, value, cellProperties); + TD.appendChild(ARROW); + addClass(TD, 'htAutocomplete'); + if (!TD.firstChild) { + TD.appendChild(document.createTextNode(String.fromCharCode(160))); + } + if (!instance.acArrowListener) { + var eventManager = eventManagerObject(instance); + instance.acArrowListener = function(event) { + if (hasClass(event.target, 'htAutocompleteArrow')) { + instance.view.wt.getSetting('onCellDblClick', null, new WalkontableCellCoords(row, col), TD); + } + }; + eventManager.addEventListener(instance.rootElement, 'mousedown', instance.acArrowListener); + instance.addHookOnce('afterDestroy', function() { + eventManager.destroy(); + }); + } +} +; +registerRenderer('autocomplete', autocompleteRenderer); + +//# +},{"3rdparty/walkontable/src/cell/coords":5,"eventManager":41,"helpers/dom/element":45,"renderers":88}],91:[function(require,module,exports){ +"use strict"; +Object.defineProperties(exports, { + checkboxRenderer: {get: function() { + return checkboxRenderer; + }}, + __esModule: {value: true} +}); +var $___46__46__47_helpers_47_dom_47_element__, + $___46__46__47_helpers_47_string__, + $___46__46__47_eventManager__, + $___46__46__47_renderers__, + $___46__46__47_helpers_47_unicode__, + $___46__46__47_helpers_47_dom_47_event__; +var $__0 = ($___46__46__47_helpers_47_dom_47_element__ = require("helpers/dom/element"), $___46__46__47_helpers_47_dom_47_element__ && $___46__46__47_helpers_47_dom_47_element__.__esModule && $___46__46__47_helpers_47_dom_47_element__ || {default: $___46__46__47_helpers_47_dom_47_element__}), + empty = $__0.empty, + addClass = $__0.addClass, + hasClass = $__0.hasClass; +var equalsIgnoreCase = ($___46__46__47_helpers_47_string__ = require("helpers/string"), $___46__46__47_helpers_47_string__ && $___46__46__47_helpers_47_string__.__esModule && $___46__46__47_helpers_47_string__ || {default: $___46__46__47_helpers_47_string__}).equalsIgnoreCase; +var EventManager = ($___46__46__47_eventManager__ = require("eventManager"), $___46__46__47_eventManager__ && $___46__46__47_eventManager__.__esModule && $___46__46__47_eventManager__ || {default: $___46__46__47_eventManager__}).EventManager; +var $__3 = ($___46__46__47_renderers__ = require("renderers"), $___46__46__47_renderers__ && $___46__46__47_renderers__.__esModule && $___46__46__47_renderers__ || {default: $___46__46__47_renderers__}), + getRenderer = $__3.getRenderer, + registerRenderer = $__3.registerRenderer; +var KEY_CODES = ($___46__46__47_helpers_47_unicode__ = require("helpers/unicode"), $___46__46__47_helpers_47_unicode__ && $___46__46__47_helpers_47_unicode__.__esModule && $___46__46__47_helpers_47_unicode__ || {default: $___46__46__47_helpers_47_unicode__}).KEY_CODES; +var $__5 = ($___46__46__47_helpers_47_dom_47_event__ = require("helpers/dom/event"), $___46__46__47_helpers_47_dom_47_event__ && $___46__46__47_helpers_47_dom_47_event__.__esModule && $___46__46__47_helpers_47_dom_47_event__ || {default: $___46__46__47_helpers_47_dom_47_event__}), + stopPropagation = $__5.stopPropagation, + stopImmediatePropagation = $__5.stopImmediatePropagation, + isImmediatePropagationStopped = $__5.isImmediatePropagationStopped; +var isListeningKeyDownEvent = new WeakMap(); +var BAD_VALUE_CLASS = 'htBadValue'; +function checkboxRenderer(instance, TD, row, col, prop, value, cellProperties) { + var eventManager = new EventManager(instance); + var input = createInput(); + var labelOptions = cellProperties.label; + var badValue = false; + if (typeof cellProperties.checkedTemplate === 'undefined') { + cellProperties.checkedTemplate = true; + } + if (typeof cellProperties.uncheckedTemplate === 'undefined') { + cellProperties.uncheckedTemplate = false; + } + empty(TD); + if (value === cellProperties.checkedTemplate || equalsIgnoreCase(value, cellProperties.checkedTemplate)) { + input.checked = true; + } else if (value === cellProperties.uncheckedTemplate || equalsIgnoreCase(value, cellProperties.uncheckedTemplate)) { + input.checked = false; + } else if (value === null) { + addClass(input, 'noValue'); + } else { + input.style.display = 'none'; + addClass(input, BAD_VALUE_CLASS); + badValue = true; + } + if (!badValue && labelOptions) { + var labelText = ''; + if (labelOptions.value) { + labelText = typeof labelOptions.value === 'function' ? labelOptions.value.call(this, row, col, prop, value) : labelOptions.value; + } else if (labelOptions.property) { + labelText = instance.getDataAtRowProp(row, labelOptions.property); + } + var label = createLabel(labelText); + if (labelOptions.position === 'before') { + label.appendChild(input); + } else { + label.insertBefore(input, label.firstChild); + } + input = label; + } + TD.appendChild(input); + if (badValue) { + TD.appendChild(document.createTextNode('#bad-value#')); + } + if (cellProperties.readOnly) { + eventManager.addEventListener(input, 'click', preventDefault); + } else { + eventManager.addEventListener(input, 'mousedown', stopPropagation); + eventManager.addEventListener(input, 'mouseup', stopPropagation); + eventManager.addEventListener(input, 'change', (function(event) { + instance.setDataAtRowProp(row, prop, event.target.checked ? cellProperties.checkedTemplate : cellProperties.uncheckedTemplate); + })); + } + if (!isListeningKeyDownEvent.has(instance)) { + isListeningKeyDownEvent.set(instance, true); + instance.addHook('beforeKeyDown', onBeforeKeyDown); + } + function onBeforeKeyDown(event) { + var allowedKeys = [KEY_CODES.SPACE, KEY_CODES.ENTER, KEY_CODES.DELETE, KEY_CODES.BACKSPACE]; + if (allowedKeys.indexOf(event.keyCode) !== -1 && !isImmediatePropagationStopped(event)) { + eachSelectedCheckboxCell(function() { + stopImmediatePropagation(event); + event.preventDefault(); + }); + } + if (event.keyCode == KEY_CODES.SPACE || event.keyCode == KEY_CODES.ENTER) { + toggleSelected(); + } + if (event.keyCode == KEY_CODES.DELETE || event.keyCode == KEY_CODES.BACKSPACE) { + toggleSelected(false); + } + } + function toggleSelected() { + var checked = arguments[0] !== (void 0) ? arguments[0] : null; + eachSelectedCheckboxCell(function(checkboxes) { + for (var i = 0, + len = checkboxes.length; i < len; i++) { + if (hasClass(checkboxes[i], BAD_VALUE_CLASS) && checked === null) { + return; + } + toggleCheckbox(checkboxes[i], checked); + } + }); + } + function toggleCheckbox(checkbox) { + var checked = arguments[1] !== (void 0) ? arguments[1] : null; + if (checked === null) { + checkbox.checked = !checkbox.checked; + } else { + checkbox.checked = checked; + } + eventManager.fireEvent(checkbox, 'change'); + } + function eachSelectedCheckboxCell(callback) { + var selRange = instance.getSelectedRange(); + var topLeft = selRange.getTopLeftCorner(); + var bottomRight = selRange.getBottomRightCorner(); + for (var row = topLeft.row; row <= bottomRight.row; row++) { + for (var col = topLeft.col; col <= bottomRight.col; col++) { + var cell = instance.getCell(row, col); + var cellProperties$__6 = instance.getCellMeta(row, col); + var checkboxes = cell.querySelectorAll('input[type=checkbox]'); + if (checkboxes.length > 0 && !cellProperties$__6.readOnly) { + callback(checkboxes); + } + } + } + } +} +; +registerRenderer('checkbox', checkboxRenderer); +function createInput() { + var input = document.createElement('input'); + input.className = 'htCheckboxRendererInput'; + input.type = 'checkbox'; + input.setAttribute('autocomplete', 'off'); + return input.cloneNode(false); +} +function createLabel(text) { + var label = document.createElement('label'); + label.className = 'htCheckboxRendererLabel'; + label.appendChild(document.createTextNode(text)); + return label.cloneNode(true); +} +function preventDefault(event) { + event.preventDefault(); +} + +//# +},{"eventManager":41,"helpers/dom/element":45,"helpers/dom/event":46,"helpers/string":52,"helpers/unicode":53,"renderers":88}],92:[function(require,module,exports){ +"use strict"; +Object.defineProperties(exports, { + htmlRenderer: {get: function() { + return htmlRenderer; + }}, + __esModule: {value: true} +}); +var $___46__46__47_helpers_47_dom_47_element__, + $___46__46__47_renderers__; +var fastInnerHTML = ($___46__46__47_helpers_47_dom_47_element__ = require("helpers/dom/element"), $___46__46__47_helpers_47_dom_47_element__ && $___46__46__47_helpers_47_dom_47_element__.__esModule && $___46__46__47_helpers_47_dom_47_element__ || {default: $___46__46__47_helpers_47_dom_47_element__}).fastInnerHTML; +var $__1 = ($___46__46__47_renderers__ = require("renderers"), $___46__46__47_renderers__ && $___46__46__47_renderers__.__esModule && $___46__46__47_renderers__ || {default: $___46__46__47_renderers__}), + getRenderer = $__1.getRenderer, + registerRenderer = $__1.registerRenderer; +function htmlRenderer(instance, TD, row, col, prop, value, cellProperties) { + getRenderer('base').apply(this, arguments); + fastInnerHTML(TD, value); +} +; +registerRenderer('html', htmlRenderer); + +//# +},{"helpers/dom/element":45,"renderers":88}],93:[function(require,module,exports){ +"use strict"; +Object.defineProperties(exports, { + numericRenderer: {get: function() { + return numericRenderer; + }}, + __esModule: {value: true} +}); +var $__numeral__, + $___46__46__47_helpers_47_dom_47_element__, + $___46__46__47_renderers__, + $___46__46__47_helpers_47_number__; +var numeral = ($__numeral__ = require("numeral"), $__numeral__ && $__numeral__.__esModule && $__numeral__ || {default: $__numeral__}).default; +var addClass = ($___46__46__47_helpers_47_dom_47_element__ = require("helpers/dom/element"), $___46__46__47_helpers_47_dom_47_element__ && $___46__46__47_helpers_47_dom_47_element__.__esModule && $___46__46__47_helpers_47_dom_47_element__ || {default: $___46__46__47_helpers_47_dom_47_element__}).addClass; +var $__2 = ($___46__46__47_renderers__ = require("renderers"), $___46__46__47_renderers__ && $___46__46__47_renderers__.__esModule && $___46__46__47_renderers__ || {default: $___46__46__47_renderers__}), + getRenderer = $__2.getRenderer, + registerRenderer = $__2.registerRenderer; +var isNumeric = ($___46__46__47_helpers_47_number__ = require("helpers/number"), $___46__46__47_helpers_47_number__ && $___46__46__47_helpers_47_number__.__esModule && $___46__46__47_helpers_47_number__ || {default: $___46__46__47_helpers_47_number__}).isNumeric; +function numericRenderer(instance, TD, row, col, prop, value, cellProperties) { + if (isNumeric(value)) { + if (typeof cellProperties.language !== 'undefined') { + numeral.language(cellProperties.language); + } + value = numeral(value).format(cellProperties.format || '0'); + addClass(TD, 'htNumeric'); + } + getRenderer('text')(instance, TD, row, col, prop, value, cellProperties); +} +; +registerRenderer('numeric', numericRenderer); + +//# +},{"helpers/dom/element":45,"helpers/number":49,"numeral":"numeral","renderers":88}],94:[function(require,module,exports){ +"use strict"; +Object.defineProperties(exports, { + passwordRenderer: {get: function() { + return passwordRenderer; + }}, + __esModule: {value: true} +}); +var $___46__46__47_helpers_47_dom_47_element__, + $___46__46__47_renderers__; +var fastInnerHTML = ($___46__46__47_helpers_47_dom_47_element__ = require("helpers/dom/element"), $___46__46__47_helpers_47_dom_47_element__ && $___46__46__47_helpers_47_dom_47_element__.__esModule && $___46__46__47_helpers_47_dom_47_element__ || {default: $___46__46__47_helpers_47_dom_47_element__}).fastInnerHTML; +var $__1 = ($___46__46__47_renderers__ = require("renderers"), $___46__46__47_renderers__ && $___46__46__47_renderers__.__esModule && $___46__46__47_renderers__ || {default: $___46__46__47_renderers__}), + getRenderer = $__1.getRenderer, + registerRenderer = $__1.registerRenderer; +function passwordRenderer(instance, TD, row, col, prop, value, cellProperties) { + getRenderer('text').apply(this, arguments); + value = TD.innerHTML; + var hash; + var hashLength = cellProperties.hashLength || value.length; + var hashSymbol = cellProperties.hashSymbol || '*'; + for (hash = ''; hash.split(hashSymbol).length - 1 < hashLength; hash += hashSymbol) {} + fastInnerHTML(TD, hash); +} +; +registerRenderer('password', passwordRenderer); + +//# +},{"helpers/dom/element":45,"renderers":88}],95:[function(require,module,exports){ +"use strict"; +Object.defineProperties(exports, { + textRenderer: {get: function() { + return textRenderer; + }}, + __esModule: {value: true} +}); +var $___46__46__47_helpers_47_dom_47_element__, + $___46__46__47_helpers_47_mixed__, + $___46__46__47_renderers__; +var $__0 = ($___46__46__47_helpers_47_dom_47_element__ = require("helpers/dom/element"), $___46__46__47_helpers_47_dom_47_element__ && $___46__46__47_helpers_47_dom_47_element__.__esModule && $___46__46__47_helpers_47_dom_47_element__ || {default: $___46__46__47_helpers_47_dom_47_element__}), + empty = $__0.empty, + fastInnerText = $__0.fastInnerText; +var stringify = ($___46__46__47_helpers_47_mixed__ = require("helpers/mixed"), $___46__46__47_helpers_47_mixed__ && $___46__46__47_helpers_47_mixed__.__esModule && $___46__46__47_helpers_47_mixed__ || {default: $___46__46__47_helpers_47_mixed__}).stringify; +var $__2 = ($___46__46__47_renderers__ = require("renderers"), $___46__46__47_renderers__ && $___46__46__47_renderers__.__esModule && $___46__46__47_renderers__ || {default: $___46__46__47_renderers__}), + getRenderer = $__2.getRenderer, + registerRenderer = $__2.registerRenderer; +function textRenderer(instance, TD, row, col, prop, value, cellProperties) { + getRenderer('base').apply(this, arguments); + if (!value && cellProperties.placeholder) { + value = cellProperties.placeholder; + } + var escaped = stringify(value); + if (!instance.getSettings().trimWhitespace) { + escaped = escaped.replace(/ /g, String.fromCharCode(160)); + } + if (cellProperties.rendererTemplate) { + empty(TD); + var TEMPLATE = document.createElement('TEMPLATE'); + TEMPLATE.setAttribute('bind', '{{}}'); + TEMPLATE.innerHTML = cellProperties.rendererTemplate; + HTMLTemplateElement.decorate(TEMPLATE); + TEMPLATE.model = instance.getSourceDataAtRow(row); + TD.appendChild(TEMPLATE); + } else { + fastInnerText(TD, escaped); + } +} +; +registerRenderer('text', textRenderer); + +//# +},{"helpers/dom/element":45,"helpers/mixed":48,"renderers":88}],96:[function(require,module,exports){ +"use strict"; +(function(global) { + 'use strict'; + if (global.$traceurRuntime) { + return; + } + var $Object = Object; + var $TypeError = TypeError; + var $create = $Object.create; + var $defineProperties = $Object.defineProperties; + var $defineProperty = $Object.defineProperty; + var $freeze = $Object.freeze; + var $getOwnPropertyDescriptor = $Object.getOwnPropertyDescriptor; + var $getOwnPropertyNames = $Object.getOwnPropertyNames; + var $keys = $Object.keys; + var $hasOwnProperty = $Object.prototype.hasOwnProperty; + var $preventExtensions = Object.preventExtensions; + var $seal = Object.seal; + var $isExtensible = Object.isExtensible; + function nonEnum(value) { + return { + configurable: true, + enumerable: false, + value: value, + writable: true + }; + } + var method = nonEnum; + var counter = 0; + function newUniqueString() { + return '__$' + Math.floor(Math.random() * 1e9) + '$' + ++counter + '$__'; + } + var symbolInternalProperty = newUniqueString(); + var symbolDescriptionProperty = newUniqueString(); + var symbolDataProperty = newUniqueString(); + var symbolValues = $create(null); + var privateNames = $create(null); + function isPrivateName(s) { + return privateNames[s]; + } + function createPrivateName() { + var s = newUniqueString(); + privateNames[s] = true; + return s; + } + function isShimSymbol(symbol) { + return typeof symbol === 'object' && symbol instanceof SymbolValue; + } + function typeOf(v) { + if (isShimSymbol(v)) + return 'symbol'; + return typeof v; + } + function Symbol(description) { + var value = new SymbolValue(description); + if (!(this instanceof Symbol)) + return value; + throw new TypeError('Symbol cannot be new\'ed'); + } + $defineProperty(Symbol.prototype, 'constructor', nonEnum(Symbol)); + $defineProperty(Symbol.prototype, 'toString', method(function() { + var symbolValue = this[symbolDataProperty]; + if (!getOption('symbols')) + return symbolValue[symbolInternalProperty]; + if (!symbolValue) + throw TypeError('Conversion from symbol to string'); + var desc = symbolValue[symbolDescriptionProperty]; + if (desc === undefined) + desc = ''; + return 'Symbol(' + desc + ')'; + })); + $defineProperty(Symbol.prototype, 'valueOf', method(function() { + var symbolValue = this[symbolDataProperty]; + if (!symbolValue) + throw TypeError('Conversion from symbol to string'); + if (!getOption('symbols')) + return symbolValue[symbolInternalProperty]; + return symbolValue; + })); + function SymbolValue(description) { + var key = newUniqueString(); + $defineProperty(this, symbolDataProperty, {value: this}); + $defineProperty(this, symbolInternalProperty, {value: key}); + $defineProperty(this, symbolDescriptionProperty, {value: description}); + freeze(this); + symbolValues[key] = this; + } + $defineProperty(SymbolValue.prototype, 'constructor', nonEnum(Symbol)); + $defineProperty(SymbolValue.prototype, 'toString', { + value: Symbol.prototype.toString, + enumerable: false + }); + $defineProperty(SymbolValue.prototype, 'valueOf', { + value: Symbol.prototype.valueOf, + enumerable: false + }); + var hashProperty = createPrivateName(); + var hashPropertyDescriptor = {value: undefined}; + var hashObjectProperties = { + hash: {value: undefined}, + self: {value: undefined} + }; + var hashCounter = 0; + function getOwnHashObject(object) { + var hashObject = object[hashProperty]; + if (hashObject && hashObject.self === object) + return hashObject; + if ($isExtensible(object)) { + hashObjectProperties.hash.value = hashCounter++; + hashObjectProperties.self.value = object; + hashPropertyDescriptor.value = $create(null, hashObjectProperties); + $defineProperty(object, hashProperty, hashPropertyDescriptor); + return hashPropertyDescriptor.value; + } + return undefined; + } + function freeze(object) { + getOwnHashObject(object); + return $freeze.apply(this, arguments); + } + function preventExtensions(object) { + getOwnHashObject(object); + return $preventExtensions.apply(this, arguments); + } + function seal(object) { + getOwnHashObject(object); + return $seal.apply(this, arguments); + } + freeze(SymbolValue.prototype); + function isSymbolString(s) { + return symbolValues[s] || privateNames[s]; + } + function toProperty(name) { + if (isShimSymbol(name)) + return name[symbolInternalProperty]; + return name; + } + function removeSymbolKeys(array) { + var rv = []; + for (var i = 0; i < array.length; i++) { + if (!isSymbolString(array[i])) { + rv.push(array[i]); + } + } + return rv; + } + function getOwnPropertyNames(object) { + return removeSymbolKeys($getOwnPropertyNames(object)); + } + function keys(object) { + return removeSymbolKeys($keys(object)); + } + function getOwnPropertySymbols(object) { + var rv = []; + var names = $getOwnPropertyNames(object); + for (var i = 0; i < names.length; i++) { + var symbol = symbolValues[names[i]]; + if (symbol) { + rv.push(symbol); + } + } + return rv; + } + function getOwnPropertyDescriptor(object, name) { + return $getOwnPropertyDescriptor(object, toProperty(name)); + } + function hasOwnProperty(name) { + return $hasOwnProperty.call(this, toProperty(name)); + } + function getOption(name) { + return global.traceur && global.traceur.options[name]; + } + function defineProperty(object, name, descriptor) { + if (isShimSymbol(name)) { + name = name[symbolInternalProperty]; + } + $defineProperty(object, name, descriptor); + return object; + } + function polyfillObject(Object) { + $defineProperty(Object, 'defineProperty', {value: defineProperty}); + $defineProperty(Object, 'getOwnPropertyNames', {value: getOwnPropertyNames}); + $defineProperty(Object, 'getOwnPropertyDescriptor', {value: getOwnPropertyDescriptor}); + $defineProperty(Object.prototype, 'hasOwnProperty', {value: hasOwnProperty}); + $defineProperty(Object, 'freeze', {value: freeze}); + $defineProperty(Object, 'preventExtensions', {value: preventExtensions}); + $defineProperty(Object, 'seal', {value: seal}); + $defineProperty(Object, 'keys', {value: keys}); + } + function exportStar(object) { + for (var i = 1; i < arguments.length; i++) { + var names = $getOwnPropertyNames(arguments[i]); + for (var j = 0; j < names.length; j++) { + var name = names[j]; + if (isSymbolString(name)) + continue; + (function(mod, name) { + $defineProperty(object, name, { + get: function() { + return mod[name]; + }, + enumerable: true + }); + })(arguments[i], names[j]); + } + } + return object; + } + function isObject(x) { + return x != null && (typeof x === 'object' || typeof x === 'function'); + } + function toObject(x) { + if (x == null) + throw $TypeError(); + return $Object(x); + } + function checkObjectCoercible(argument) { + if (argument == null) { + throw new TypeError('Value cannot be converted to an Object'); + } + return argument; + } + function polyfillSymbol(global, Symbol) { + if (!global.Symbol) { + global.Symbol = Symbol; + Object.getOwnPropertySymbols = getOwnPropertySymbols; + } + if (!global.Symbol.iterator) { + global.Symbol.iterator = Symbol('Symbol.iterator'); + } + } + function setupGlobals(global) { + polyfillSymbol(global, Symbol); + global.Reflect = global.Reflect || {}; + global.Reflect.global = global.Reflect.global || global; + polyfillObject(global.Object); + } + setupGlobals(global); + global.$traceurRuntime = { + checkObjectCoercible: checkObjectCoercible, + createPrivateName: createPrivateName, + defineProperties: $defineProperties, + defineProperty: $defineProperty, + exportStar: exportStar, + getOwnHashObject: getOwnHashObject, + getOwnPropertyDescriptor: $getOwnPropertyDescriptor, + getOwnPropertyNames: $getOwnPropertyNames, + isObject: isObject, + isPrivateName: isPrivateName, + isSymbolString: isSymbolString, + keys: $keys, + setupGlobals: setupGlobals, + toObject: toObject, + toProperty: toProperty, + typeof: typeOf + }; +})(window); +(function() { + 'use strict'; + var $toProperty = $traceurRuntime.toProperty; + function spread() { + var rv = [], + j = 0, + iterResult; + for (var i = 0; i < arguments.length; i++) { + var valueToSpread = $traceurRuntime.checkObjectCoercible(arguments[i]); + if (typeof valueToSpread[$toProperty(Symbol.iterator)] !== 'function') { + throw new TypeError('Cannot spread non-iterable object.'); + } + var iter = valueToSpread[$toProperty(Symbol.iterator)](); + while (!(iterResult = iter.next()).done) { + rv[j++] = iterResult.value; + } + } + return rv; + } + $traceurRuntime.spread = spread; +})(); +(function() { + 'use strict'; + var $Object = Object; + var $TypeError = TypeError; + var $create = $Object.create; + var $defineProperties = $traceurRuntime.defineProperties; + var $defineProperty = $traceurRuntime.defineProperty; + var $getOwnPropertyDescriptor = $traceurRuntime.getOwnPropertyDescriptor; + var $getPrototypeOf = Object.getPrototypeOf; + var $toProperty = $traceurRuntime.toProperty; + var $__0 = Object, + getOwnPropertyNames = $__0.getOwnPropertyNames, + getOwnPropertySymbols = $__0.getOwnPropertySymbols; + function superDescriptor(homeObject, name) { + var proto = $getPrototypeOf(homeObject); + do { + var result = $getOwnPropertyDescriptor(proto, name); + if (result) + return result; + proto = $getPrototypeOf(proto); + } while (proto); + return undefined; + } + function superConstructor(ctor) { + return ctor.__proto__; + } + function superCall(self, homeObject, name, args) { + return superGet(self, homeObject, name).apply(self, args); + } + function superGet(self, homeObject, name) { + var descriptor = superDescriptor(homeObject, name); + if (descriptor) { + if (!descriptor.get) + return descriptor.value; + return descriptor.get.call(self); + } + return undefined; + } + function superSet(self, homeObject, name, value) { + var descriptor = superDescriptor(homeObject, name); + if (descriptor && descriptor.set) { + descriptor.set.call(self, value); + return value; + } + throw $TypeError(("super has no setter '" + name + "'.")); + } + function getDescriptors(object) { + var descriptors = {}; + var names = getOwnPropertyNames(object); + for (var i = 0; i < names.length; i++) { + var name = names[i]; + descriptors[name] = $getOwnPropertyDescriptor(object, name); + } + var symbols = getOwnPropertySymbols(object); + for (var i = 0; i < symbols.length; i++) { + var symbol = symbols[i]; + descriptors[$toProperty(symbol)] = $getOwnPropertyDescriptor(object, $toProperty(symbol)); + } + return descriptors; + } + function createClass(ctor, object, staticObject, superClass) { + $defineProperty(object, 'constructor', { + value: ctor, + configurable: true, + enumerable: false, + writable: true + }); + if (arguments.length > 3) { + if (typeof superClass === 'function') + ctor.__proto__ = superClass; + ctor.prototype = $create(getProtoParent(superClass), getDescriptors(object)); + } else { + ctor.prototype = object; + } + $defineProperty(ctor, 'prototype', { + configurable: false, + writable: false + }); + return $defineProperties(ctor, getDescriptors(staticObject)); + } + function getProtoParent(superClass) { + if (typeof superClass === 'function') { + var prototype = superClass.prototype; + if ($Object(prototype) === prototype || prototype === null) + return superClass.prototype; + throw new $TypeError('super prototype must be an Object or null'); + } + if (superClass === null) + return null; + throw new $TypeError(("Super expression must either be null or a function, not " + typeof superClass + ".")); + } + function defaultSuperCall(self, homeObject, args) { + if ($getPrototypeOf(homeObject) !== null) + superCall(self, homeObject, 'constructor', args); + } + $traceurRuntime.createClass = createClass; + $traceurRuntime.defaultSuperCall = defaultSuperCall; + $traceurRuntime.superCall = superCall; + $traceurRuntime.superConstructor = superConstructor; + $traceurRuntime.superGet = superGet; + $traceurRuntime.superSet = superSet; +})(); + +//# +},{}],97:[function(require,module,exports){ +"use strict"; +Object.defineProperties(exports, { + TableView: {get: function() { + return TableView; + }}, + __esModule: {value: true} +}); +var $__helpers_47_dom_47_element__, + $__eventManager__, + $__helpers_47_dom_47_event__, + $__3rdparty_47_walkontable_47_src_47_cell_47_coords__, + $__3rdparty_47_walkontable_47_src_47_selection__, + $__3rdparty_47_walkontable_47_src_47_core__; +var $__0 = ($__helpers_47_dom_47_element__ = require("helpers/dom/element"), $__helpers_47_dom_47_element__ && $__helpers_47_dom_47_element__.__esModule && $__helpers_47_dom_47_element__ || {default: $__helpers_47_dom_47_element__}), + addClass = $__0.addClass, + empty = $__0.empty, + fastInnerHTML = $__0.fastInnerHTML, + fastInnerText = $__0.fastInnerText, + getScrollbarWidth = $__0.getScrollbarWidth, + hasClass = $__0.hasClass, + isChildOf = $__0.isChildOf, + isInput = $__0.isInput, + isOutsideInput = $__0.isOutsideInput; +var eventManagerObject = ($__eventManager__ = require("eventManager"), $__eventManager__ && $__eventManager__.__esModule && $__eventManager__ || {default: $__eventManager__}).eventManager; +var $__2 = ($__helpers_47_dom_47_event__ = require("helpers/dom/event"), $__helpers_47_dom_47_event__ && $__helpers_47_dom_47_event__.__esModule && $__helpers_47_dom_47_event__ || {default: $__helpers_47_dom_47_event__}), + stopPropagation = $__2.stopPropagation, + isImmediatePropagationStopped = $__2.isImmediatePropagationStopped; +var WalkontableCellCoords = ($__3rdparty_47_walkontable_47_src_47_cell_47_coords__ = require("3rdparty/walkontable/src/cell/coords"), $__3rdparty_47_walkontable_47_src_47_cell_47_coords__ && $__3rdparty_47_walkontable_47_src_47_cell_47_coords__.__esModule && $__3rdparty_47_walkontable_47_src_47_cell_47_coords__ || {default: $__3rdparty_47_walkontable_47_src_47_cell_47_coords__}).WalkontableCellCoords; +var WalkontableSelection = ($__3rdparty_47_walkontable_47_src_47_selection__ = require("3rdparty/walkontable/src/selection"), $__3rdparty_47_walkontable_47_src_47_selection__ && $__3rdparty_47_walkontable_47_src_47_selection__.__esModule && $__3rdparty_47_walkontable_47_src_47_selection__ || {default: $__3rdparty_47_walkontable_47_src_47_selection__}).WalkontableSelection; +var Walkontable = ($__3rdparty_47_walkontable_47_src_47_core__ = require("3rdparty/walkontable/src/core"), $__3rdparty_47_walkontable_47_src_47_core__ && $__3rdparty_47_walkontable_47_src_47_core__.__esModule && $__3rdparty_47_walkontable_47_src_47_core__ || {default: $__3rdparty_47_walkontable_47_src_47_core__}).Walkontable; +Handsontable.TableView = TableView; +function TableView(instance) { + var that = this; + this.eventManager = eventManagerObject(instance); + this.instance = instance; + this.settings = instance.getSettings(); + this.selectionMouseDown = false; + var originalStyle = instance.rootElement.getAttribute('style'); + if (originalStyle) { + instance.rootElement.setAttribute('data-originalstyle', originalStyle); + } + addClass(instance.rootElement, 'handsontable'); + var table = document.createElement('TABLE'); + addClass(table, 'htCore'); + if (instance.getSettings().tableClassName) { + addClass(table, instance.getSettings().tableClassName); + } + this.THEAD = document.createElement('THEAD'); + table.appendChild(this.THEAD); + this.TBODY = document.createElement('TBODY'); + table.appendChild(this.TBODY); + instance.table = table; + instance.container.insertBefore(table, instance.container.firstChild); + this.eventManager.addEventListener(instance.rootElement, 'mousedown', function(event) { + this.selectionMouseDown = true; + if (!that.isTextSelectionAllowed(event.target)) { + clearTextSelection(); + event.preventDefault(); + window.focus(); + } + }); + this.eventManager.addEventListener(instance.rootElement, 'mouseup', function(event) { + this.selectionMouseDown = false; + }); + this.eventManager.addEventListener(instance.rootElement, 'mousemove', function(event) { + if (this.selectionMouseDown && !that.isTextSelectionAllowed(event.target)) { + clearTextSelection(); + event.preventDefault(); + } + }); + this.eventManager.addEventListener(document.documentElement, 'keyup', function(event) { + if (instance.selection.isInProgress() && !event.shiftKey) { + instance.selection.finish(); + } + }); + var isMouseDown; + this.isMouseDown = function() { + return isMouseDown; + }; + this.eventManager.addEventListener(document.documentElement, 'mouseup', function(event) { + if (instance.selection.isInProgress() && event.which === 1) { + instance.selection.finish(); + } + isMouseDown = false; + if (isOutsideInput(document.activeElement)) { + instance.unlisten(); + } + }); + this.eventManager.addEventListener(document.documentElement, 'mousedown', function(event) { + var next = event.target; + var eventX = event.x || event.clientX; + var eventY = event.y || event.clientY; + if (isMouseDown || !instance.rootElement) { + return; + } + if (next === instance.view.wt.wtTable.holder) { + var scrollbarWidth = getScrollbarWidth(); + if (document.elementFromPoint(eventX + scrollbarWidth, eventY) !== instance.view.wt.wtTable.holder || document.elementFromPoint(eventX, eventY + scrollbarWidth) !== instance.view.wt.wtTable.holder) { + return; + } + } else { + while (next !== document.documentElement) { + if (next === null) { + if (event.isTargetWebComponent) { + break; + } + return; + } + if (next === instance.rootElement) { + return; + } + next = next.parentNode; + } + } + if (that.settings.outsideClickDeselects) { + instance.deselectCell(); + } else { + instance.destroyEditor(); + } + }); + this.eventManager.addEventListener(table, 'selectstart', function(event) { + if (that.settings.fragmentSelection || isInput(event.target)) { + return; + } + event.preventDefault(); + }); + var clearTextSelection = function() { + if (window.getSelection) { + if (window.getSelection().empty) { + window.getSelection().empty(); + } else if (window.getSelection().removeAllRanges) { + window.getSelection().removeAllRanges(); + } + } else if (document.selection) { + document.selection.empty(); + } + }; + var selections = [new WalkontableSelection({ + className: 'current', + border: { + width: 2, + color: '#5292F7', + cornerVisible: function() { + return that.settings.fillHandle && !that.isCellEdited() && !instance.selection.isMultiple(); + }, + multipleSelectionHandlesVisible: function() { + return !that.isCellEdited() && !instance.selection.isMultiple(); + } + } + }), new WalkontableSelection({ + className: 'area', + border: { + width: 1, + color: '#89AFF9', + cornerVisible: function() { + return that.settings.fillHandle && !that.isCellEdited() && instance.selection.isMultiple(); + }, + multipleSelectionHandlesVisible: function() { + return !that.isCellEdited() && instance.selection.isMultiple(); + } + } + }), new WalkontableSelection({ + className: 'highlight', + highlightRowClassName: that.settings.currentRowClassName, + highlightColumnClassName: that.settings.currentColClassName + }), new WalkontableSelection({ + className: 'fill', + border: { + width: 1, + color: 'red' + } + })]; + selections.current = selections[0]; + selections.area = selections[1]; + selections.highlight = selections[2]; + selections.fill = selections[3]; + var walkontableConfig = { + debug: function() { + return that.settings.debug; + }, + externalRowCalculator: this.instance.getPlugin('autoRowSize') && this.instance.getPlugin('autoRowSize').isEnabled(), + table: table, + stretchH: this.settings.stretchH, + data: instance.getDataAtCell, + totalRows: (function() { + return instance.countRows(); + }), + totalColumns: (function() { + return instance.countCols(); + }), + fixedColumnsLeft: function() { + return that.settings.fixedColumnsLeft; + }, + fixedRowsTop: function() { + return that.settings.fixedRowsTop; + }, + fixedRowsBottom: function() { + return that.settings.fixedRowsBottom; + }, + minSpareRows: function() { + return that.settings.minSpareRows; + }, + renderAllRows: that.settings.renderAllRows, + rowHeaders: function() { + var headerRenderers = []; + if (instance.hasRowHeaders()) { + headerRenderers.push(function(row, TH) { + that.appendRowHeader(row, TH); + }); + } + Handsontable.hooks.run(instance, 'afterGetRowHeaderRenderers', headerRenderers); + return headerRenderers; + }, + columnHeaders: function() { + var headerRenderers = []; + if (instance.hasColHeaders()) { + headerRenderers.push(function(column, TH) { + that.appendColHeader(column, TH); + }); + } + Handsontable.hooks.run(instance, 'afterGetColumnHeaderRenderers', headerRenderers); + return headerRenderers; + }, + columnWidth: instance.getColWidth, + rowHeight: instance.getRowHeight, + cellRenderer: function(row, col, TD) { + var prop = that.instance.colToProp(col), + cellProperties = that.instance.getCellMeta(row, col), + renderer = that.instance.getCellRenderer(cellProperties); + var value = that.instance.getDataAtRowProp(row, prop); + renderer(that.instance, TD, row, col, prop, value, cellProperties); + Handsontable.hooks.run(that.instance, 'afterRenderer', TD, row, col, prop, value, cellProperties); + }, + selections: selections, + hideBorderOnMouseDownOver: function() { + return that.settings.fragmentSelection; + }, + onCellMouseDown: function(event, coords, TD, wt) { + var colspanOffset; + var TR = TD.parentNode; + var THEAD = TR.parentNode; + var headerLevel; + var headerColspan; + instance.listen(); + that.activeWt = wt; + isMouseDown = true; + Handsontable.hooks.run(instance, 'beforeOnCellMouseDown', event, coords, TD); + instance.selection.setSelectedHeaders(false, false); + if (!isImmediatePropagationStopped(event)) { + if (event.button === 2 && instance.selection.inInSelection(coords)) { + var nothing = 1; + } else if (event.shiftKey) { + if (coords.row >= 0 && coords.col >= 0) { + instance.selection.setRangeEnd(coords); + } + } else { + if ((coords.row < 0 || coords.col < 0) && (coords.row >= 0 || coords.col >= 0)) { + if (coords.row < 0) { + headerLevel = THEAD.childNodes.length - Array.prototype.indexOf.call(THEAD.childNodes, TR) - 1; + headerColspan = instance.getHeaderColspan(coords.col, headerLevel); + instance.selection.setSelectedHeaders(false, true); + instance.selectCell(0, coords.col, instance.countRows() - 1, coords.col + Math.max(0, headerColspan - 1)); + } + if (coords.col < 0) { + instance.selection.setSelectedHeaders(true, false); + instance.selectCell(coords.row, 0, coords.row, instance.countCols() - 1); + } + } else { + coords.row = coords.row < 0 ? 0 : coords.row; + coords.col = coords.col < 0 ? 0 : coords.col; + instance.selection.setRangeStart(coords); + } + } + Handsontable.hooks.run(instance, 'afterOnCellMouseDown', event, coords, TD); + that.activeWt = that.wt; + } + }, + onCellMouseOver: function(event, coords, TD, wt) { + that.activeWt = wt; + if (coords.row >= 0 && coords.col >= 0) { + if (isMouseDown) { + instance.selection.setRangeEnd(coords); + } + } else { + if (isMouseDown) { + if (coords.row < 0) { + if (instance.selection.selectedHeader.cols) { + instance.selection.setRangeEnd(new WalkontableCellCoords(instance.countRows() - 1, coords.col)); + instance.selection.setSelectedHeaders(false, true); + } else { + instance.selection.setRangeEnd(new WalkontableCellCoords(coords.row, coords.col)); + } + } + if (coords.col < 0) { + if (instance.selection.selectedHeader.rows) { + instance.selection.setRangeEnd(new WalkontableCellCoords(coords.row, instance.countCols() - 1)); + instance.selection.setSelectedHeaders(true, false); + } else { + instance.selection.setRangeEnd(new WalkontableCellCoords(coords.row, coords.col)); + } + } + } + } + Handsontable.hooks.run(instance, 'afterOnCellMouseOver', event, coords, TD); + that.activeWt = that.wt; + }, + onCellCornerMouseDown: function(event) { + event.preventDefault(); + Handsontable.hooks.run(instance, 'afterOnCellCornerMouseDown', event); + }, + beforeDraw: function(force) { + that.beforeRender(force); + }, + onDraw: function(force) { + that.onDraw(force); + }, + onScrollVertically: function() { + instance.runHooks('afterScrollVertically'); + }, + onScrollHorizontally: function() { + instance.runHooks('afterScrollHorizontally'); + }, + onBeforeDrawBorders: function(corners, borderClassName) { + instance.runHooks('beforeDrawBorders', corners, borderClassName); + }, + onBeforeTouchScroll: function() { + instance.runHooks('beforeTouchScroll'); + }, + onAfterMomentumScroll: function() { + instance.runHooks('afterMomentumScroll'); + }, + viewportRowCalculatorOverride: function(calc) { + var rows = instance.countRows(); + var viewportOffset = that.settings.viewportRowRenderingOffset; + if (viewportOffset === 'auto' && that.settings.fixedRowsTop) { + viewportOffset = 10; + } + if (typeof viewportOffset === 'number') { + calc.startRow = Math.max(calc.startRow - viewportOffset, 0); + calc.endRow = Math.min(calc.endRow + viewportOffset, rows - 1); + } + if (viewportOffset === 'auto') { + var center = calc.startRow + calc.endRow - calc.startRow; + var offset = Math.ceil(center / rows * 12); + calc.startRow = Math.max(calc.startRow - offset, 0); + calc.endRow = Math.min(calc.endRow + offset, rows - 1); + } + instance.runHooks('afterViewportRowCalculatorOverride', calc); + }, + viewportColumnCalculatorOverride: function(calc) { + var cols = instance.countCols(); + var viewportOffset = that.settings.viewportColumnRenderingOffset; + if (viewportOffset === 'auto' && that.settings.fixedColumnsLeft) { + viewportOffset = 10; + } + if (typeof viewportOffset === 'number') { + calc.startColumn = Math.max(calc.startColumn - viewportOffset, 0); + calc.endColumn = Math.min(calc.endColumn + viewportOffset, cols - 1); + } + if (viewportOffset === 'auto') { + var center = calc.startColumn + calc.endColumn - calc.startColumn; + var offset = Math.ceil(center / cols * 12); + calc.startRow = Math.max(calc.startColumn - offset, 0); + calc.endColumn = Math.min(calc.endColumn + offset, cols - 1); + } + instance.runHooks('afterViewportColumnCalculatorOverride', calc); + } + }; + Handsontable.hooks.run(instance, 'beforeInitWalkontable', walkontableConfig); + this.wt = new Walkontable(walkontableConfig); + this.activeWt = this.wt; + this.eventManager.addEventListener(that.wt.wtTable.spreader, 'mousedown', function(event) { + if (event.target === that.wt.wtTable.spreader && event.which === 3) { + stopPropagation(event); + } + }); + this.eventManager.addEventListener(that.wt.wtTable.spreader, 'contextmenu', function(event) { + if (event.target === that.wt.wtTable.spreader && event.which === 3) { + stopPropagation(event); + } + }); + this.eventManager.addEventListener(document.documentElement, 'click', function() { + if (that.settings.observeDOMVisibility) { + if (that.wt.drawInterrupted) { + that.instance.forceFullRender = true; + that.render(); + } + } + }); +} +TableView.prototype.isTextSelectionAllowed = function(el) { + if (isInput(el)) { + return true; + } + var isChildOfTableBody = isChildOf(el, this.instance.view.wt.wtTable.spreader); + if (this.settings.fragmentSelection === true && isChildOfTableBody) { + return true; + } + if (this.settings.fragmentSelection === 'cell' && this.isSelectedOnlyCell() && isChildOfTableBody) { + return true; + } + return false; +}; +TableView.prototype.isSelectedOnlyCell = function() { + var $__6 = this.instance.getSelected() || [], + row = $__6[0], + col = $__6[1], + rowEnd = $__6[2], + colEnd = $__6[3]; + return row !== void 0 && row === rowEnd && col === colEnd; +}; +TableView.prototype.isCellEdited = function() { + var activeEditor = this.instance.getActiveEditor(); + return activeEditor && activeEditor.isOpened(); +}; +TableView.prototype.beforeRender = function(force) { + if (force) { + Handsontable.hooks.run(this.instance, 'beforeRender', this.instance.forceFullRender); + } +}; +TableView.prototype.onDraw = function(force) { + if (force) { + Handsontable.hooks.run(this.instance, 'afterRender', this.instance.forceFullRender); + } +}; +TableView.prototype.render = function() { + this.wt.draw(!this.instance.forceFullRender); + this.instance.forceFullRender = false; + this.instance.renderCall = false; +}; +TableView.prototype.getCellAtCoords = function(coords, topmost) { + var td = this.wt.getCell(coords, topmost); + if (td < 0) { + return null; + } else { + return td; + } +}; +TableView.prototype.scrollViewport = function(coords) { + this.wt.scrollViewport(coords); +}; +TableView.prototype.appendRowHeader = function(row, TH) { + if (TH.firstChild) { + var container = TH.firstChild; + if (!hasClass(container, 'relative')) { + empty(TH); + this.appendRowHeader(row, TH); + return; + } + this.updateCellHeader(container.querySelector('.rowHeader'), row, this.instance.getRowHeader); + } else { + var div = document.createElement('div'); + var span = document.createElement('span'); + div.className = 'relative'; + span.className = 'rowHeader'; + this.updateCellHeader(span, row, this.instance.getRowHeader); + div.appendChild(span); + TH.appendChild(div); + } + Handsontable.hooks.run(this.instance, 'afterGetRowHeader', row, TH); +}; +TableView.prototype.appendColHeader = function(col, TH) { + if (TH.firstChild) { + var container = TH.firstChild; + if (hasClass(container, 'relative')) { + this.updateCellHeader(container.querySelector('.colHeader'), col, this.instance.getColHeader); + } else { + empty(TH); + this.appendColHeader(col, TH); + } + } else { + var div = document.createElement('div'); + var span = document.createElement('span'); + div.className = 'relative'; + span.className = 'colHeader'; + this.updateCellHeader(span, col, this.instance.getColHeader); + div.appendChild(span); + TH.appendChild(div); + } + Handsontable.hooks.run(this.instance, 'afterGetColHeader', col, TH); +}; +TableView.prototype.updateCellHeader = function(element, index, content) { + if (index > -1) { + fastInnerHTML(element, content(index)); + } else { + fastInnerText(element, String.fromCharCode(160)); + addClass(element, 'cornerHeader'); + } +}; +TableView.prototype.maximumVisibleElementWidth = function(leftOffset) { + var workspaceWidth = this.wt.wtViewport.getWorkspaceWidth(); + var maxWidth = workspaceWidth - leftOffset; + return maxWidth > 0 ? maxWidth : 0; +}; +TableView.prototype.maximumVisibleElementHeight = function(topOffset) { + var workspaceHeight = this.wt.wtViewport.getWorkspaceHeight(); + var maxHeight = workspaceHeight - topOffset; + return maxHeight > 0 ? maxHeight : 0; +}; +TableView.prototype.mainViewIsActive = function() { + return this.wt === this.activeWt; +}; +TableView.prototype.destroy = function() { + this.wt.destroy(); + this.eventManager.destroy(); +}; +; + +//# +},{"3rdparty/walkontable/src/cell/coords":5,"3rdparty/walkontable/src/core":7,"3rdparty/walkontable/src/selection":18,"eventManager":41,"helpers/dom/element":45,"helpers/dom/event":46}],98:[function(require,module,exports){ +"use strict"; +Object.defineProperties(exports, { + GhostTable: {get: function() { + return GhostTable; + }}, + __esModule: {value: true} +}); +var $___46__46__47_helpers_47_dom_47_element__, + $___46__46__47_helpers_47_array__, + $___46__46__47_helpers_47_object__, + $___46__46__47_helpers_47_number__, + $___46__46__47_helpers_47_mixed__; +var $__0 = ($___46__46__47_helpers_47_dom_47_element__ = require("helpers/dom/element"), $___46__46__47_helpers_47_dom_47_element__ && $___46__46__47_helpers_47_dom_47_element__.__esModule && $___46__46__47_helpers_47_dom_47_element__ || {default: $___46__46__47_helpers_47_dom_47_element__}), + addClass = $__0.addClass, + outerHeight = $__0.outerHeight, + outerWidth = $__0.outerWidth; +var arrayEach = ($___46__46__47_helpers_47_array__ = require("helpers/array"), $___46__46__47_helpers_47_array__ && $___46__46__47_helpers_47_array__.__esModule && $___46__46__47_helpers_47_array__ || {default: $___46__46__47_helpers_47_array__}).arrayEach; +var objectEach = ($___46__46__47_helpers_47_object__ = require("helpers/object"), $___46__46__47_helpers_47_object__ && $___46__46__47_helpers_47_object__.__esModule && $___46__46__47_helpers_47_object__ || {default: $___46__46__47_helpers_47_object__}).objectEach; +var rangeEach = ($___46__46__47_helpers_47_number__ = require("helpers/number"), $___46__46__47_helpers_47_number__ && $___46__46__47_helpers_47_number__.__esModule && $___46__46__47_helpers_47_number__ || {default: $___46__46__47_helpers_47_number__}).rangeEach; +var stringify = ($___46__46__47_helpers_47_mixed__ = require("helpers/mixed"), $___46__46__47_helpers_47_mixed__ && $___46__46__47_helpers_47_mixed__.__esModule && $___46__46__47_helpers_47_mixed__ || {default: $___46__46__47_helpers_47_mixed__}).stringify; +var GhostTable = function GhostTable(hotInstance) { + this.hot = hotInstance; + this.container = null; + this.injected = false; + this.rows = []; + this.columns = []; + this.samples = null; +}; +($traceurRuntime.createClass)(GhostTable, { + addRow: function(row, samples) { + if (this.columns.length) { + throw new Error('Doesn\'t support multi-dimensional table'); + } + if (!this.rows.length) { + this.container = this.createContainer(this.hot.rootElement.className); + } + var rowObject = {row: row}; + this.rows.push(rowObject); + this.samples = samples; + this.table = this.createTable(this.hot.table.className); + this.table.colGroup.appendChild(this.createColGroupsCol()); + this.table.tr.appendChild(this.createRow(row)); + this.container.container.appendChild(this.table.fragment); + rowObject.table = this.table.table; + }, + addColumn: function(column, samples) { + if (this.rows.length) { + throw new Error('Doesn\'t support multi-dimensional table'); + } + if (!this.columns.length) { + this.container = this.createContainer(this.hot.rootElement.className); + } + var columnObject = {col: column}; + this.columns.push(columnObject); + this.samples = samples; + this.table = this.createTable(this.hot.table.className); + if (this.hot.getColHeader(column) !== null) { + this.hot.view.appendColHeader(column, this.table.th); + } + this.table.tBody.appendChild(this.createCol(column)); + this.container.container.appendChild(this.table.fragment); + columnObject.table = this.table.table; + }, + getHeights: function(callback) { + if (!this.injected) { + this.injectTable(); + } + arrayEach(this.rows, (function(row) { + callback(row.row, outerHeight(row.table) - 1); + })); + }, + getWidths: function(callback) { + if (!this.injected) { + this.injectTable(); + } + arrayEach(this.columns, (function(column) { + callback(column.col, outerWidth(column.table)); + })); + }, + createColGroupsCol: function() { + var $__5 = this; + var d = document; + var fragment = d.createDocumentFragment(); + fragment.appendChild(this.createColElement(-1)); + this.samples.forEach((function(sample) { + arrayEach(sample.strings, (function(string) { + fragment.appendChild($__5.createColElement(string.col)); + })); + })); + return fragment; + }, + createRow: function(row) { + var $__5 = this; + var d = document; + var fragment = d.createDocumentFragment(); + var th = d.createElement('th'); + if (this.hot.getRowHeader(row) !== null) { + this.hot.view.appendRowHeader(row, th); + } + fragment.appendChild(th); + this.samples.forEach((function(sample) { + arrayEach(sample.strings, (function(string) { + var column = string.col; + var cellProperties = $__5.hot.getCellMeta(row, column); + cellProperties.col = column; + cellProperties.row = row; + var renderer = $__5.hot.getCellRenderer(cellProperties); + var td = d.createElement('td'); + renderer($__5.hot, td, row, column, $__5.hot.colToProp(column), string.value, cellProperties); + fragment.appendChild(td); + })); + })); + return fragment; + }, + createCol: function(column) { + var $__5 = this; + var d = document; + var fragment = d.createDocumentFragment(); + this.samples.forEach((function(sample) { + arrayEach(sample.strings, (function(string) { + var row = string.row; + var cellProperties = $__5.hot.getCellMeta(row, column); + cellProperties.col = column; + cellProperties.row = row; + var renderer = $__5.hot.getCellRenderer(cellProperties); + var td = d.createElement('td'); + var tr = d.createElement('tr'); + renderer($__5.hot, td, row, column, $__5.hot.colToProp(row), string.value, cellProperties); + tr.appendChild(td); + fragment.appendChild(tr); + })); + })); + return fragment; + }, + clean: function() { + this.rows.length = 0; + this.columns.length = 0; + if (this.samples) { + this.samples.clear(); + } + this.samples = null; + this.removeTable(); + }, + injectTable: function() { + var parent = arguments[0] !== (void 0) ? arguments[0] : null; + if (!this.injected) { + (parent || this.hot.rootElement).appendChild(this.container.fragment); + this.injected = true; + } + }, + removeTable: function() { + if (this.injected && this.container.container.parentNode) { + this.container.container.parentNode.removeChild(this.container.container); + this.container = null; + this.injected = false; + } + }, + createColElement: function(column) { + var d = document; + var col = d.createElement('col'); + col.style.width = this.hot.view.wt.wtTable.getStretchedColumnWidth(column) + 'px'; + return col; + }, + createTable: function() { + var className = arguments[0] !== (void 0) ? arguments[0] : ''; + var d = document; + var fragment = d.createDocumentFragment(); + var table = d.createElement('table'); + var tHead = d.createElement('thead'); + var tBody = d.createElement('tbody'); + var colGroup = d.createElement('colgroup'); + var tr = d.createElement('tr'); + var th = d.createElement('th'); + if (this.isVertical()) { + table.appendChild(colGroup); + } + if (this.isHorizontal()) { + tr.appendChild(th); + tHead.appendChild(tr); + table.style.tableLayout = 'auto'; + table.style.width = 'auto'; + } + table.appendChild(tHead); + if (this.isVertical()) { + tBody.appendChild(tr); + } + table.appendChild(tBody); + addClass(table, className); + fragment.appendChild(table); + return { + fragment: fragment, + table: table, + tHead: tHead, + tBody: tBody, + colGroup: colGroup, + tr: tr, + th: th + }; + }, + createContainer: function() { + var className = arguments[0] !== (void 0) ? arguments[0] : ''; + var d = document; + var fragment = d.createDocumentFragment(); + var container = d.createElement('div'); + className = 'htGhostTable htAutoSize ' + className.trim(); + addClass(container, className); + fragment.appendChild(container); + return { + fragment: fragment, + container: container + }; + }, + isVertical: function() { + return this.rows.length && !this.columns.length ? true : false; + }, + isHorizontal: function() { + return this.columns.length && !this.rows.length ? true : false; + } +}, {}); +; +Handsontable.utils = Handsontable.utils || {}; +Handsontable.utils.GhostTable = GhostTable; + +//# +},{"helpers/array":42,"helpers/dom/element":45,"helpers/mixed":48,"helpers/number":49,"helpers/object":50}],99:[function(require,module,exports){ +"use strict"; +var $__7; +Object.defineProperties(exports, { + SamplesGenerator: {get: function() { + return SamplesGenerator; + }}, + __esModule: {value: true} +}); +var $___46__46__47_helpers_47_dom_47_element__, + $___46__46__47_helpers_47_array__, + $___46__46__47_helpers_47_object__, + $___46__46__47_helpers_47_number__, + $___46__46__47_helpers_47_mixed__; +var $__0 = ($___46__46__47_helpers_47_dom_47_element__ = require("helpers/dom/element"), $___46__46__47_helpers_47_dom_47_element__ && $___46__46__47_helpers_47_dom_47_element__.__esModule && $___46__46__47_helpers_47_dom_47_element__ || {default: $___46__46__47_helpers_47_dom_47_element__}), + addClass = $__0.addClass, + outerHeight = $__0.outerHeight, + outerWidth = $__0.outerWidth; +var arrayEach = ($___46__46__47_helpers_47_array__ = require("helpers/array"), $___46__46__47_helpers_47_array__ && $___46__46__47_helpers_47_array__.__esModule && $___46__46__47_helpers_47_array__ || {default: $___46__46__47_helpers_47_array__}).arrayEach; +var objectEach = ($___46__46__47_helpers_47_object__ = require("helpers/object"), $___46__46__47_helpers_47_object__ && $___46__46__47_helpers_47_object__.__esModule && $___46__46__47_helpers_47_object__ || {default: $___46__46__47_helpers_47_object__}).objectEach; +var rangeEach = ($___46__46__47_helpers_47_number__ = require("helpers/number"), $___46__46__47_helpers_47_number__ && $___46__46__47_helpers_47_number__.__esModule && $___46__46__47_helpers_47_number__ || {default: $___46__46__47_helpers_47_number__}).rangeEach; +var stringify = ($___46__46__47_helpers_47_mixed__ = require("helpers/mixed"), $___46__46__47_helpers_47_mixed__ && $___46__46__47_helpers_47_mixed__.__esModule && $___46__46__47_helpers_47_mixed__ || {default: $___46__46__47_helpers_47_mixed__}).stringify; +var SamplesGenerator = function SamplesGenerator(dataFactory) { + this.samples = null; + this.dataFactory = dataFactory; +}; +var $SamplesGenerator = SamplesGenerator; +($traceurRuntime.createClass)(SamplesGenerator, ($__7 = {}, Object.defineProperty($__7, "generateRowSamples", { + value: function(rowRange, colRange) { + return this.generateSamples('row', colRange, rowRange); + }, + configurable: true, + enumerable: true, + writable: true +}), Object.defineProperty($__7, "generateColumnSamples", { + value: function(colRange, rowRange) { + return this.generateSamples('col', rowRange, colRange); + }, + configurable: true, + enumerable: true, + writable: true +}), Object.defineProperty($__7, "generateSamples", { + value: function(type, range, specifierRange) { + var $__5 = this; + var samples = new Map(); + if (typeof specifierRange === 'number') { + specifierRange = { + from: specifierRange, + to: specifierRange + }; + } + rangeEach(specifierRange.from, specifierRange.to, (function(index) { + var sample = $__5.generateSample(type, range, index); + samples.set(index, sample); + })); + return samples; + }, + configurable: true, + enumerable: true, + writable: true +}), Object.defineProperty($__7, "generateSample", { + value: function(type, range, specifierValue) { + var $__5 = this; + var samples = new Map(); + rangeEach(range.from, range.to, (function(index) { + var $__7; + var value; + if (type === 'row') { + value = $__5.dataFactory(specifierValue, index); + } else if (type === 'col') { + value = $__5.dataFactory(index, specifierValue); + } else { + throw new Error('Unsupported sample type'); + } + if (!Array.isArray(value)) { + value = stringify(value); + } + var len = value.length; + if (!samples.has(len)) { + samples.set(len, { + needed: $SamplesGenerator.SAMPLE_COUNT, + strings: [] + }); + } + var sample = samples.get(len); + if (sample.needed) { + var computedKey = type === 'row' ? 'col' : 'row'; + sample.strings.push(($__7 = {}, Object.defineProperty($__7, "value", { + value: value, + configurable: true, + enumerable: true, + writable: true + }), Object.defineProperty($__7, computedKey, { + value: index, + configurable: true, + enumerable: true, + writable: true + }), $__7)); + sample.needed--; + } + })); + return samples; + }, + configurable: true, + enumerable: true, + writable: true +}), $__7), {get SAMPLE_COUNT() { + return 3; + }}); +; +Handsontable.utils = Handsontable.utils || {}; +Handsontable.utils.SamplesGenerator = SamplesGenerator; + +//# +},{"helpers/array":42,"helpers/dom/element":45,"helpers/mixed":48,"helpers/number":49,"helpers/object":50}],100:[function(require,module,exports){ +"use strict"; +var $___46__46__47_helpers_47_mixed__; +var stringify = ($___46__46__47_helpers_47_mixed__ = require("helpers/mixed"), $___46__46__47_helpers_47_mixed__ && $___46__46__47_helpers_47_mixed__.__esModule && $___46__46__47_helpers_47_mixed__ || {default: $___46__46__47_helpers_47_mixed__}).stringify; +Handsontable.AutocompleteValidator = function(value, callback) { + if (this.strict && this.source) { + if (typeof this.source === 'function') { + this.source(value, process(value, callback)); + } else { + process(value, callback)(this.source); + } + } else { + callback(true); + } +}; +function process(value, callback) { + var originalVal = value; + var lowercaseVal = typeof originalVal === 'string' ? originalVal.toLowerCase() : null; + return function(source) { + var found = false; + for (var s = 0, + slen = source.length; s < slen; s++) { + if (originalVal === source[s]) { + found = true; + break; + } else if (lowercaseVal === stringify(source[s]).toLowerCase()) { + found = true; + break; + } + } + callback(found); + }; +} + +//# +},{"helpers/mixed":48}],101:[function(require,module,exports){ +"use strict"; +var $__moment__, + $___46__46__47_editors__; +var moment = ($__moment__ = require("moment"), $__moment__ && $__moment__.__esModule && $__moment__ || {default: $__moment__}).default; +var getEditor = ($___46__46__47_editors__ = require("editors"), $___46__46__47_editors__ && $___46__46__47_editors__.__esModule && $___46__46__47_editors__ || {default: $___46__46__47_editors__}).getEditor; +Handsontable.DateValidator = function(value, callback) { + var valid = true; + var dateEditor = getEditor('date', this.instance); + if (value === null) { + value = ''; + } + var isValidDate = moment(new Date(value)).isValid(); + var isValidFormat = moment(value, this.dateFormat || dateEditor.defaultDateFormat, true).isValid(); + if (!isValidDate) { + valid = false; + } + if (!isValidDate && isValidFormat) { + valid = true; + } + if (isValidDate && !isValidFormat) { + if (this.correctFormat === true) { + var correctedValue = correctFormat(value, this.dateFormat); + this.instance.setDataAtCell(this.row, this.col, correctedValue, 'dateValidator'); + valid = true; + } else { + valid = false; + } + } + callback(valid); +}; +var correctFormat = function correctFormat(value, dateFormat) { + var date = moment(new Date(value)); + var year = date.format('YYYY'); + var yearNow = moment().format('YYYY'); + if (year.substr(0, 2) !== yearNow.substr(0, 2)) { + if (!value.match(new RegExp(year))) { + date.year(year.replace(year.substr(0, 2), yearNow.substr(0, 2))); + } + } else if (year.length > 4) { + date.year((date.year() + '').substr(0, 4)); + } + return date.format(dateFormat); +}; + +//# +},{"editors":29,"moment":"moment"}],102:[function(require,module,exports){ +"use strict"; +Handsontable.NumericValidator = function(value, callback) { + if (value === null) { + value = ''; + } + callback(/^-?\d*(\.|\,)?\d*$/.test(value)); +}; + +//# +},{}],"SheetClip":[function(require,module,exports){ +"use strict"; +(function(global) { + "use strict"; + function countQuotes(str) { + return str.split('"').length - 1; + } + var SheetClip = { + parse: function(str) { + var r, + rLen, + rows, + arr = [], + a = 0, + c, + cLen, + multiline, + last; + rows = str.split('\n'); + if (rows.length > 1 && rows[rows.length - 1] === '') { + rows.pop(); + } + for (r = 0, rLen = rows.length; r < rLen; r += 1) { + rows[r] = rows[r].split('\t'); + for (c = 0, cLen = rows[r].length; c < cLen; c += 1) { + if (!arr[a]) { + arr[a] = []; + } + if (multiline && c === 0) { + last = arr[a].length - 1; + arr[a][last] = arr[a][last] + '\n' + rows[r][0]; + if (multiline && (countQuotes(rows[r][0]) & 1)) { + multiline = false; + arr[a][last] = arr[a][last].substring(0, arr[a][last].length - 1).replace(/""/g, '"'); + } + } else { + if (c === cLen - 1 && rows[r][c].indexOf('"') === 0 && (countQuotes(rows[r][c]) & 1)) { + arr[a].push(rows[r][c].substring(1).replace(/""/g, '"')); + multiline = true; + } else { + arr[a].push(rows[r][c].replace(/""/g, '"')); + multiline = false; + } + } + } + if (!multiline) { + a += 1; + } + } + return arr; + }, + stringify: function(arr) { + var r, + rLen, + c, + cLen, + str = '', + val; + for (r = 0, rLen = arr.length; r < rLen; r += 1) { + cLen = arr[r].length; + for (c = 0; c < cLen; c += 1) { + if (c > 0) { + str += '\t'; + } + val = arr[r][c]; + if (typeof val === 'string') { + if (val.indexOf('\n') > -1) { + str += '"' + val.replace(/"/g, '""') + '"'; + } else { + str += val; + } + } else if (val === null || val === void 0) { + str += ''; + } else { + str += val; + } + } + str += '\n'; + } + return str; + } + }; + if (typeof exports !== 'undefined') { + exports.parse = SheetClip.parse; + exports.stringify = SheetClip.stringify; + } else { + global.SheetClip = SheetClip; + } +}(window)); + +//# +},{}],"autoResize":[function(require,module,exports){ +"use strict"; +function autoResize() { + var defaults = { + minHeight: 200, + maxHeight: 300, + minWidth: 100, + maxWidth: 300 + }, + el, + body = document.body, + text = document.createTextNode(''), + span = document.createElement('SPAN'), + observe = function(element, event, handler) { + if (window.attachEvent) { + element.attachEvent('on' + event, handler); + } else { + element.addEventListener(event, handler, false); + } + }, + unObserve = function(element, event, handler) { + if (window.removeEventListener) { + element.removeEventListener(event, handler, false); + } else { + element.detachEvent('on' + event, handler); + } + }, + resize = function(newChar) { + var width, + scrollHeight; + if (!newChar) { + newChar = ""; + } else if (!/^[a-zA-Z \.,\\\/\|0-9]$/.test(newChar)) { + newChar = "."; + } + if (text.textContent !== void 0) { + text.textContent = el.value + newChar; + } else { + text.data = el.value + newChar; + } + span.style.fontSize = Handsontable.Dom.getComputedStyle(el).fontSize; + span.style.fontFamily = Handsontable.Dom.getComputedStyle(el).fontFamily; + span.style.whiteSpace = "pre"; + body.appendChild(span); + width = span.clientWidth + 2; + body.removeChild(span); + el.style.height = defaults.minHeight + 'px'; + if (defaults.minWidth > width) { + el.style.width = defaults.minWidth + 'px'; + } else if (width > defaults.maxWidth) { + el.style.width = defaults.maxWidth + 'px'; + } else { + el.style.width = width + 'px'; + } + scrollHeight = el.scrollHeight ? el.scrollHeight - 1 : 0; + if (defaults.minHeight > scrollHeight) { + el.style.height = defaults.minHeight + 'px'; + } else if (defaults.maxHeight < scrollHeight) { + el.style.height = defaults.maxHeight + 'px'; + el.style.overflowY = 'visible'; + } else { + el.style.height = scrollHeight + 'px'; + } + }, + delayedResize = function() { + window.setTimeout(resize, 0); + }, + extendDefaults = function(config) { + if (config && config.minHeight) { + if (config.minHeight == 'inherit') { + defaults.minHeight = el.clientHeight; + } else { + var minHeight = parseInt(config.minHeight); + if (!isNaN(minHeight)) { + defaults.minHeight = minHeight; + } + } + } + if (config && config.maxHeight) { + if (config.maxHeight == 'inherit') { + defaults.maxHeight = el.clientHeight; + } else { + var maxHeight = parseInt(config.maxHeight); + if (!isNaN(maxHeight)) { + defaults.maxHeight = maxHeight; + } + } + } + if (config && config.minWidth) { + if (config.minWidth == 'inherit') { + defaults.minWidth = el.clientWidth; + } else { + var minWidth = parseInt(config.minWidth); + if (!isNaN(minWidth)) { + defaults.minWidth = minWidth; + } + } + } + if (config && config.maxWidth) { + if (config.maxWidth == 'inherit') { + defaults.maxWidth = el.clientWidth; + } else { + var maxWidth = parseInt(config.maxWidth); + if (!isNaN(maxWidth)) { + defaults.maxWidth = maxWidth; + } + } + } + if (!span.firstChild) { + span.className = "autoResize"; + span.style.display = 'inline-block'; + span.appendChild(text); + } + }, + init = function(el_, config, doObserve) { + el = el_; + extendDefaults(config); + if (el.nodeName == 'TEXTAREA') { + el.style.resize = 'none'; + el.style.overflowY = ''; + el.style.height = defaults.minHeight + 'px'; + el.style.minWidth = defaults.minWidth + 'px'; + el.style.maxWidth = defaults.maxWidth + 'px'; + el.style.overflowY = 'hidden'; + } + if (doObserve) { + observe(el, 'change', resize); + observe(el, 'cut', delayedResize); + observe(el, 'paste', delayedResize); + observe(el, 'drop', delayedResize); + observe(el, 'keydown', delayedResize); + } + resize(); + }; + return { + init: function(el_, config, doObserve) { + init(el_, config, doObserve); + }, + unObserve: function() { + unObserve(el, 'change', resize); + unObserve(el, 'cut', delayedResize); + unObserve(el, 'paste', delayedResize); + unObserve(el, 'drop', delayedResize); + unObserve(el, 'keydown', delayedResize); + }, + resize: resize + }; +} +if (typeof exports !== 'undefined') { + module.exports = autoResize; +} + +//# +},{}],"copyPaste":[function(require,module,exports){ +"use strict"; +var instance; +function copyPaste() { + if (!instance) { + instance = new CopyPasteClass(); + } else if (instance.hasBeenDestroyed()) { + instance.init(); + } + instance.refCounter++; + return instance; +} +if (typeof exports !== 'undefined') { + module.exports = copyPaste; +} +function CopyPasteClass() { + this.refCounter = 0; + this.init(); +} +CopyPasteClass.prototype.init = function() { + var style, + parent; + this.copyCallbacks = []; + this.cutCallbacks = []; + this.pasteCallbacks = []; + parent = document.body; + if (document.getElementById('CopyPasteDiv')) { + this.elDiv = document.getElementById('CopyPasteDiv'); + this.elTextarea = this.elDiv.firstChild; + } else { + this.elDiv = document.createElement('div'); + this.elDiv.id = 'CopyPasteDiv'; + style = this.elDiv.style; + style.position = 'fixed'; + style.top = '-10000px'; + style.left = '-10000px'; + parent.appendChild(this.elDiv); + this.elTextarea = document.createElement('textarea'); + this.elTextarea.className = 'copyPaste'; + this.elTextarea.onpaste = function(event) { + var clipboardContents, + temp; + if ('WebkitAppearance' in document.documentElement.style) { + clipboardContents = event.clipboardData.getData("Text"); + if (navigator.userAgent.indexOf('Safari') !== -1 && navigator.userAgent.indexOf('Chrome') === -1) { + temp = clipboardContents.split('\n'); + if (temp[temp.length - 1] === '') { + temp.pop(); + } + clipboardContents = temp.join('\n'); + } + this.value = clipboardContents; + return false; + } + }; + style = this.elTextarea.style; + style.width = '10000px'; + style.height = '10000px'; + style.overflow = 'hidden'; + this.elDiv.appendChild(this.elTextarea); + if (typeof style.opacity !== 'undefined') { + style.opacity = 0; + } + } + this.onKeyDownRef = this.onKeyDown.bind(this); + document.documentElement.addEventListener('keydown', this.onKeyDownRef, false); +}; +CopyPasteClass.prototype.onKeyDown = function(event) { + var _this = this, + isCtrlDown = false; + function isActiveElementEditable() { + var element = document.activeElement; + if (element.shadowRoot && element.shadowRoot.activeElement) { + element = element.shadowRoot.activeElement; + } + return ['INPUT', 'SELECT', 'TEXTAREA'].indexOf(element.nodeName) > -1 || element.contentEditable === 'true'; + } + if (event.metaKey) { + isCtrlDown = true; + } else if (event.ctrlKey && navigator.userAgent.indexOf('Mac') === -1) { + isCtrlDown = true; + } + if (isCtrlDown) { + if (document.activeElement !== this.elTextarea && (this.getSelectionText() !== '' || isActiveElementEditable())) { + return; + } + this.selectNodeText(this.elTextarea); + setTimeout(function() { + if (document.activeElement !== _this.elTextarea) { + _this.selectNodeText(_this.elTextarea); + } + }, 0); + } + if (isCtrlDown && (event.keyCode === 67 || event.keyCode === 86 || event.keyCode === 88)) { + if (event.keyCode === 88) { + setTimeout(function() { + _this.triggerCut(event); + }, 0); + } else if (event.keyCode === 86) { + setTimeout(function() { + _this.triggerPaste(event); + }, 0); + } + } +}; +CopyPasteClass.prototype.selectNodeText = function(element) { + if (element) { + element.select(); + } +}; +CopyPasteClass.prototype.getSelectionText = function() { + var text = ''; + if (window.getSelection) { + text = window.getSelection().toString(); + } else if (document.selection && document.selection.type !== 'Control') { + text = document.selection.createRange().text; + } + return text; +}; +CopyPasteClass.prototype.copyable = function(string) { + if (typeof string !== 'string' && string.toString === void 0) { + throw new Error('copyable requires string parameter'); + } + this.elTextarea.value = string; + this.selectNodeText(this.elTextarea); +}; +CopyPasteClass.prototype.onCut = function(callback) { + this.cutCallbacks.push(callback); +}; +CopyPasteClass.prototype.onPaste = function(callback) { + this.pasteCallbacks.push(callback); +}; +CopyPasteClass.prototype.removeCallback = function(callback) { + var i, + len; + for (i = 0, len = this.copyCallbacks.length; i < len; i++) { + if (this.copyCallbacks[i] === callback) { + this.copyCallbacks.splice(i, 1); + return true; + } + } + for (i = 0, len = this.cutCallbacks.length; i < len; i++) { + if (this.cutCallbacks[i] === callback) { + this.cutCallbacks.splice(i, 1); + return true; + } + } + for (i = 0, len = this.pasteCallbacks.length; i < len; i++) { + if (this.pasteCallbacks[i] === callback) { + this.pasteCallbacks.splice(i, 1); + return true; + } + } + return false; +}; +CopyPasteClass.prototype.triggerCut = function(event) { + var _this = this; + if (_this.cutCallbacks) { + setTimeout(function() { + for (var i = 0, + len = _this.cutCallbacks.length; i < len; i++) { + _this.cutCallbacks[i](event); + } + }, 50); + } +}; +CopyPasteClass.prototype.triggerPaste = function(event, string) { + var _this = this; + if (_this.pasteCallbacks) { + setTimeout(function() { + var val = string || _this.elTextarea.value; + for (var i = 0, + len = _this.pasteCallbacks.length; i < len; i++) { + _this.pasteCallbacks[i](val, event); + } + }, 50); + } +}; +CopyPasteClass.prototype.destroy = function() { + if (!this.hasBeenDestroyed() && --this.refCounter === 0) { + if (this.elDiv && this.elDiv.parentNode) { + this.elDiv.parentNode.removeChild(this.elDiv); + this.elDiv = null; + this.elTextarea = null; + } + document.documentElement.removeEventListener('keydown', this.onKeyDownRef); + this.onKeyDownRef = null; + } +}; +CopyPasteClass.prototype.hasBeenDestroyed = function() { + return !this.refCounter; +}; + +//# +},{}],"es6collections":[function(require,module,exports){ +"use strict"; +(function(exports) { + 'use strict'; + var i; + var defineProperty = Object.defineProperty, + is = function(a, b) { + return isNaN(a) ? isNaN(b) : a === b; + }; + if (typeof WeakMap == 'undefined') { + exports.WeakMap = createCollection({ + 'delete': sharedDelete, + clear: sharedClear, + get: sharedGet, + has: mapHas, + set: sharedSet + }, true); + } + if (typeof Map == 'undefined') { + exports.Map = createCollection({ + 'delete': sharedDelete, + has: mapHas, + get: sharedGet, + set: sharedSet, + keys: sharedKeys, + values: sharedValues, + entries: mapEntries, + forEach: sharedForEach, + clear: sharedClear + }); + } + if (typeof Set == 'undefined') { + exports.Set = createCollection({ + has: setHas, + add: sharedAdd, + 'delete': sharedDelete, + clear: sharedClear, + keys: sharedValues, + values: sharedValues, + entries: setEntries, + forEach: sharedForEach + }); + } + if (typeof WeakSet == 'undefined') { + exports.WeakSet = createCollection({ + 'delete': sharedDelete, + add: sharedAdd, + clear: sharedClear, + has: setHas + }, true); + } + function createCollection(proto, objectOnly) { + function Collection(a) { + if (!this || this.constructor !== Collection) + return new Collection(a); + this._keys = []; + this._values = []; + this._itp = []; + this.objectOnly = objectOnly; + if (a) + init.call(this, a); + } + if (!objectOnly) { + defineProperty(proto, 'size', {get: sharedSize}); + } + proto.constructor = Collection; + Collection.prototype = proto; + return Collection; + } + function init(a) { + var i; + if (this.add) + a.forEach(this.add, this); + else + a.forEach(function(a) { + this.set(a[0], a[1]); + }, this); + } + function sharedDelete(key) { + if (this.has(key)) { + this._keys.splice(i, 1); + this._values.splice(i, 1); + this._itp.forEach(function(p) { + if (i < p[0]) + p[0]--; + }); + } + return -1 < i; + } + ; + function sharedGet(key) { + return this.has(key) ? this._values[i] : undefined; + } + function has(list, key) { + if (this.objectOnly && key !== Object(key)) + throw new TypeError("Invalid value used as weak collection key"); + if (key != key || key === 0) + for (i = list.length; i-- && !is(list[i], key); ) {} + else + i = list.indexOf(key); + return -1 < i; + } + function setHas(value) { + return has.call(this, this._values, value); + } + function mapHas(value) { + return has.call(this, this._keys, value); + } + function sharedSet(key, value) { + this.has(key) ? this._values[i] = value : this._values[this._keys.push(key) - 1] = value; + return this; + } + function sharedAdd(value) { + if (!this.has(value)) + this._values.push(value); + return this; + } + function sharedClear() { + this._values.length = 0; + } + function sharedKeys() { + return sharedIterator(this._itp, this._keys); + } + function sharedValues() { + return sharedIterator(this._itp, this._values); + } + function mapEntries() { + return sharedIterator(this._itp, this._keys, this._values); + } + function setEntries() { + return sharedIterator(this._itp, this._values, this._values); + } + function sharedIterator(itp, array, array2) { + var p = [0], + done = false; + itp.push(p); + return {next: function() { + var v, + k = p[0]; + if (!done && k < array.length) { + v = array2 ? [array[k], array2[k]] : array[k]; + p[0]++; + } else { + done = true; + itp.splice(itp.indexOf(p), 1); + } + return { + done: done, + value: v + }; + }}; + } + function sharedSize() { + return this._values.length; + } + function sharedForEach(callback, context) { + var it = this.entries(); + for (; ; ) { + var r = it.next(); + if (r.done) + break; + callback.call(context, r.value[1], r.value[0], this); + } + } +})(typeof exports != 'undefined' && typeof global != 'undefined' ? global : window); + +//# +},{}],"jsonpatch":[function(require,module,exports){ +"use strict"; +var jsonpatch; +(function(jsonpatch) { + var objOps = { + add: function(obj, key) { + obj[key] = this.value; + return true; + }, + remove: function(obj, key) { + delete obj[key]; + return true; + }, + replace: function(obj, key) { + obj[key] = this.value; + return true; + }, + move: function(obj, key, tree) { + var temp = { + op: "_get", + path: this.from + }; + apply(tree, [temp]); + apply(tree, [{ + op: "remove", + path: this.from + }]); + apply(tree, [{ + op: "add", + path: this.path, + value: temp.value + }]); + return true; + }, + copy: function(obj, key, tree) { + var temp = { + op: "_get", + path: this.from + }; + apply(tree, [temp]); + apply(tree, [{ + op: "add", + path: this.path, + value: temp.value + }]); + return true; + }, + test: function(obj, key) { + return (JSON.stringify(obj[key]) === JSON.stringify(this.value)); + }, + _get: function(obj, key) { + this.value = obj[key]; + } + }; + var arrOps = { + add: function(arr, i) { + arr.splice(i, 0, this.value); + return true; + }, + remove: function(arr, i) { + arr.splice(i, 1); + return true; + }, + replace: function(arr, i) { + arr[i] = this.value; + return true; + }, + move: objOps.move, + copy: objOps.copy, + test: objOps.test, + _get: objOps._get + }; + var observeOps = { + add: function(patches, path) { + var patch = { + op: "add", + path: path + escapePathComponent(this.name), + value: this.object[this.name] + }; + patches.push(patch); + }, + 'delete': function(patches, path) { + var patch = { + op: "remove", + path: path + escapePathComponent(this.name) + }; + patches.push(patch); + }, + update: function(patches, path) { + var patch = { + op: "replace", + path: path + escapePathComponent(this.name), + value: this.object[this.name] + }; + patches.push(patch); + } + }; + function escapePathComponent(str) { + if (str.indexOf('/') === -1 && str.indexOf('~') === -1) { + return str; + } + return str.replace(/~/g, '~0').replace(/\//g, '~1'); + } + function _getPathRecursive(root, obj) { + var found; + for (var key in root) { + if (root.hasOwnProperty(key)) { + if (root[key] === obj) { + return escapePathComponent(key) + '/'; + } else if (typeof root[key] === 'object') { + found = _getPathRecursive(root[key], obj); + if (found != '') { + return escapePathComponent(key) + '/' + found; + } + } + } + } + return ''; + } + function getPath(root, obj) { + if (root === obj) { + return '/'; + } + var path = _getPathRecursive(root, obj); + if (path === '') { + throw new Error("Object not found in root"); + } + return '/' + path; + } + var beforeDict = []; + jsonpatch.intervals; + var Mirror = (function() { + function Mirror(obj) { + this.observers = []; + this.obj = obj; + } + return Mirror; + })(); + var ObserverInfo = (function() { + function ObserverInfo(callback, observer) { + this.callback = callback; + this.observer = observer; + } + return ObserverInfo; + })(); + function getMirror(obj) { + for (var i = 0, + ilen = beforeDict.length; i < ilen; i++) { + if (beforeDict[i].obj === obj) { + return beforeDict[i]; + } + } + } + function removeMirror(obj) { + for (var i = 0, + ilen = beforeDict.length; i < ilen; i++) { + if (beforeDict[i] === obj) { + beforeDict.splice(i, 1); + } + } + } + function getObserverFromMirror(mirror, callback) { + for (var j = 0, + jlen = mirror.observers.length; j < jlen; j++) { + if (mirror.observers[j].callback === callback) { + return mirror.observers[j].observer; + } + } + } + function removeObserverFromMirror(mirror, observer) { + for (var j = 0, + jlen = mirror.observers.length; j < jlen; j++) { + if (mirror.observers[j].observer === observer) { + mirror.observers.splice(j, 1); + if (!mirror.observers.length) { + removeMirror(mirror); + } + return; + } + } + } + function unobserve(root, observer) { + generate(observer); + if (Object.observe) { + _unobserve(observer, root); + } else { + clearTimeout(observer.next); + } + var mirror = getMirror(root); + removeObserverFromMirror(mirror, observer); + } + jsonpatch.unobserve = unobserve; + function observe(obj, callback) { + var patches = []; + var root = obj; + var observer; + var mirror = getMirror(obj); + if (!mirror) { + mirror = new Mirror(obj); + beforeDict.push(mirror); + } else { + observer = getObserverFromMirror(mirror, callback); + } + if (observer) { + return observer; + } + if (Object.observe) { + observer = function(arr) { + _unobserve(observer, obj); + _observe(observer, obj); + var a = 0, + alen = arr.length; + while (a < alen) { + if (!(arr[a].name === 'length' && _isArray(arr[a].object)) && !(arr[a].name === '__Jasmine_been_here_before__')) { + var type = arr[a].type; + switch (type) { + case 'new': + type = 'add'; + break; + case 'deleted': + type = 'delete'; + break; + case 'updated': + type = 'update'; + break; + } + observeOps[type].call(arr[a], patches, getPath(root, arr[a].object)); + } + a++; + } + if (patches) { + if (callback) { + callback(patches); + } + } + observer.patches = patches; + patches = []; + }; + } else { + observer = {}; + mirror.value = JSON.parse(JSON.stringify(obj)); + if (callback) { + observer.callback = callback; + observer.next = null; + var intervals = this.intervals || [100, 1000, 10000, 60000]; + var currentInterval = 0; + var dirtyCheck = function() { + generate(observer); + }; + var fastCheck = function() { + clearTimeout(observer.next); + observer.next = setTimeout(function() { + dirtyCheck(); + currentInterval = 0; + observer.next = setTimeout(slowCheck, intervals[currentInterval++]); + }, 0); + }; + var slowCheck = function() { + dirtyCheck(); + if (currentInterval == intervals.length) { + currentInterval = intervals.length - 1; + } + observer.next = setTimeout(slowCheck, intervals[currentInterval++]); + }; + if (typeof window !== 'undefined') { + if (window.addEventListener) { + window.addEventListener('mousedown', fastCheck); + window.addEventListener('mouseup', fastCheck); + window.addEventListener('keydown', fastCheck); + } else { + window.attachEvent('onmousedown', fastCheck); + window.attachEvent('onmouseup', fastCheck); + window.attachEvent('onkeydown', fastCheck); + } + } + observer.next = setTimeout(slowCheck, intervals[currentInterval++]); + } + } + observer.patches = patches; + observer.object = obj; + mirror.observers.push(new ObserverInfo(callback, observer)); + return _observe(observer, obj); + } + jsonpatch.observe = observe; + function _observe(observer, obj) { + if (Object.observe) { + Object.observe(obj, observer); + for (var key in obj) { + if (obj.hasOwnProperty(key)) { + var v = obj[key]; + if (v && typeof(v) === "object") { + _observe(observer, v); + } + } + } + } + return observer; + } + function _unobserve(observer, obj) { + if (Object.observe) { + Object.unobserve(obj, observer); + for (var key in obj) { + if (obj.hasOwnProperty(key)) { + var v = obj[key]; + if (v && typeof(v) === "object") { + _unobserve(observer, v); + } + } + } + } + return observer; + } + function generate(observer) { + if (Object.observe) { + Object.deliverChangeRecords(observer); + } else { + var mirror; + for (var i = 0, + ilen = beforeDict.length; i < ilen; i++) { + if (beforeDict[i].obj === observer.object) { + mirror = beforeDict[i]; + break; + } + } + if (mirror) { + _generate(mirror.value, observer.object, observer.patches, ""); + } + } + var temp = observer.patches; + if (temp.length > 0) { + observer.patches = []; + if (observer.callback) { + observer.callback(temp); + } + } + return temp; + } + jsonpatch.generate = generate; + var _objectKeys; + if (Object.keys) { + _objectKeys = Object.keys; + } else { + _objectKeys = function(obj) { + var keys = []; + for (var o in obj) { + if (obj.hasOwnProperty(o)) { + keys.push(o); + } + } + return keys; + }; + } + function _generate(mirror, obj, patches, path) { + var newKeys = _objectKeys(obj); + var oldKeys = _objectKeys(mirror); + var changed = false; + var deleted = false; + for (var t = oldKeys.length - 1; t >= 0; t--) { + var key = oldKeys[t]; + var oldVal = mirror[key]; + if (obj.hasOwnProperty(key)) { + var newVal = obj[key]; + if (oldVal instanceof Object) { + _generate(oldVal, newVal, patches, path + "/" + escapePathComponent(key)); + } else { + if (oldVal != newVal) { + changed = true; + patches.push({ + op: "replace", + path: path + "/" + escapePathComponent(key), + value: newVal + }); + mirror[key] = newVal; + } + } + } else { + patches.push({ + op: "remove", + path: path + "/" + escapePathComponent(key) + }); + delete mirror[key]; + deleted = true; + } + } + if (!deleted && newKeys.length == oldKeys.length) { + return; + } + for (var t = 0; t < newKeys.length; t++) { + var key = newKeys[t]; + if (!mirror.hasOwnProperty(key)) { + patches.push({ + op: "add", + path: path + "/" + escapePathComponent(key), + value: obj[key] + }); + mirror[key] = JSON.parse(JSON.stringify(obj[key])); + } + } + } + var _isArray; + if (Array.isArray) { + _isArray = Array.isArray; + } else { + _isArray = function(obj) { + return obj.push && typeof obj.length === 'number'; + }; + } + function apply(tree, patches) { + var result = false, + p = 0, + plen = patches.length, + patch; + while (p < plen) { + patch = patches[p]; + var keys = patch.path.split('/'); + var obj = tree; + var t = 1; + var len = keys.length; + while (true) { + if (_isArray(obj)) { + var index = parseInt(keys[t], 10); + t++; + if (t >= len) { + result = arrOps[patch.op].call(patch, obj, index, tree); + break; + } + obj = obj[index]; + } else { + var key = keys[t]; + if (key.indexOf('~') != -1) { + key = key.replace(/~1/g, '/').replace(/~0/g, '~'); + } + t++; + if (t >= len) { + result = objOps[patch.op].call(patch, obj, key, tree); + break; + } + obj = obj[key]; + } + } + p++; + } + return result; + } + jsonpatch.apply = apply; +})(jsonpatch || (jsonpatch = {})); +if (typeof exports !== "undefined") { + exports.apply = jsonpatch.apply; + exports.observe = jsonpatch.observe; + exports.unobserve = jsonpatch.unobserve; + exports.generate = jsonpatch.generate; +} + +//# +},{}],"moment":[function(require,module,exports){ +//! moment.js +//! version : 2.10.6 +//! authors : Tim Wood, Iskren Chernev, Moment.js contributors +//! license : MIT +//! momentjs.com + +(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() : + typeof define === 'function' && define.amd ? define(factory) : + global.moment = factory() +}(this, function () { 'use strict'; + + var hookCallback; + + function utils_hooks__hooks () { + return hookCallback.apply(null, arguments); + } + + // This is done to register the method called with moment() + // without creating circular dependencies. + function setHookCallback (callback) { + hookCallback = callback; + } + + function isArray(input) { + return Object.prototype.toString.call(input) === '[object Array]'; + } + + function isDate(input) { + return input instanceof Date || Object.prototype.toString.call(input) === '[object Date]'; + } + + function map(arr, fn) { + var res = [], i; + for (i = 0; i < arr.length; ++i) { + res.push(fn(arr[i], i)); + } + return res; + } + + function hasOwnProp(a, b) { + return Object.prototype.hasOwnProperty.call(a, b); + } + + function extend(a, b) { + for (var i in b) { + if (hasOwnProp(b, i)) { + a[i] = b[i]; + } + } + + if (hasOwnProp(b, 'toString')) { + a.toString = b.toString; + } + + if (hasOwnProp(b, 'valueOf')) { + a.valueOf = b.valueOf; + } + + return a; + } + + function create_utc__createUTC (input, format, locale, strict) { + return createLocalOrUTC(input, format, locale, strict, true).utc(); + } + + function defaultParsingFlags() { + // We need to deep clone this object. + return { + empty : false, + unusedTokens : [], + unusedInput : [], + overflow : -2, + charsLeftOver : 0, + nullInput : false, + invalidMonth : null, + invalidFormat : false, + userInvalidated : false, + iso : false + }; + } + + function getParsingFlags(m) { + if (m._pf == null) { + m._pf = defaultParsingFlags(); + } + return m._pf; + } + + function valid__isValid(m) { + if (m._isValid == null) { + var flags = getParsingFlags(m); + m._isValid = !isNaN(m._d.getTime()) && + flags.overflow < 0 && + !flags.empty && + !flags.invalidMonth && + !flags.invalidWeekday && + !flags.nullInput && + !flags.invalidFormat && + !flags.userInvalidated; + + if (m._strict) { + m._isValid = m._isValid && + flags.charsLeftOver === 0 && + flags.unusedTokens.length === 0 && + flags.bigHour === undefined; + } + } + return m._isValid; + } + + function valid__createInvalid (flags) { + var m = create_utc__createUTC(NaN); + if (flags != null) { + extend(getParsingFlags(m), flags); + } + else { + getParsingFlags(m).userInvalidated = true; + } + + return m; + } + + var momentProperties = utils_hooks__hooks.momentProperties = []; + + function copyConfig(to, from) { + var i, prop, val; + + if (typeof from._isAMomentObject !== 'undefined') { + to._isAMomentObject = from._isAMomentObject; + } + if (typeof from._i !== 'undefined') { + to._i = from._i; + } + if (typeof from._f !== 'undefined') { + to._f = from._f; + } + if (typeof from._l !== 'undefined') { + to._l = from._l; + } + if (typeof from._strict !== 'undefined') { + to._strict = from._strict; + } + if (typeof from._tzm !== 'undefined') { + to._tzm = from._tzm; + } + if (typeof from._isUTC !== 'undefined') { + to._isUTC = from._isUTC; + } + if (typeof from._offset !== 'undefined') { + to._offset = from._offset; + } + if (typeof from._pf !== 'undefined') { + to._pf = getParsingFlags(from); + } + if (typeof from._locale !== 'undefined') { + to._locale = from._locale; + } + + if (momentProperties.length > 0) { + for (i in momentProperties) { + prop = momentProperties[i]; + val = from[prop]; + if (typeof val !== 'undefined') { + to[prop] = val; + } + } + } + + return to; + } + + var updateInProgress = false; + + // Moment prototype object + function Moment(config) { + copyConfig(this, config); + this._d = new Date(config._d != null ? config._d.getTime() : NaN); + // Prevent infinite loop in case updateOffset creates new moment + // objects. + if (updateInProgress === false) { + updateInProgress = true; + utils_hooks__hooks.updateOffset(this); + updateInProgress = false; + } + } + + function isMoment (obj) { + return obj instanceof Moment || (obj != null && obj._isAMomentObject != null); + } + + function absFloor (number) { + if (number < 0) { + return Math.ceil(number); + } else { + return Math.floor(number); + } + } + + function toInt(argumentForCoercion) { + var coercedNumber = +argumentForCoercion, + value = 0; + + if (coercedNumber !== 0 && isFinite(coercedNumber)) { + value = absFloor(coercedNumber); + } + + return value; + } + + function compareArrays(array1, array2, dontConvert) { + var len = Math.min(array1.length, array2.length), + lengthDiff = Math.abs(array1.length - array2.length), + diffs = 0, + i; + for (i = 0; i < len; i++) { + if ((dontConvert && array1[i] !== array2[i]) || + (!dontConvert && toInt(array1[i]) !== toInt(array2[i]))) { + diffs++; + } + } + return diffs + lengthDiff; + } + + function Locale() { + } + + var locales = {}; + var globalLocale; + + function normalizeLocale(key) { + return key ? key.toLowerCase().replace('_', '-') : key; + } + + // pick the locale from the array + // try ['en-au', 'en-gb'] as 'en-au', 'en-gb', 'en', as in move through the list trying each + // substring from most specific to least, but move to the next array item if it's a more specific variant than the current root + function chooseLocale(names) { + var i = 0, j, next, locale, split; + + while (i < names.length) { + split = normalizeLocale(names[i]).split('-'); + j = split.length; + next = normalizeLocale(names[i + 1]); + next = next ? next.split('-') : null; + while (j > 0) { + locale = loadLocale(split.slice(0, j).join('-')); + if (locale) { + return locale; + } + if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) { + //the next array item is better than a shallower substring of this one + break; + } + j--; + } + i++; + } + return null; + } + + function loadLocale(name) { + var oldLocale = null; + // TODO: Find a better way to register and load all the locales in Node + if (!locales[name] && typeof module !== 'undefined' && + module && module.exports) { + try { + oldLocale = globalLocale._abbr; + require('./locale/' + name); + // because defineLocale currently also sets the global locale, we + // want to undo that for lazy loaded locales + locale_locales__getSetGlobalLocale(oldLocale); + } catch (e) { } + } + return locales[name]; + } + + // This function will load locale and then set the global locale. If + // no arguments are passed in, it will simply return the current global + // locale key. + function locale_locales__getSetGlobalLocale (key, values) { + var data; + if (key) { + if (typeof values === 'undefined') { + data = locale_locales__getLocale(key); + } + else { + data = defineLocale(key, values); + } + + if (data) { + // moment.duration._locale = moment._locale = data; + globalLocale = data; + } + } + + return globalLocale._abbr; + } + + function defineLocale (name, values) { + if (values !== null) { + values.abbr = name; + locales[name] = locales[name] || new Locale(); + locales[name].set(values); + + // backwards compat for now: also set the locale + locale_locales__getSetGlobalLocale(name); + + return locales[name]; + } else { + // useful for testing + delete locales[name]; + return null; + } + } + + // returns locale data + function locale_locales__getLocale (key) { + var locale; + + if (key && key._locale && key._locale._abbr) { + key = key._locale._abbr; + } + + if (!key) { + return globalLocale; + } + + if (!isArray(key)) { + //short-circuit everything else + locale = loadLocale(key); + if (locale) { + return locale; + } + key = [key]; + } + + return chooseLocale(key); + } + + var aliases = {}; + + function addUnitAlias (unit, shorthand) { + var lowerCase = unit.toLowerCase(); + aliases[lowerCase] = aliases[lowerCase + 's'] = aliases[shorthand] = unit; + } + + function normalizeUnits(units) { + return typeof units === 'string' ? aliases[units] || aliases[units.toLowerCase()] : undefined; + } + + function normalizeObjectUnits(inputObject) { + var normalizedInput = {}, + normalizedProp, + prop; + + for (prop in inputObject) { + if (hasOwnProp(inputObject, prop)) { + normalizedProp = normalizeUnits(prop); + if (normalizedProp) { + normalizedInput[normalizedProp] = inputObject[prop]; + } + } + } + + return normalizedInput; + } + + function makeGetSet (unit, keepTime) { + return function (value) { + if (value != null) { + get_set__set(this, unit, value); + utils_hooks__hooks.updateOffset(this, keepTime); + return this; + } else { + return get_set__get(this, unit); + } + }; + } + + function get_set__get (mom, unit) { + return mom._d['get' + (mom._isUTC ? 'UTC' : '') + unit](); + } + + function get_set__set (mom, unit, value) { + return mom._d['set' + (mom._isUTC ? 'UTC' : '') + unit](value); + } + + // MOMENTS + + function getSet (units, value) { + var unit; + if (typeof units === 'object') { + for (unit in units) { + this.set(unit, units[unit]); + } + } else { + units = normalizeUnits(units); + if (typeof this[units] === 'function') { + return this[units](value); + } + } + return this; + } + + function zeroFill(number, targetLength, forceSign) { + var absNumber = '' + Math.abs(number), + zerosToFill = targetLength - absNumber.length, + sign = number >= 0; + return (sign ? (forceSign ? '+' : '') : '-') + + Math.pow(10, Math.max(0, zerosToFill)).toString().substr(1) + absNumber; + } + + var formattingTokens = /(\[[^\[]*\])|(\\)?(Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Q|YYYYYY|YYYYY|YYYY|YY|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g; + + var localFormattingTokens = /(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g; + + var formatFunctions = {}; + + var formatTokenFunctions = {}; + + // token: 'M' + // padded: ['MM', 2] + // ordinal: 'Mo' + // callback: function () { this.month() + 1 } + function addFormatToken (token, padded, ordinal, callback) { + var func = callback; + if (typeof callback === 'string') { + func = function () { + return this[callback](); + }; + } + if (token) { + formatTokenFunctions[token] = func; + } + if (padded) { + formatTokenFunctions[padded[0]] = function () { + return zeroFill(func.apply(this, arguments), padded[1], padded[2]); + }; + } + if (ordinal) { + formatTokenFunctions[ordinal] = function () { + return this.localeData().ordinal(func.apply(this, arguments), token); + }; + } + } + + function removeFormattingTokens(input) { + if (input.match(/\[[\s\S]/)) { + return input.replace(/^\[|\]$/g, ''); + } + return input.replace(/\\/g, ''); + } + + function makeFormatFunction(format) { + var array = format.match(formattingTokens), i, length; + + for (i = 0, length = array.length; i < length; i++) { + if (formatTokenFunctions[array[i]]) { + array[i] = formatTokenFunctions[array[i]]; + } else { + array[i] = removeFormattingTokens(array[i]); + } + } + + return function (mom) { + var output = ''; + for (i = 0; i < length; i++) { + output += array[i] instanceof Function ? array[i].call(mom, format) : array[i]; + } + return output; + }; + } + + // format date using native date object + function formatMoment(m, format) { + if (!m.isValid()) { + return m.localeData().invalidDate(); + } + + format = expandFormat(format, m.localeData()); + formatFunctions[format] = formatFunctions[format] || makeFormatFunction(format); + + return formatFunctions[format](m); + } + + function expandFormat(format, locale) { + var i = 5; + + function replaceLongDateFormatTokens(input) { + return locale.longDateFormat(input) || input; + } + + localFormattingTokens.lastIndex = 0; + while (i >= 0 && localFormattingTokens.test(format)) { + format = format.replace(localFormattingTokens, replaceLongDateFormatTokens); + localFormattingTokens.lastIndex = 0; + i -= 1; + } + + return format; + } + + var match1 = /\d/; // 0 - 9 + var match2 = /\d\d/; // 00 - 99 + var match3 = /\d{3}/; // 000 - 999 + var match4 = /\d{4}/; // 0000 - 9999 + var match6 = /[+-]?\d{6}/; // -999999 - 999999 + var match1to2 = /\d\d?/; // 0 - 99 + var match1to3 = /\d{1,3}/; // 0 - 999 + var match1to4 = /\d{1,4}/; // 0 - 9999 + var match1to6 = /[+-]?\d{1,6}/; // -999999 - 999999 + + var matchUnsigned = /\d+/; // 0 - inf + var matchSigned = /[+-]?\d+/; // -inf - inf + + var matchOffset = /Z|[+-]\d\d:?\d\d/gi; // +00:00 -00:00 +0000 -0000 or Z + + var matchTimestamp = /[+-]?\d+(\.\d{1,3})?/; // 123456789 123456789.123 + + // any word (or two) characters or numbers including two/three word month in arabic. + var matchWord = /[0-9]*['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+|[\u0600-\u06FF\/]+(\s*?[\u0600-\u06FF]+){1,2}/i; + + var regexes = {}; + + function isFunction (sth) { + // https://github.com/moment/moment/issues/2325 + return typeof sth === 'function' && + Object.prototype.toString.call(sth) === '[object Function]'; + } + + + function addRegexToken (token, regex, strictRegex) { + regexes[token] = isFunction(regex) ? regex : function (isStrict) { + return (isStrict && strictRegex) ? strictRegex : regex; + }; + } + + function getParseRegexForToken (token, config) { + if (!hasOwnProp(regexes, token)) { + return new RegExp(unescapeFormat(token)); + } + + return regexes[token](config._strict, config._locale); + } + + // Code from http://stackoverflow.com/questions/3561493/is-there-a-regexp-escape-function-in-javascript + function unescapeFormat(s) { + return s.replace('\\', '').replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g, function (matched, p1, p2, p3, p4) { + return p1 || p2 || p3 || p4; + }).replace(/[-\/\\^$*+?.()|[\]{}]/g, '\\$&'); + } + + var tokens = {}; + + function addParseToken (token, callback) { + var i, func = callback; + if (typeof token === 'string') { + token = [token]; + } + if (typeof callback === 'number') { + func = function (input, array) { + array[callback] = toInt(input); + }; + } + for (i = 0; i < token.length; i++) { + tokens[token[i]] = func; + } + } + + function addWeekParseToken (token, callback) { + addParseToken(token, function (input, array, config, token) { + config._w = config._w || {}; + callback(input, config._w, config, token); + }); + } + + function addTimeToArrayFromToken(token, input, config) { + if (input != null && hasOwnProp(tokens, token)) { + tokens[token](input, config._a, config, token); + } + } + + var YEAR = 0; + var MONTH = 1; + var DATE = 2; + var HOUR = 3; + var MINUTE = 4; + var SECOND = 5; + var MILLISECOND = 6; + + function daysInMonth(year, month) { + return new Date(Date.UTC(year, month + 1, 0)).getUTCDate(); + } + + // FORMATTING + + addFormatToken('M', ['MM', 2], 'Mo', function () { + return this.month() + 1; + }); + + addFormatToken('MMM', 0, 0, function (format) { + return this.localeData().monthsShort(this, format); + }); + + addFormatToken('MMMM', 0, 0, function (format) { + return this.localeData().months(this, format); + }); + + // ALIASES + + addUnitAlias('month', 'M'); + + // PARSING + + addRegexToken('M', match1to2); + addRegexToken('MM', match1to2, match2); + addRegexToken('MMM', matchWord); + addRegexToken('MMMM', matchWord); + + addParseToken(['M', 'MM'], function (input, array) { + array[MONTH] = toInt(input) - 1; + }); + + addParseToken(['MMM', 'MMMM'], function (input, array, config, token) { + var month = config._locale.monthsParse(input, token, config._strict); + // if we didn't find a month name, mark the date as invalid. + if (month != null) { + array[MONTH] = month; + } else { + getParsingFlags(config).invalidMonth = input; + } + }); + + // LOCALES + + var defaultLocaleMonths = 'January_February_March_April_May_June_July_August_September_October_November_December'.split('_'); + function localeMonths (m) { + return this._months[m.month()]; + } + + var defaultLocaleMonthsShort = 'Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec'.split('_'); + function localeMonthsShort (m) { + return this._monthsShort[m.month()]; + } + + function localeMonthsParse (monthName, format, strict) { + var i, mom, regex; + + if (!this._monthsParse) { + this._monthsParse = []; + this._longMonthsParse = []; + this._shortMonthsParse = []; + } + + for (i = 0; i < 12; i++) { + // make the regex if we don't have it already + mom = create_utc__createUTC([2000, i]); + if (strict && !this._longMonthsParse[i]) { + this._longMonthsParse[i] = new RegExp('^' + this.months(mom, '').replace('.', '') + '$', 'i'); + this._shortMonthsParse[i] = new RegExp('^' + this.monthsShort(mom, '').replace('.', '') + '$', 'i'); + } + if (!strict && !this._monthsParse[i]) { + regex = '^' + this.months(mom, '') + '|^' + this.monthsShort(mom, ''); + this._monthsParse[i] = new RegExp(regex.replace('.', ''), 'i'); + } + // test the regex + if (strict && format === 'MMMM' && this._longMonthsParse[i].test(monthName)) { + return i; + } else if (strict && format === 'MMM' && this._shortMonthsParse[i].test(monthName)) { + return i; + } else if (!strict && this._monthsParse[i].test(monthName)) { + return i; + } + } + } + + // MOMENTS + + function setMonth (mom, value) { + var dayOfMonth; + + // TODO: Move this out of here! + if (typeof value === 'string') { + value = mom.localeData().monthsParse(value); + // TODO: Another silent failure? + if (typeof value !== 'number') { + return mom; + } + } + + dayOfMonth = Math.min(mom.date(), daysInMonth(mom.year(), value)); + mom._d['set' + (mom._isUTC ? 'UTC' : '') + 'Month'](value, dayOfMonth); + return mom; + } + + function getSetMonth (value) { + if (value != null) { + setMonth(this, value); + utils_hooks__hooks.updateOffset(this, true); + return this; + } else { + return get_set__get(this, 'Month'); + } + } + + function getDaysInMonth () { + return daysInMonth(this.year(), this.month()); + } + + function checkOverflow (m) { + var overflow; + var a = m._a; + + if (a && getParsingFlags(m).overflow === -2) { + overflow = + a[MONTH] < 0 || a[MONTH] > 11 ? MONTH : + a[DATE] < 1 || a[DATE] > daysInMonth(a[YEAR], a[MONTH]) ? DATE : + a[HOUR] < 0 || a[HOUR] > 24 || (a[HOUR] === 24 && (a[MINUTE] !== 0 || a[SECOND] !== 0 || a[MILLISECOND] !== 0)) ? HOUR : + a[MINUTE] < 0 || a[MINUTE] > 59 ? MINUTE : + a[SECOND] < 0 || a[SECOND] > 59 ? SECOND : + a[MILLISECOND] < 0 || a[MILLISECOND] > 999 ? MILLISECOND : + -1; + + if (getParsingFlags(m)._overflowDayOfYear && (overflow < YEAR || overflow > DATE)) { + overflow = DATE; + } + + getParsingFlags(m).overflow = overflow; + } + + return m; + } + + function warn(msg) { + if (utils_hooks__hooks.suppressDeprecationWarnings === false && typeof console !== 'undefined' && console.warn) { + console.warn('Deprecation warning: ' + msg); + } + } + + function deprecate(msg, fn) { + var firstTime = true; + + return extend(function () { + if (firstTime) { + warn(msg + '\n' + (new Error()).stack); + firstTime = false; + } + return fn.apply(this, arguments); + }, fn); + } + + var deprecations = {}; + + function deprecateSimple(name, msg) { + if (!deprecations[name]) { + warn(msg); + deprecations[name] = true; + } + } + + utils_hooks__hooks.suppressDeprecationWarnings = false; + + var from_string__isoRegex = /^\s*(?:[+-]\d{6}|\d{4})-(?:(\d\d-\d\d)|(W\d\d$)|(W\d\d-\d)|(\d\d\d))((T| )(\d\d(:\d\d(:\d\d(\.\d+)?)?)?)?([\+\-]\d\d(?::?\d\d)?|\s*Z)?)?$/; + + var isoDates = [ + ['YYYYYY-MM-DD', /[+-]\d{6}-\d{2}-\d{2}/], + ['YYYY-MM-DD', /\d{4}-\d{2}-\d{2}/], + ['GGGG-[W]WW-E', /\d{4}-W\d{2}-\d/], + ['GGGG-[W]WW', /\d{4}-W\d{2}/], + ['YYYY-DDD', /\d{4}-\d{3}/] + ]; + + // iso time formats and regexes + var isoTimes = [ + ['HH:mm:ss.SSSS', /(T| )\d\d:\d\d:\d\d\.\d+/], + ['HH:mm:ss', /(T| )\d\d:\d\d:\d\d/], + ['HH:mm', /(T| )\d\d:\d\d/], + ['HH', /(T| )\d\d/] + ]; + + var aspNetJsonRegex = /^\/?Date\((\-?\d+)/i; + + // date from iso format + function configFromISO(config) { + var i, l, + string = config._i, + match = from_string__isoRegex.exec(string); + + if (match) { + getParsingFlags(config).iso = true; + for (i = 0, l = isoDates.length; i < l; i++) { + if (isoDates[i][1].exec(string)) { + config._f = isoDates[i][0]; + break; + } + } + for (i = 0, l = isoTimes.length; i < l; i++) { + if (isoTimes[i][1].exec(string)) { + // match[6] should be 'T' or space + config._f += (match[6] || ' ') + isoTimes[i][0]; + break; + } + } + if (string.match(matchOffset)) { + config._f += 'Z'; + } + configFromStringAndFormat(config); + } else { + config._isValid = false; + } + } + + // date from iso format or fallback + function configFromString(config) { + var matched = aspNetJsonRegex.exec(config._i); + + if (matched !== null) { + config._d = new Date(+matched[1]); + return; + } + + configFromISO(config); + if (config._isValid === false) { + delete config._isValid; + utils_hooks__hooks.createFromInputFallback(config); + } + } + + utils_hooks__hooks.createFromInputFallback = deprecate( + 'moment construction falls back to js Date. This is ' + + 'discouraged and will be removed in upcoming major ' + + 'release. Please refer to ' + + 'https://github.com/moment/moment/issues/1407 for more info.', + function (config) { + config._d = new Date(config._i + (config._useUTC ? ' UTC' : '')); + } + ); + + function createDate (y, m, d, h, M, s, ms) { + //can't just apply() to create a date: + //http://stackoverflow.com/questions/181348/instantiating-a-javascript-object-by-calling-prototype-constructor-apply + var date = new Date(y, m, d, h, M, s, ms); + + //the date constructor doesn't accept years < 1970 + if (y < 1970) { + date.setFullYear(y); + } + return date; + } + + function createUTCDate (y) { + var date = new Date(Date.UTC.apply(null, arguments)); + if (y < 1970) { + date.setUTCFullYear(y); + } + return date; + } + + addFormatToken(0, ['YY', 2], 0, function () { + return this.year() % 100; + }); + + addFormatToken(0, ['YYYY', 4], 0, 'year'); + addFormatToken(0, ['YYYYY', 5], 0, 'year'); + addFormatToken(0, ['YYYYYY', 6, true], 0, 'year'); + + // ALIASES + + addUnitAlias('year', 'y'); + + // PARSING + + addRegexToken('Y', matchSigned); + addRegexToken('YY', match1to2, match2); + addRegexToken('YYYY', match1to4, match4); + addRegexToken('YYYYY', match1to6, match6); + addRegexToken('YYYYYY', match1to6, match6); + + addParseToken(['YYYYY', 'YYYYYY'], YEAR); + addParseToken('YYYY', function (input, array) { + array[YEAR] = input.length === 2 ? utils_hooks__hooks.parseTwoDigitYear(input) : toInt(input); + }); + addParseToken('YY', function (input, array) { + array[YEAR] = utils_hooks__hooks.parseTwoDigitYear(input); + }); + + // HELPERS + + function daysInYear(year) { + return isLeapYear(year) ? 366 : 365; + } + + function isLeapYear(year) { + return (year % 4 === 0 && year % 100 !== 0) || year % 400 === 0; + } + + // HOOKS + + utils_hooks__hooks.parseTwoDigitYear = function (input) { + return toInt(input) + (toInt(input) > 68 ? 1900 : 2000); + }; + + // MOMENTS + + var getSetYear = makeGetSet('FullYear', false); + + function getIsLeapYear () { + return isLeapYear(this.year()); + } + + addFormatToken('w', ['ww', 2], 'wo', 'week'); + addFormatToken('W', ['WW', 2], 'Wo', 'isoWeek'); + + // ALIASES + + addUnitAlias('week', 'w'); + addUnitAlias('isoWeek', 'W'); + + // PARSING + + addRegexToken('w', match1to2); + addRegexToken('ww', match1to2, match2); + addRegexToken('W', match1to2); + addRegexToken('WW', match1to2, match2); + + addWeekParseToken(['w', 'ww', 'W', 'WW'], function (input, week, config, token) { + week[token.substr(0, 1)] = toInt(input); + }); + + // HELPERS + + // firstDayOfWeek 0 = sun, 6 = sat + // the day of the week that starts the week + // (usually sunday or monday) + // firstDayOfWeekOfYear 0 = sun, 6 = sat + // the first week is the week that contains the first + // of this day of the week + // (eg. ISO weeks use thursday (4)) + function weekOfYear(mom, firstDayOfWeek, firstDayOfWeekOfYear) { + var end = firstDayOfWeekOfYear - firstDayOfWeek, + daysToDayOfWeek = firstDayOfWeekOfYear - mom.day(), + adjustedMoment; + + + if (daysToDayOfWeek > end) { + daysToDayOfWeek -= 7; + } + + if (daysToDayOfWeek < end - 7) { + daysToDayOfWeek += 7; + } + + adjustedMoment = local__createLocal(mom).add(daysToDayOfWeek, 'd'); + return { + week: Math.ceil(adjustedMoment.dayOfYear() / 7), + year: adjustedMoment.year() + }; + } + + // LOCALES + + function localeWeek (mom) { + return weekOfYear(mom, this._week.dow, this._week.doy).week; + } + + var defaultLocaleWeek = { + dow : 0, // Sunday is the first day of the week. + doy : 6 // The week that contains Jan 1st is the first week of the year. + }; + + function localeFirstDayOfWeek () { + return this._week.dow; + } + + function localeFirstDayOfYear () { + return this._week.doy; + } + + // MOMENTS + + function getSetWeek (input) { + var week = this.localeData().week(this); + return input == null ? week : this.add((input - week) * 7, 'd'); + } + + function getSetISOWeek (input) { + var week = weekOfYear(this, 1, 4).week; + return input == null ? week : this.add((input - week) * 7, 'd'); + } + + addFormatToken('DDD', ['DDDD', 3], 'DDDo', 'dayOfYear'); + + // ALIASES + + addUnitAlias('dayOfYear', 'DDD'); + + // PARSING + + addRegexToken('DDD', match1to3); + addRegexToken('DDDD', match3); + addParseToken(['DDD', 'DDDD'], function (input, array, config) { + config._dayOfYear = toInt(input); + }); + + // HELPERS + + //http://en.wikipedia.org/wiki/ISO_week_date#Calculating_a_date_given_the_year.2C_week_number_and_weekday + function dayOfYearFromWeeks(year, week, weekday, firstDayOfWeekOfYear, firstDayOfWeek) { + var week1Jan = 6 + firstDayOfWeek - firstDayOfWeekOfYear, janX = createUTCDate(year, 0, 1 + week1Jan), d = janX.getUTCDay(), dayOfYear; + if (d < firstDayOfWeek) { + d += 7; + } + + weekday = weekday != null ? 1 * weekday : firstDayOfWeek; + + dayOfYear = 1 + week1Jan + 7 * (week - 1) - d + weekday; + + return { + year: dayOfYear > 0 ? year : year - 1, + dayOfYear: dayOfYear > 0 ? dayOfYear : daysInYear(year - 1) + dayOfYear + }; + } + + // MOMENTS + + function getSetDayOfYear (input) { + var dayOfYear = Math.round((this.clone().startOf('day') - this.clone().startOf('year')) / 864e5) + 1; + return input == null ? dayOfYear : this.add((input - dayOfYear), 'd'); + } + + // Pick the first defined of two or three arguments. + function defaults(a, b, c) { + if (a != null) { + return a; + } + if (b != null) { + return b; + } + return c; + } + + function currentDateArray(config) { + var now = new Date(); + if (config._useUTC) { + return [now.getUTCFullYear(), now.getUTCMonth(), now.getUTCDate()]; + } + return [now.getFullYear(), now.getMonth(), now.getDate()]; + } + + // convert an array to a date. + // the array should mirror the parameters below + // note: all values past the year are optional and will default to the lowest possible value. + // [year, month, day , hour, minute, second, millisecond] + function configFromArray (config) { + var i, date, input = [], currentDate, yearToUse; + + if (config._d) { + return; + } + + currentDate = currentDateArray(config); + + //compute day of the year from weeks and weekdays + if (config._w && config._a[DATE] == null && config._a[MONTH] == null) { + dayOfYearFromWeekInfo(config); + } + + //if the day of the year is set, figure out what it is + if (config._dayOfYear) { + yearToUse = defaults(config._a[YEAR], currentDate[YEAR]); + + if (config._dayOfYear > daysInYear(yearToUse)) { + getParsingFlags(config)._overflowDayOfYear = true; + } + + date = createUTCDate(yearToUse, 0, config._dayOfYear); + config._a[MONTH] = date.getUTCMonth(); + config._a[DATE] = date.getUTCDate(); + } + + // Default to current date. + // * if no year, month, day of month are given, default to today + // * if day of month is given, default month and year + // * if month is given, default only year + // * if year is given, don't default anything + for (i = 0; i < 3 && config._a[i] == null; ++i) { + config._a[i] = input[i] = currentDate[i]; + } + + // Zero out whatever was not defaulted, including time + for (; i < 7; i++) { + config._a[i] = input[i] = (config._a[i] == null) ? (i === 2 ? 1 : 0) : config._a[i]; + } + + // Check for 24:00:00.000 + if (config._a[HOUR] === 24 && + config._a[MINUTE] === 0 && + config._a[SECOND] === 0 && + config._a[MILLISECOND] === 0) { + config._nextDay = true; + config._a[HOUR] = 0; + } + + config._d = (config._useUTC ? createUTCDate : createDate).apply(null, input); + // Apply timezone offset from input. The actual utcOffset can be changed + // with parseZone. + if (config._tzm != null) { + config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm); + } + + if (config._nextDay) { + config._a[HOUR] = 24; + } + } + + function dayOfYearFromWeekInfo(config) { + var w, weekYear, week, weekday, dow, doy, temp; + + w = config._w; + if (w.GG != null || w.W != null || w.E != null) { + dow = 1; + doy = 4; + + // TODO: We need to take the current isoWeekYear, but that depends on + // how we interpret now (local, utc, fixed offset). So create + // a now version of current config (take local/utc/offset flags, and + // create now). + weekYear = defaults(w.GG, config._a[YEAR], weekOfYear(local__createLocal(), 1, 4).year); + week = defaults(w.W, 1); + weekday = defaults(w.E, 1); + } else { + dow = config._locale._week.dow; + doy = config._locale._week.doy; + + weekYear = defaults(w.gg, config._a[YEAR], weekOfYear(local__createLocal(), dow, doy).year); + week = defaults(w.w, 1); + + if (w.d != null) { + // weekday -- low day numbers are considered next week + weekday = w.d; + if (weekday < dow) { + ++week; + } + } else if (w.e != null) { + // local weekday -- counting starts from begining of week + weekday = w.e + dow; + } else { + // default to begining of week + weekday = dow; + } + } + temp = dayOfYearFromWeeks(weekYear, week, weekday, doy, dow); + + config._a[YEAR] = temp.year; + config._dayOfYear = temp.dayOfYear; + } + + utils_hooks__hooks.ISO_8601 = function () {}; + + // date from string and format string + function configFromStringAndFormat(config) { + // TODO: Move this to another part of the creation flow to prevent circular deps + if (config._f === utils_hooks__hooks.ISO_8601) { + configFromISO(config); + return; + } + + config._a = []; + getParsingFlags(config).empty = true; + + // This array is used to make a Date, either with `new Date` or `Date.UTC` + var string = '' + config._i, + i, parsedInput, tokens, token, skipped, + stringLength = string.length, + totalParsedInputLength = 0; + + tokens = expandFormat(config._f, config._locale).match(formattingTokens) || []; + + for (i = 0; i < tokens.length; i++) { + token = tokens[i]; + parsedInput = (string.match(getParseRegexForToken(token, config)) || [])[0]; + if (parsedInput) { + skipped = string.substr(0, string.indexOf(parsedInput)); + if (skipped.length > 0) { + getParsingFlags(config).unusedInput.push(skipped); + } + string = string.slice(string.indexOf(parsedInput) + parsedInput.length); + totalParsedInputLength += parsedInput.length; + } + // don't parse if it's not a known token + if (formatTokenFunctions[token]) { + if (parsedInput) { + getParsingFlags(config).empty = false; + } + else { + getParsingFlags(config).unusedTokens.push(token); + } + addTimeToArrayFromToken(token, parsedInput, config); + } + else if (config._strict && !parsedInput) { + getParsingFlags(config).unusedTokens.push(token); + } + } + + // add remaining unparsed input length to the string + getParsingFlags(config).charsLeftOver = stringLength - totalParsedInputLength; + if (string.length > 0) { + getParsingFlags(config).unusedInput.push(string); + } + + // clear _12h flag if hour is <= 12 + if (getParsingFlags(config).bigHour === true && + config._a[HOUR] <= 12 && + config._a[HOUR] > 0) { + getParsingFlags(config).bigHour = undefined; + } + // handle meridiem + config._a[HOUR] = meridiemFixWrap(config._locale, config._a[HOUR], config._meridiem); + + configFromArray(config); + checkOverflow(config); + } + + + function meridiemFixWrap (locale, hour, meridiem) { + var isPm; + + if (meridiem == null) { + // nothing to do + return hour; + } + if (locale.meridiemHour != null) { + return locale.meridiemHour(hour, meridiem); + } else if (locale.isPM != null) { + // Fallback + isPm = locale.isPM(meridiem); + if (isPm && hour < 12) { + hour += 12; + } + if (!isPm && hour === 12) { + hour = 0; + } + return hour; + } else { + // this is not supposed to happen + return hour; + } + } + + function configFromStringAndArray(config) { + var tempConfig, + bestMoment, + + scoreToBeat, + i, + currentScore; + + if (config._f.length === 0) { + getParsingFlags(config).invalidFormat = true; + config._d = new Date(NaN); + return; + } + + for (i = 0; i < config._f.length; i++) { + currentScore = 0; + tempConfig = copyConfig({}, config); + if (config._useUTC != null) { + tempConfig._useUTC = config._useUTC; + } + tempConfig._f = config._f[i]; + configFromStringAndFormat(tempConfig); + + if (!valid__isValid(tempConfig)) { + continue; + } + + // if there is any input that was not parsed add a penalty for that format + currentScore += getParsingFlags(tempConfig).charsLeftOver; + + //or tokens + currentScore += getParsingFlags(tempConfig).unusedTokens.length * 10; + + getParsingFlags(tempConfig).score = currentScore; + + if (scoreToBeat == null || currentScore < scoreToBeat) { + scoreToBeat = currentScore; + bestMoment = tempConfig; + } + } + + extend(config, bestMoment || tempConfig); + } + + function configFromObject(config) { + if (config._d) { + return; + } + + var i = normalizeObjectUnits(config._i); + config._a = [i.year, i.month, i.day || i.date, i.hour, i.minute, i.second, i.millisecond]; + + configFromArray(config); + } + + function createFromConfig (config) { + var res = new Moment(checkOverflow(prepareConfig(config))); + if (res._nextDay) { + // Adding is smart enough around DST + res.add(1, 'd'); + res._nextDay = undefined; + } + + return res; + } + + function prepareConfig (config) { + var input = config._i, + format = config._f; + + config._locale = config._locale || locale_locales__getLocale(config._l); + + if (input === null || (format === undefined && input === '')) { + return valid__createInvalid({nullInput: true}); + } + + if (typeof input === 'string') { + config._i = input = config._locale.preparse(input); + } + + if (isMoment(input)) { + return new Moment(checkOverflow(input)); + } else if (isArray(format)) { + configFromStringAndArray(config); + } else if (format) { + configFromStringAndFormat(config); + } else if (isDate(input)) { + config._d = input; + } else { + configFromInput(config); + } + + return config; + } + + function configFromInput(config) { + var input = config._i; + if (input === undefined) { + config._d = new Date(); + } else if (isDate(input)) { + config._d = new Date(+input); + } else if (typeof input === 'string') { + configFromString(config); + } else if (isArray(input)) { + config._a = map(input.slice(0), function (obj) { + return parseInt(obj, 10); + }); + configFromArray(config); + } else if (typeof(input) === 'object') { + configFromObject(config); + } else if (typeof(input) === 'number') { + // from milliseconds + config._d = new Date(input); + } else { + utils_hooks__hooks.createFromInputFallback(config); + } + } + + function createLocalOrUTC (input, format, locale, strict, isUTC) { + var c = {}; + + if (typeof(locale) === 'boolean') { + strict = locale; + locale = undefined; + } + // object construction must be done this way. + // https://github.com/moment/moment/issues/1423 + c._isAMomentObject = true; + c._useUTC = c._isUTC = isUTC; + c._l = locale; + c._i = input; + c._f = format; + c._strict = strict; + + return createFromConfig(c); + } + + function local__createLocal (input, format, locale, strict) { + return createLocalOrUTC(input, format, locale, strict, false); + } + + var prototypeMin = deprecate( + 'moment().min is deprecated, use moment.min instead. https://github.com/moment/moment/issues/1548', + function () { + var other = local__createLocal.apply(null, arguments); + return other < this ? this : other; + } + ); + + var prototypeMax = deprecate( + 'moment().max is deprecated, use moment.max instead. https://github.com/moment/moment/issues/1548', + function () { + var other = local__createLocal.apply(null, arguments); + return other > this ? this : other; + } + ); + + // Pick a moment m from moments so that m[fn](other) is true for all + // other. This relies on the function fn to be transitive. + // + // moments should either be an array of moment objects or an array, whose + // first element is an array of moment objects. + function pickBy(fn, moments) { + var res, i; + if (moments.length === 1 && isArray(moments[0])) { + moments = moments[0]; + } + if (!moments.length) { + return local__createLocal(); + } + res = moments[0]; + for (i = 1; i < moments.length; ++i) { + if (!moments[i].isValid() || moments[i][fn](res)) { + res = moments[i]; + } + } + return res; + } + + // TODO: Use [].sort instead? + function min () { + var args = [].slice.call(arguments, 0); + + return pickBy('isBefore', args); + } + + function max () { + var args = [].slice.call(arguments, 0); + + return pickBy('isAfter', args); + } + + function Duration (duration) { + var normalizedInput = normalizeObjectUnits(duration), + years = normalizedInput.year || 0, + quarters = normalizedInput.quarter || 0, + months = normalizedInput.month || 0, + weeks = normalizedInput.week || 0, + days = normalizedInput.day || 0, + hours = normalizedInput.hour || 0, + minutes = normalizedInput.minute || 0, + seconds = normalizedInput.second || 0, + milliseconds = normalizedInput.millisecond || 0; + + // representation for dateAddRemove + this._milliseconds = +milliseconds + + seconds * 1e3 + // 1000 + minutes * 6e4 + // 1000 * 60 + hours * 36e5; // 1000 * 60 * 60 + // Because of dateAddRemove treats 24 hours as different from a + // day when working around DST, we need to store them separately + this._days = +days + + weeks * 7; + // It is impossible translate months into days without knowing + // which months you are are talking about, so we have to store + // it separately. + this._months = +months + + quarters * 3 + + years * 12; + + this._data = {}; + + this._locale = locale_locales__getLocale(); + + this._bubble(); + } + + function isDuration (obj) { + return obj instanceof Duration; + } + + function offset (token, separator) { + addFormatToken(token, 0, 0, function () { + var offset = this.utcOffset(); + var sign = '+'; + if (offset < 0) { + offset = -offset; + sign = '-'; + } + return sign + zeroFill(~~(offset / 60), 2) + separator + zeroFill(~~(offset) % 60, 2); + }); + } + + offset('Z', ':'); + offset('ZZ', ''); + + // PARSING + + addRegexToken('Z', matchOffset); + addRegexToken('ZZ', matchOffset); + addParseToken(['Z', 'ZZ'], function (input, array, config) { + config._useUTC = true; + config._tzm = offsetFromString(input); + }); + + // HELPERS + + // timezone chunker + // '+10:00' > ['10', '00'] + // '-1530' > ['-15', '30'] + var chunkOffset = /([\+\-]|\d\d)/gi; + + function offsetFromString(string) { + var matches = ((string || '').match(matchOffset) || []); + var chunk = matches[matches.length - 1] || []; + var parts = (chunk + '').match(chunkOffset) || ['-', 0, 0]; + var minutes = +(parts[1] * 60) + toInt(parts[2]); + + return parts[0] === '+' ? minutes : -minutes; + } + + // Return a moment from input, that is local/utc/zone equivalent to model. + function cloneWithOffset(input, model) { + var res, diff; + if (model._isUTC) { + res = model.clone(); + diff = (isMoment(input) || isDate(input) ? +input : +local__createLocal(input)) - (+res); + // Use low-level api, because this fn is low-level api. + res._d.setTime(+res._d + diff); + utils_hooks__hooks.updateOffset(res, false); + return res; + } else { + return local__createLocal(input).local(); + } + } + + function getDateOffset (m) { + // On Firefox.24 Date#getTimezoneOffset returns a floating point. + // https://github.com/moment/moment/pull/1871 + return -Math.round(m._d.getTimezoneOffset() / 15) * 15; + } + + // HOOKS + + // This function will be called whenever a moment is mutated. + // It is intended to keep the offset in sync with the timezone. + utils_hooks__hooks.updateOffset = function () {}; + + // MOMENTS + + // keepLocalTime = true means only change the timezone, without + // affecting the local hour. So 5:31:26 +0300 --[utcOffset(2, true)]--> + // 5:31:26 +0200 It is possible that 5:31:26 doesn't exist with offset + // +0200, so we adjust the time as needed, to be valid. + // + // Keeping the time actually adds/subtracts (one hour) + // from the actual represented time. That is why we call updateOffset + // a second time. In case it wants us to change the offset again + // _changeInProgress == true case, then we have to adjust, because + // there is no such time in the given timezone. + function getSetOffset (input, keepLocalTime) { + var offset = this._offset || 0, + localAdjust; + if (input != null) { + if (typeof input === 'string') { + input = offsetFromString(input); + } + if (Math.abs(input) < 16) { + input = input * 60; + } + if (!this._isUTC && keepLocalTime) { + localAdjust = getDateOffset(this); + } + this._offset = input; + this._isUTC = true; + if (localAdjust != null) { + this.add(localAdjust, 'm'); + } + if (offset !== input) { + if (!keepLocalTime || this._changeInProgress) { + add_subtract__addSubtract(this, create__createDuration(input - offset, 'm'), 1, false); + } else if (!this._changeInProgress) { + this._changeInProgress = true; + utils_hooks__hooks.updateOffset(this, true); + this._changeInProgress = null; + } + } + return this; + } else { + return this._isUTC ? offset : getDateOffset(this); + } + } + + function getSetZone (input, keepLocalTime) { + if (input != null) { + if (typeof input !== 'string') { + input = -input; + } + + this.utcOffset(input, keepLocalTime); + + return this; + } else { + return -this.utcOffset(); + } + } + + function setOffsetToUTC (keepLocalTime) { + return this.utcOffset(0, keepLocalTime); + } + + function setOffsetToLocal (keepLocalTime) { + if (this._isUTC) { + this.utcOffset(0, keepLocalTime); + this._isUTC = false; + + if (keepLocalTime) { + this.subtract(getDateOffset(this), 'm'); + } + } + return this; + } + + function setOffsetToParsedOffset () { + if (this._tzm) { + this.utcOffset(this._tzm); + } else if (typeof this._i === 'string') { + this.utcOffset(offsetFromString(this._i)); + } + return this; + } + + function hasAlignedHourOffset (input) { + input = input ? local__createLocal(input).utcOffset() : 0; + + return (this.utcOffset() - input) % 60 === 0; + } + + function isDaylightSavingTime () { + return ( + this.utcOffset() > this.clone().month(0).utcOffset() || + this.utcOffset() > this.clone().month(5).utcOffset() + ); + } + + function isDaylightSavingTimeShifted () { + if (typeof this._isDSTShifted !== 'undefined') { + return this._isDSTShifted; + } + + var c = {}; + + copyConfig(c, this); + c = prepareConfig(c); + + if (c._a) { + var other = c._isUTC ? create_utc__createUTC(c._a) : local__createLocal(c._a); + this._isDSTShifted = this.isValid() && + compareArrays(c._a, other.toArray()) > 0; + } else { + this._isDSTShifted = false; + } + + return this._isDSTShifted; + } + + function isLocal () { + return !this._isUTC; + } + + function isUtcOffset () { + return this._isUTC; + } + + function isUtc () { + return this._isUTC && this._offset === 0; + } + + var aspNetRegex = /(\-)?(?:(\d*)\.)?(\d+)\:(\d+)(?:\:(\d+)\.?(\d{3})?)?/; + + // from http://docs.closure-library.googlecode.com/git/closure_goog_date_date.js.source.html + // somewhat more in line with 4.4.3.2 2004 spec, but allows decimal anywhere + var create__isoRegex = /^(-)?P(?:(?:([0-9,.]*)Y)?(?:([0-9,.]*)M)?(?:([0-9,.]*)D)?(?:T(?:([0-9,.]*)H)?(?:([0-9,.]*)M)?(?:([0-9,.]*)S)?)?|([0-9,.]*)W)$/; + + function create__createDuration (input, key) { + var duration = input, + // matching against regexp is expensive, do it on demand + match = null, + sign, + ret, + diffRes; + + if (isDuration(input)) { + duration = { + ms : input._milliseconds, + d : input._days, + M : input._months + }; + } else if (typeof input === 'number') { + duration = {}; + if (key) { + duration[key] = input; + } else { + duration.milliseconds = input; + } + } else if (!!(match = aspNetRegex.exec(input))) { + sign = (match[1] === '-') ? -1 : 1; + duration = { + y : 0, + d : toInt(match[DATE]) * sign, + h : toInt(match[HOUR]) * sign, + m : toInt(match[MINUTE]) * sign, + s : toInt(match[SECOND]) * sign, + ms : toInt(match[MILLISECOND]) * sign + }; + } else if (!!(match = create__isoRegex.exec(input))) { + sign = (match[1] === '-') ? -1 : 1; + duration = { + y : parseIso(match[2], sign), + M : parseIso(match[3], sign), + d : parseIso(match[4], sign), + h : parseIso(match[5], sign), + m : parseIso(match[6], sign), + s : parseIso(match[7], sign), + w : parseIso(match[8], sign) + }; + } else if (duration == null) {// checks for null or undefined + duration = {}; + } else if (typeof duration === 'object' && ('from' in duration || 'to' in duration)) { + diffRes = momentsDifference(local__createLocal(duration.from), local__createLocal(duration.to)); + + duration = {}; + duration.ms = diffRes.milliseconds; + duration.M = diffRes.months; + } + + ret = new Duration(duration); + + if (isDuration(input) && hasOwnProp(input, '_locale')) { + ret._locale = input._locale; + } + + return ret; + } + + create__createDuration.fn = Duration.prototype; + + function parseIso (inp, sign) { + // We'd normally use ~~inp for this, but unfortunately it also + // converts floats to ints. + // inp may be undefined, so careful calling replace on it. + var res = inp && parseFloat(inp.replace(',', '.')); + // apply sign while we're at it + return (isNaN(res) ? 0 : res) * sign; + } + + function positiveMomentsDifference(base, other) { + var res = {milliseconds: 0, months: 0}; + + res.months = other.month() - base.month() + + (other.year() - base.year()) * 12; + if (base.clone().add(res.months, 'M').isAfter(other)) { + --res.months; + } + + res.milliseconds = +other - +(base.clone().add(res.months, 'M')); + + return res; + } + + function momentsDifference(base, other) { + var res; + other = cloneWithOffset(other, base); + if (base.isBefore(other)) { + res = positiveMomentsDifference(base, other); + } else { + res = positiveMomentsDifference(other, base); + res.milliseconds = -res.milliseconds; + res.months = -res.months; + } + + return res; + } + + function createAdder(direction, name) { + return function (val, period) { + var dur, tmp; + //invert the arguments, but complain about it + if (period !== null && !isNaN(+period)) { + deprecateSimple(name, 'moment().' + name + '(period, number) is deprecated. Please use moment().' + name + '(number, period).'); + tmp = val; val = period; period = tmp; + } + + val = typeof val === 'string' ? +val : val; + dur = create__createDuration(val, period); + add_subtract__addSubtract(this, dur, direction); + return this; + }; + } + + function add_subtract__addSubtract (mom, duration, isAdding, updateOffset) { + var milliseconds = duration._milliseconds, + days = duration._days, + months = duration._months; + updateOffset = updateOffset == null ? true : updateOffset; + + if (milliseconds) { + mom._d.setTime(+mom._d + milliseconds * isAdding); + } + if (days) { + get_set__set(mom, 'Date', get_set__get(mom, 'Date') + days * isAdding); + } + if (months) { + setMonth(mom, get_set__get(mom, 'Month') + months * isAdding); + } + if (updateOffset) { + utils_hooks__hooks.updateOffset(mom, days || months); + } + } + + var add_subtract__add = createAdder(1, 'add'); + var add_subtract__subtract = createAdder(-1, 'subtract'); + + function moment_calendar__calendar (time, formats) { + // We want to compare the start of today, vs this. + // Getting start-of-today depends on whether we're local/utc/offset or not. + var now = time || local__createLocal(), + sod = cloneWithOffset(now, this).startOf('day'), + diff = this.diff(sod, 'days', true), + format = diff < -6 ? 'sameElse' : + diff < -1 ? 'lastWeek' : + diff < 0 ? 'lastDay' : + diff < 1 ? 'sameDay' : + diff < 2 ? 'nextDay' : + diff < 7 ? 'nextWeek' : 'sameElse'; + return this.format(formats && formats[format] || this.localeData().calendar(format, this, local__createLocal(now))); + } + + function clone () { + return new Moment(this); + } + + function isAfter (input, units) { + var inputMs; + units = normalizeUnits(typeof units !== 'undefined' ? units : 'millisecond'); + if (units === 'millisecond') { + input = isMoment(input) ? input : local__createLocal(input); + return +this > +input; + } else { + inputMs = isMoment(input) ? +input : +local__createLocal(input); + return inputMs < +this.clone().startOf(units); + } + } + + function isBefore (input, units) { + var inputMs; + units = normalizeUnits(typeof units !== 'undefined' ? units : 'millisecond'); + if (units === 'millisecond') { + input = isMoment(input) ? input : local__createLocal(input); + return +this < +input; + } else { + inputMs = isMoment(input) ? +input : +local__createLocal(input); + return +this.clone().endOf(units) < inputMs; + } + } + + function isBetween (from, to, units) { + return this.isAfter(from, units) && this.isBefore(to, units); + } + + function isSame (input, units) { + var inputMs; + units = normalizeUnits(units || 'millisecond'); + if (units === 'millisecond') { + input = isMoment(input) ? input : local__createLocal(input); + return +this === +input; + } else { + inputMs = +local__createLocal(input); + return +(this.clone().startOf(units)) <= inputMs && inputMs <= +(this.clone().endOf(units)); + } + } + + function diff (input, units, asFloat) { + var that = cloneWithOffset(input, this), + zoneDelta = (that.utcOffset() - this.utcOffset()) * 6e4, + delta, output; + + units = normalizeUnits(units); + + if (units === 'year' || units === 'month' || units === 'quarter') { + output = monthDiff(this, that); + if (units === 'quarter') { + output = output / 3; + } else if (units === 'year') { + output = output / 12; + } + } else { + delta = this - that; + output = units === 'second' ? delta / 1e3 : // 1000 + units === 'minute' ? delta / 6e4 : // 1000 * 60 + units === 'hour' ? delta / 36e5 : // 1000 * 60 * 60 + units === 'day' ? (delta - zoneDelta) / 864e5 : // 1000 * 60 * 60 * 24, negate dst + units === 'week' ? (delta - zoneDelta) / 6048e5 : // 1000 * 60 * 60 * 24 * 7, negate dst + delta; + } + return asFloat ? output : absFloor(output); + } + + function monthDiff (a, b) { + // difference in months + var wholeMonthDiff = ((b.year() - a.year()) * 12) + (b.month() - a.month()), + // b is in (anchor - 1 month, anchor + 1 month) + anchor = a.clone().add(wholeMonthDiff, 'months'), + anchor2, adjust; + + if (b - anchor < 0) { + anchor2 = a.clone().add(wholeMonthDiff - 1, 'months'); + // linear across the month + adjust = (b - anchor) / (anchor - anchor2); + } else { + anchor2 = a.clone().add(wholeMonthDiff + 1, 'months'); + // linear across the month + adjust = (b - anchor) / (anchor2 - anchor); + } + + return -(wholeMonthDiff + adjust); + } + + utils_hooks__hooks.defaultFormat = 'YYYY-MM-DDTHH:mm:ssZ'; + + function toString () { + return this.clone().locale('en').format('ddd MMM DD YYYY HH:mm:ss [GMT]ZZ'); + } + + function moment_format__toISOString () { + var m = this.clone().utc(); + if (0 < m.year() && m.year() <= 9999) { + if ('function' === typeof Date.prototype.toISOString) { + // native implementation is ~50x faster, use it when we can + return this.toDate().toISOString(); + } else { + return formatMoment(m, 'YYYY-MM-DD[T]HH:mm:ss.SSS[Z]'); + } + } else { + return formatMoment(m, 'YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]'); + } + } + + function format (inputString) { + var output = formatMoment(this, inputString || utils_hooks__hooks.defaultFormat); + return this.localeData().postformat(output); + } + + function from (time, withoutSuffix) { + if (!this.isValid()) { + return this.localeData().invalidDate(); + } + return create__createDuration({to: this, from: time}).locale(this.locale()).humanize(!withoutSuffix); + } + + function fromNow (withoutSuffix) { + return this.from(local__createLocal(), withoutSuffix); + } + + function to (time, withoutSuffix) { + if (!this.isValid()) { + return this.localeData().invalidDate(); + } + return create__createDuration({from: this, to: time}).locale(this.locale()).humanize(!withoutSuffix); + } + + function toNow (withoutSuffix) { + return this.to(local__createLocal(), withoutSuffix); + } + + function locale (key) { + var newLocaleData; + + if (key === undefined) { + return this._locale._abbr; + } else { + newLocaleData = locale_locales__getLocale(key); + if (newLocaleData != null) { + this._locale = newLocaleData; + } + return this; + } + } + + var lang = deprecate( + 'moment().lang() is deprecated. Instead, use moment().localeData() to get the language configuration. Use moment().locale() to change languages.', + function (key) { + if (key === undefined) { + return this.localeData(); + } else { + return this.locale(key); + } + } + ); + + function localeData () { + return this._locale; + } + + function startOf (units) { + units = normalizeUnits(units); + // the following switch intentionally omits break keywords + // to utilize falling through the cases. + switch (units) { + case 'year': + this.month(0); + /* falls through */ + case 'quarter': + case 'month': + this.date(1); + /* falls through */ + case 'week': + case 'isoWeek': + case 'day': + this.hours(0); + /* falls through */ + case 'hour': + this.minutes(0); + /* falls through */ + case 'minute': + this.seconds(0); + /* falls through */ + case 'second': + this.milliseconds(0); + } + + // weeks are a special case + if (units === 'week') { + this.weekday(0); + } + if (units === 'isoWeek') { + this.isoWeekday(1); + } + + // quarters are also special + if (units === 'quarter') { + this.month(Math.floor(this.month() / 3) * 3); + } + + return this; + } + + function endOf (units) { + units = normalizeUnits(units); + if (units === undefined || units === 'millisecond') { + return this; + } + return this.startOf(units).add(1, (units === 'isoWeek' ? 'week' : units)).subtract(1, 'ms'); + } + + function to_type__valueOf () { + return +this._d - ((this._offset || 0) * 60000); + } + + function unix () { + return Math.floor(+this / 1000); + } + + function toDate () { + return this._offset ? new Date(+this) : this._d; + } + + function toArray () { + var m = this; + return [m.year(), m.month(), m.date(), m.hour(), m.minute(), m.second(), m.millisecond()]; + } + + function toObject () { + var m = this; + return { + years: m.year(), + months: m.month(), + date: m.date(), + hours: m.hours(), + minutes: m.minutes(), + seconds: m.seconds(), + milliseconds: m.milliseconds() + }; + } + + function moment_valid__isValid () { + return valid__isValid(this); + } + + function parsingFlags () { + return extend({}, getParsingFlags(this)); + } + + function invalidAt () { + return getParsingFlags(this).overflow; + } + + addFormatToken(0, ['gg', 2], 0, function () { + return this.weekYear() % 100; + }); + + addFormatToken(0, ['GG', 2], 0, function () { + return this.isoWeekYear() % 100; + }); + + function addWeekYearFormatToken (token, getter) { + addFormatToken(0, [token, token.length], 0, getter); + } + + addWeekYearFormatToken('gggg', 'weekYear'); + addWeekYearFormatToken('ggggg', 'weekYear'); + addWeekYearFormatToken('GGGG', 'isoWeekYear'); + addWeekYearFormatToken('GGGGG', 'isoWeekYear'); + + // ALIASES + + addUnitAlias('weekYear', 'gg'); + addUnitAlias('isoWeekYear', 'GG'); + + // PARSING + + addRegexToken('G', matchSigned); + addRegexToken('g', matchSigned); + addRegexToken('GG', match1to2, match2); + addRegexToken('gg', match1to2, match2); + addRegexToken('GGGG', match1to4, match4); + addRegexToken('gggg', match1to4, match4); + addRegexToken('GGGGG', match1to6, match6); + addRegexToken('ggggg', match1to6, match6); + + addWeekParseToken(['gggg', 'ggggg', 'GGGG', 'GGGGG'], function (input, week, config, token) { + week[token.substr(0, 2)] = toInt(input); + }); + + addWeekParseToken(['gg', 'GG'], function (input, week, config, token) { + week[token] = utils_hooks__hooks.parseTwoDigitYear(input); + }); + + // HELPERS + + function weeksInYear(year, dow, doy) { + return weekOfYear(local__createLocal([year, 11, 31 + dow - doy]), dow, doy).week; + } + + // MOMENTS + + function getSetWeekYear (input) { + var year = weekOfYear(this, this.localeData()._week.dow, this.localeData()._week.doy).year; + return input == null ? year : this.add((input - year), 'y'); + } + + function getSetISOWeekYear (input) { + var year = weekOfYear(this, 1, 4).year; + return input == null ? year : this.add((input - year), 'y'); + } + + function getISOWeeksInYear () { + return weeksInYear(this.year(), 1, 4); + } + + function getWeeksInYear () { + var weekInfo = this.localeData()._week; + return weeksInYear(this.year(), weekInfo.dow, weekInfo.doy); + } + + addFormatToken('Q', 0, 0, 'quarter'); + + // ALIASES + + addUnitAlias('quarter', 'Q'); + + // PARSING + + addRegexToken('Q', match1); + addParseToken('Q', function (input, array) { + array[MONTH] = (toInt(input) - 1) * 3; + }); + + // MOMENTS + + function getSetQuarter (input) { + return input == null ? Math.ceil((this.month() + 1) / 3) : this.month((input - 1) * 3 + this.month() % 3); + } + + addFormatToken('D', ['DD', 2], 'Do', 'date'); + + // ALIASES + + addUnitAlias('date', 'D'); + + // PARSING + + addRegexToken('D', match1to2); + addRegexToken('DD', match1to2, match2); + addRegexToken('Do', function (isStrict, locale) { + return isStrict ? locale._ordinalParse : locale._ordinalParseLenient; + }); + + addParseToken(['D', 'DD'], DATE); + addParseToken('Do', function (input, array) { + array[DATE] = toInt(input.match(match1to2)[0], 10); + }); + + // MOMENTS + + var getSetDayOfMonth = makeGetSet('Date', true); + + addFormatToken('d', 0, 'do', 'day'); + + addFormatToken('dd', 0, 0, function (format) { + return this.localeData().weekdaysMin(this, format); + }); + + addFormatToken('ddd', 0, 0, function (format) { + return this.localeData().weekdaysShort(this, format); + }); + + addFormatToken('dddd', 0, 0, function (format) { + return this.localeData().weekdays(this, format); + }); + + addFormatToken('e', 0, 0, 'weekday'); + addFormatToken('E', 0, 0, 'isoWeekday'); + + // ALIASES + + addUnitAlias('day', 'd'); + addUnitAlias('weekday', 'e'); + addUnitAlias('isoWeekday', 'E'); + + // PARSING + + addRegexToken('d', match1to2); + addRegexToken('e', match1to2); + addRegexToken('E', match1to2); + addRegexToken('dd', matchWord); + addRegexToken('ddd', matchWord); + addRegexToken('dddd', matchWord); + + addWeekParseToken(['dd', 'ddd', 'dddd'], function (input, week, config) { + var weekday = config._locale.weekdaysParse(input); + // if we didn't get a weekday name, mark the date as invalid + if (weekday != null) { + week.d = weekday; + } else { + getParsingFlags(config).invalidWeekday = input; + } + }); + + addWeekParseToken(['d', 'e', 'E'], function (input, week, config, token) { + week[token] = toInt(input); + }); + + // HELPERS + + function parseWeekday(input, locale) { + if (typeof input !== 'string') { + return input; + } + + if (!isNaN(input)) { + return parseInt(input, 10); + } + + input = locale.weekdaysParse(input); + if (typeof input === 'number') { + return input; + } + + return null; + } + + // LOCALES + + var defaultLocaleWeekdays = 'Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday'.split('_'); + function localeWeekdays (m) { + return this._weekdays[m.day()]; + } + + var defaultLocaleWeekdaysShort = 'Sun_Mon_Tue_Wed_Thu_Fri_Sat'.split('_'); + function localeWeekdaysShort (m) { + return this._weekdaysShort[m.day()]; + } + + var defaultLocaleWeekdaysMin = 'Su_Mo_Tu_We_Th_Fr_Sa'.split('_'); + function localeWeekdaysMin (m) { + return this._weekdaysMin[m.day()]; + } + + function localeWeekdaysParse (weekdayName) { + var i, mom, regex; + + this._weekdaysParse = this._weekdaysParse || []; + + for (i = 0; i < 7; i++) { + // make the regex if we don't have it already + if (!this._weekdaysParse[i]) { + mom = local__createLocal([2000, 1]).day(i); + regex = '^' + this.weekdays(mom, '') + '|^' + this.weekdaysShort(mom, '') + '|^' + this.weekdaysMin(mom, ''); + this._weekdaysParse[i] = new RegExp(regex.replace('.', ''), 'i'); + } + // test the regex + if (this._weekdaysParse[i].test(weekdayName)) { + return i; + } + } + } + + // MOMENTS + + function getSetDayOfWeek (input) { + var day = this._isUTC ? this._d.getUTCDay() : this._d.getDay(); + if (input != null) { + input = parseWeekday(input, this.localeData()); + return this.add(input - day, 'd'); + } else { + return day; + } + } + + function getSetLocaleDayOfWeek (input) { + var weekday = (this.day() + 7 - this.localeData()._week.dow) % 7; + return input == null ? weekday : this.add(input - weekday, 'd'); + } + + function getSetISODayOfWeek (input) { + // behaves the same as moment#day except + // as a getter, returns 7 instead of 0 (1-7 range instead of 0-6) + // as a setter, sunday should belong to the previous week. + return input == null ? this.day() || 7 : this.day(this.day() % 7 ? input : input - 7); + } + + addFormatToken('H', ['HH', 2], 0, 'hour'); + addFormatToken('h', ['hh', 2], 0, function () { + return this.hours() % 12 || 12; + }); + + function meridiem (token, lowercase) { + addFormatToken(token, 0, 0, function () { + return this.localeData().meridiem(this.hours(), this.minutes(), lowercase); + }); + } + + meridiem('a', true); + meridiem('A', false); + + // ALIASES + + addUnitAlias('hour', 'h'); + + // PARSING + + function matchMeridiem (isStrict, locale) { + return locale._meridiemParse; + } + + addRegexToken('a', matchMeridiem); + addRegexToken('A', matchMeridiem); + addRegexToken('H', match1to2); + addRegexToken('h', match1to2); + addRegexToken('HH', match1to2, match2); + addRegexToken('hh', match1to2, match2); + + addParseToken(['H', 'HH'], HOUR); + addParseToken(['a', 'A'], function (input, array, config) { + config._isPm = config._locale.isPM(input); + config._meridiem = input; + }); + addParseToken(['h', 'hh'], function (input, array, config) { + array[HOUR] = toInt(input); + getParsingFlags(config).bigHour = true; + }); + + // LOCALES + + function localeIsPM (input) { + // IE8 Quirks Mode & IE7 Standards Mode do not allow accessing strings like arrays + // Using charAt should be more compatible. + return ((input + '').toLowerCase().charAt(0) === 'p'); + } + + var defaultLocaleMeridiemParse = /[ap]\.?m?\.?/i; + function localeMeridiem (hours, minutes, isLower) { + if (hours > 11) { + return isLower ? 'pm' : 'PM'; + } else { + return isLower ? 'am' : 'AM'; + } + } + + + // MOMENTS + + // Setting the hour should keep the time, because the user explicitly + // specified which hour he wants. So trying to maintain the same hour (in + // a new timezone) makes sense. Adding/subtracting hours does not follow + // this rule. + var getSetHour = makeGetSet('Hours', true); + + addFormatToken('m', ['mm', 2], 0, 'minute'); + + // ALIASES + + addUnitAlias('minute', 'm'); + + // PARSING + + addRegexToken('m', match1to2); + addRegexToken('mm', match1to2, match2); + addParseToken(['m', 'mm'], MINUTE); + + // MOMENTS + + var getSetMinute = makeGetSet('Minutes', false); + + addFormatToken('s', ['ss', 2], 0, 'second'); + + // ALIASES + + addUnitAlias('second', 's'); + + // PARSING + + addRegexToken('s', match1to2); + addRegexToken('ss', match1to2, match2); + addParseToken(['s', 'ss'], SECOND); + + // MOMENTS + + var getSetSecond = makeGetSet('Seconds', false); + + addFormatToken('S', 0, 0, function () { + return ~~(this.millisecond() / 100); + }); + + addFormatToken(0, ['SS', 2], 0, function () { + return ~~(this.millisecond() / 10); + }); + + addFormatToken(0, ['SSS', 3], 0, 'millisecond'); + addFormatToken(0, ['SSSS', 4], 0, function () { + return this.millisecond() * 10; + }); + addFormatToken(0, ['SSSSS', 5], 0, function () { + return this.millisecond() * 100; + }); + addFormatToken(0, ['SSSSSS', 6], 0, function () { + return this.millisecond() * 1000; + }); + addFormatToken(0, ['SSSSSSS', 7], 0, function () { + return this.millisecond() * 10000; + }); + addFormatToken(0, ['SSSSSSSS', 8], 0, function () { + return this.millisecond() * 100000; + }); + addFormatToken(0, ['SSSSSSSSS', 9], 0, function () { + return this.millisecond() * 1000000; + }); + + + // ALIASES + + addUnitAlias('millisecond', 'ms'); + + // PARSING + + addRegexToken('S', match1to3, match1); + addRegexToken('SS', match1to3, match2); + addRegexToken('SSS', match1to3, match3); + + var token; + for (token = 'SSSS'; token.length <= 9; token += 'S') { + addRegexToken(token, matchUnsigned); + } + + function parseMs(input, array) { + array[MILLISECOND] = toInt(('0.' + input) * 1000); + } + + for (token = 'S'; token.length <= 9; token += 'S') { + addParseToken(token, parseMs); + } + // MOMENTS + + var getSetMillisecond = makeGetSet('Milliseconds', false); + + addFormatToken('z', 0, 0, 'zoneAbbr'); + addFormatToken('zz', 0, 0, 'zoneName'); + + // MOMENTS + + function getZoneAbbr () { + return this._isUTC ? 'UTC' : ''; + } + + function getZoneName () { + return this._isUTC ? 'Coordinated Universal Time' : ''; + } + + var momentPrototype__proto = Moment.prototype; + + momentPrototype__proto.add = add_subtract__add; + momentPrototype__proto.calendar = moment_calendar__calendar; + momentPrototype__proto.clone = clone; + momentPrototype__proto.diff = diff; + momentPrototype__proto.endOf = endOf; + momentPrototype__proto.format = format; + momentPrototype__proto.from = from; + momentPrototype__proto.fromNow = fromNow; + momentPrototype__proto.to = to; + momentPrototype__proto.toNow = toNow; + momentPrototype__proto.get = getSet; + momentPrototype__proto.invalidAt = invalidAt; + momentPrototype__proto.isAfter = isAfter; + momentPrototype__proto.isBefore = isBefore; + momentPrototype__proto.isBetween = isBetween; + momentPrototype__proto.isSame = isSame; + momentPrototype__proto.isValid = moment_valid__isValid; + momentPrototype__proto.lang = lang; + momentPrototype__proto.locale = locale; + momentPrototype__proto.localeData = localeData; + momentPrototype__proto.max = prototypeMax; + momentPrototype__proto.min = prototypeMin; + momentPrototype__proto.parsingFlags = parsingFlags; + momentPrototype__proto.set = getSet; + momentPrototype__proto.startOf = startOf; + momentPrototype__proto.subtract = add_subtract__subtract; + momentPrototype__proto.toArray = toArray; + momentPrototype__proto.toObject = toObject; + momentPrototype__proto.toDate = toDate; + momentPrototype__proto.toISOString = moment_format__toISOString; + momentPrototype__proto.toJSON = moment_format__toISOString; + momentPrototype__proto.toString = toString; + momentPrototype__proto.unix = unix; + momentPrototype__proto.valueOf = to_type__valueOf; + + // Year + momentPrototype__proto.year = getSetYear; + momentPrototype__proto.isLeapYear = getIsLeapYear; + + // Week Year + momentPrototype__proto.weekYear = getSetWeekYear; + momentPrototype__proto.isoWeekYear = getSetISOWeekYear; + + // Quarter + momentPrototype__proto.quarter = momentPrototype__proto.quarters = getSetQuarter; + + // Month + momentPrototype__proto.month = getSetMonth; + momentPrototype__proto.daysInMonth = getDaysInMonth; + + // Week + momentPrototype__proto.week = momentPrototype__proto.weeks = getSetWeek; + momentPrototype__proto.isoWeek = momentPrototype__proto.isoWeeks = getSetISOWeek; + momentPrototype__proto.weeksInYear = getWeeksInYear; + momentPrototype__proto.isoWeeksInYear = getISOWeeksInYear; + + // Day + momentPrototype__proto.date = getSetDayOfMonth; + momentPrototype__proto.day = momentPrototype__proto.days = getSetDayOfWeek; + momentPrototype__proto.weekday = getSetLocaleDayOfWeek; + momentPrototype__proto.isoWeekday = getSetISODayOfWeek; + momentPrototype__proto.dayOfYear = getSetDayOfYear; + + // Hour + momentPrototype__proto.hour = momentPrototype__proto.hours = getSetHour; + + // Minute + momentPrototype__proto.minute = momentPrototype__proto.minutes = getSetMinute; + + // Second + momentPrototype__proto.second = momentPrototype__proto.seconds = getSetSecond; + + // Millisecond + momentPrototype__proto.millisecond = momentPrototype__proto.milliseconds = getSetMillisecond; + + // Offset + momentPrototype__proto.utcOffset = getSetOffset; + momentPrototype__proto.utc = setOffsetToUTC; + momentPrototype__proto.local = setOffsetToLocal; + momentPrototype__proto.parseZone = setOffsetToParsedOffset; + momentPrototype__proto.hasAlignedHourOffset = hasAlignedHourOffset; + momentPrototype__proto.isDST = isDaylightSavingTime; + momentPrototype__proto.isDSTShifted = isDaylightSavingTimeShifted; + momentPrototype__proto.isLocal = isLocal; + momentPrototype__proto.isUtcOffset = isUtcOffset; + momentPrototype__proto.isUtc = isUtc; + momentPrototype__proto.isUTC = isUtc; + + // Timezone + momentPrototype__proto.zoneAbbr = getZoneAbbr; + momentPrototype__proto.zoneName = getZoneName; + + // Deprecations + momentPrototype__proto.dates = deprecate('dates accessor is deprecated. Use date instead.', getSetDayOfMonth); + momentPrototype__proto.months = deprecate('months accessor is deprecated. Use month instead', getSetMonth); + momentPrototype__proto.years = deprecate('years accessor is deprecated. Use year instead', getSetYear); + momentPrototype__proto.zone = deprecate('moment().zone is deprecated, use moment().utcOffset instead. https://github.com/moment/moment/issues/1779', getSetZone); + + var momentPrototype = momentPrototype__proto; + + function moment__createUnix (input) { + return local__createLocal(input * 1000); + } + + function moment__createInZone () { + return local__createLocal.apply(null, arguments).parseZone(); + } + + var defaultCalendar = { + sameDay : '[Today at] LT', + nextDay : '[Tomorrow at] LT', + nextWeek : 'dddd [at] LT', + lastDay : '[Yesterday at] LT', + lastWeek : '[Last] dddd [at] LT', + sameElse : 'L' + }; + + function locale_calendar__calendar (key, mom, now) { + var output = this._calendar[key]; + return typeof output === 'function' ? output.call(mom, now) : output; + } + + var defaultLongDateFormat = { + LTS : 'h:mm:ss A', + LT : 'h:mm A', + L : 'MM/DD/YYYY', + LL : 'MMMM D, YYYY', + LLL : 'MMMM D, YYYY h:mm A', + LLLL : 'dddd, MMMM D, YYYY h:mm A' + }; + + function longDateFormat (key) { + var format = this._longDateFormat[key], + formatUpper = this._longDateFormat[key.toUpperCase()]; + + if (format || !formatUpper) { + return format; + } + + this._longDateFormat[key] = formatUpper.replace(/MMMM|MM|DD|dddd/g, function (val) { + return val.slice(1); + }); + + return this._longDateFormat[key]; + } + + var defaultInvalidDate = 'Invalid date'; + + function invalidDate () { + return this._invalidDate; + } + + var defaultOrdinal = '%d'; + var defaultOrdinalParse = /\d{1,2}/; + + function ordinal (number) { + return this._ordinal.replace('%d', number); + } + + function preParsePostFormat (string) { + return string; + } + + var defaultRelativeTime = { + future : 'in %s', + past : '%s ago', + s : 'a few seconds', + m : 'a minute', + mm : '%d minutes', + h : 'an hour', + hh : '%d hours', + d : 'a day', + dd : '%d days', + M : 'a month', + MM : '%d months', + y : 'a year', + yy : '%d years' + }; + + function relative__relativeTime (number, withoutSuffix, string, isFuture) { + var output = this._relativeTime[string]; + return (typeof output === 'function') ? + output(number, withoutSuffix, string, isFuture) : + output.replace(/%d/i, number); + } + + function pastFuture (diff, output) { + var format = this._relativeTime[diff > 0 ? 'future' : 'past']; + return typeof format === 'function' ? format(output) : format.replace(/%s/i, output); + } + + function locale_set__set (config) { + var prop, i; + for (i in config) { + prop = config[i]; + if (typeof prop === 'function') { + this[i] = prop; + } else { + this['_' + i] = prop; + } + } + // Lenient ordinal parsing accepts just a number in addition to + // number + (possibly) stuff coming from _ordinalParseLenient. + this._ordinalParseLenient = new RegExp(this._ordinalParse.source + '|' + (/\d{1,2}/).source); + } + + var prototype__proto = Locale.prototype; + + prototype__proto._calendar = defaultCalendar; + prototype__proto.calendar = locale_calendar__calendar; + prototype__proto._longDateFormat = defaultLongDateFormat; + prototype__proto.longDateFormat = longDateFormat; + prototype__proto._invalidDate = defaultInvalidDate; + prototype__proto.invalidDate = invalidDate; + prototype__proto._ordinal = defaultOrdinal; + prototype__proto.ordinal = ordinal; + prototype__proto._ordinalParse = defaultOrdinalParse; + prototype__proto.preparse = preParsePostFormat; + prototype__proto.postformat = preParsePostFormat; + prototype__proto._relativeTime = defaultRelativeTime; + prototype__proto.relativeTime = relative__relativeTime; + prototype__proto.pastFuture = pastFuture; + prototype__proto.set = locale_set__set; + + // Month + prototype__proto.months = localeMonths; + prototype__proto._months = defaultLocaleMonths; + prototype__proto.monthsShort = localeMonthsShort; + prototype__proto._monthsShort = defaultLocaleMonthsShort; + prototype__proto.monthsParse = localeMonthsParse; + + // Week + prototype__proto.week = localeWeek; + prototype__proto._week = defaultLocaleWeek; + prototype__proto.firstDayOfYear = localeFirstDayOfYear; + prototype__proto.firstDayOfWeek = localeFirstDayOfWeek; + + // Day of Week + prototype__proto.weekdays = localeWeekdays; + prototype__proto._weekdays = defaultLocaleWeekdays; + prototype__proto.weekdaysMin = localeWeekdaysMin; + prototype__proto._weekdaysMin = defaultLocaleWeekdaysMin; + prototype__proto.weekdaysShort = localeWeekdaysShort; + prototype__proto._weekdaysShort = defaultLocaleWeekdaysShort; + prototype__proto.weekdaysParse = localeWeekdaysParse; + + // Hours + prototype__proto.isPM = localeIsPM; + prototype__proto._meridiemParse = defaultLocaleMeridiemParse; + prototype__proto.meridiem = localeMeridiem; + + function lists__get (format, index, field, setter) { + var locale = locale_locales__getLocale(); + var utc = create_utc__createUTC().set(setter, index); + return locale[field](utc, format); + } + + function list (format, index, field, count, setter) { + if (typeof format === 'number') { + index = format; + format = undefined; + } + + format = format || ''; + + if (index != null) { + return lists__get(format, index, field, setter); + } + + var i; + var out = []; + for (i = 0; i < count; i++) { + out[i] = lists__get(format, i, field, setter); + } + return out; + } + + function lists__listMonths (format, index) { + return list(format, index, 'months', 12, 'month'); + } + + function lists__listMonthsShort (format, index) { + return list(format, index, 'monthsShort', 12, 'month'); + } + + function lists__listWeekdays (format, index) { + return list(format, index, 'weekdays', 7, 'day'); + } + + function lists__listWeekdaysShort (format, index) { + return list(format, index, 'weekdaysShort', 7, 'day'); + } + + function lists__listWeekdaysMin (format, index) { + return list(format, index, 'weekdaysMin', 7, 'day'); + } + + locale_locales__getSetGlobalLocale('en', { + ordinalParse: /\d{1,2}(th|st|nd|rd)/, + ordinal : function (number) { + var b = number % 10, + output = (toInt(number % 100 / 10) === 1) ? 'th' : + (b === 1) ? 'st' : + (b === 2) ? 'nd' : + (b === 3) ? 'rd' : 'th'; + return number + output; + } + }); + + // Side effect imports + utils_hooks__hooks.lang = deprecate('moment.lang is deprecated. Use moment.locale instead.', locale_locales__getSetGlobalLocale); + utils_hooks__hooks.langData = deprecate('moment.langData is deprecated. Use moment.localeData instead.', locale_locales__getLocale); + + var mathAbs = Math.abs; + + function duration_abs__abs () { + var data = this._data; + + this._milliseconds = mathAbs(this._milliseconds); + this._days = mathAbs(this._days); + this._months = mathAbs(this._months); + + data.milliseconds = mathAbs(data.milliseconds); + data.seconds = mathAbs(data.seconds); + data.minutes = mathAbs(data.minutes); + data.hours = mathAbs(data.hours); + data.months = mathAbs(data.months); + data.years = mathAbs(data.years); + + return this; + } + + function duration_add_subtract__addSubtract (duration, input, value, direction) { + var other = create__createDuration(input, value); + + duration._milliseconds += direction * other._milliseconds; + duration._days += direction * other._days; + duration._months += direction * other._months; + + return duration._bubble(); + } + + // supports only 2.0-style add(1, 's') or add(duration) + function duration_add_subtract__add (input, value) { + return duration_add_subtract__addSubtract(this, input, value, 1); + } + + // supports only 2.0-style subtract(1, 's') or subtract(duration) + function duration_add_subtract__subtract (input, value) { + return duration_add_subtract__addSubtract(this, input, value, -1); + } + + function absCeil (number) { + if (number < 0) { + return Math.floor(number); + } else { + return Math.ceil(number); + } + } + + function bubble () { + var milliseconds = this._milliseconds; + var days = this._days; + var months = this._months; + var data = this._data; + var seconds, minutes, hours, years, monthsFromDays; + + // if we have a mix of positive and negative values, bubble down first + // check: https://github.com/moment/moment/issues/2166 + if (!((milliseconds >= 0 && days >= 0 && months >= 0) || + (milliseconds <= 0 && days <= 0 && months <= 0))) { + milliseconds += absCeil(monthsToDays(months) + days) * 864e5; + days = 0; + months = 0; + } + + // The following code bubbles up values, see the tests for + // examples of what that means. + data.milliseconds = milliseconds % 1000; + + seconds = absFloor(milliseconds / 1000); + data.seconds = seconds % 60; + + minutes = absFloor(seconds / 60); + data.minutes = minutes % 60; + + hours = absFloor(minutes / 60); + data.hours = hours % 24; + + days += absFloor(hours / 24); + + // convert days to months + monthsFromDays = absFloor(daysToMonths(days)); + months += monthsFromDays; + days -= absCeil(monthsToDays(monthsFromDays)); + + // 12 months -> 1 year + years = absFloor(months / 12); + months %= 12; + + data.days = days; + data.months = months; + data.years = years; + + return this; + } + + function daysToMonths (days) { + // 400 years have 146097 days (taking into account leap year rules) + // 400 years have 12 months === 4800 + return days * 4800 / 146097; + } + + function monthsToDays (months) { + // the reverse of daysToMonths + return months * 146097 / 4800; + } + + function as (units) { + var days; + var months; + var milliseconds = this._milliseconds; + + units = normalizeUnits(units); + + if (units === 'month' || units === 'year') { + days = this._days + milliseconds / 864e5; + months = this._months + daysToMonths(days); + return units === 'month' ? months : months / 12; + } else { + // handle milliseconds separately because of floating point math errors (issue #1867) + days = this._days + Math.round(monthsToDays(this._months)); + switch (units) { + case 'week' : return days / 7 + milliseconds / 6048e5; + case 'day' : return days + milliseconds / 864e5; + case 'hour' : return days * 24 + milliseconds / 36e5; + case 'minute' : return days * 1440 + milliseconds / 6e4; + case 'second' : return days * 86400 + milliseconds / 1000; + // Math.floor prevents floating point math errors here + case 'millisecond': return Math.floor(days * 864e5) + milliseconds; + default: throw new Error('Unknown unit ' + units); + } + } + } + + // TODO: Use this.as('ms')? + function duration_as__valueOf () { + return ( + this._milliseconds + + this._days * 864e5 + + (this._months % 12) * 2592e6 + + toInt(this._months / 12) * 31536e6 + ); + } + + function makeAs (alias) { + return function () { + return this.as(alias); + }; + } + + var asMilliseconds = makeAs('ms'); + var asSeconds = makeAs('s'); + var asMinutes = makeAs('m'); + var asHours = makeAs('h'); + var asDays = makeAs('d'); + var asWeeks = makeAs('w'); + var asMonths = makeAs('M'); + var asYears = makeAs('y'); + + function duration_get__get (units) { + units = normalizeUnits(units); + return this[units + 's'](); + } + + function makeGetter(name) { + return function () { + return this._data[name]; + }; + } + + var milliseconds = makeGetter('milliseconds'); + var seconds = makeGetter('seconds'); + var minutes = makeGetter('minutes'); + var hours = makeGetter('hours'); + var days = makeGetter('days'); + var months = makeGetter('months'); + var years = makeGetter('years'); + + function weeks () { + return absFloor(this.days() / 7); + } + + var round = Math.round; + var thresholds = { + s: 45, // seconds to minute + m: 45, // minutes to hour + h: 22, // hours to day + d: 26, // days to month + M: 11 // months to year + }; + + // helper function for moment.fn.from, moment.fn.fromNow, and moment.duration.fn.humanize + function substituteTimeAgo(string, number, withoutSuffix, isFuture, locale) { + return locale.relativeTime(number || 1, !!withoutSuffix, string, isFuture); + } + + function duration_humanize__relativeTime (posNegDuration, withoutSuffix, locale) { + var duration = create__createDuration(posNegDuration).abs(); + var seconds = round(duration.as('s')); + var minutes = round(duration.as('m')); + var hours = round(duration.as('h')); + var days = round(duration.as('d')); + var months = round(duration.as('M')); + var years = round(duration.as('y')); + + var a = seconds < thresholds.s && ['s', seconds] || + minutes === 1 && ['m'] || + minutes < thresholds.m && ['mm', minutes] || + hours === 1 && ['h'] || + hours < thresholds.h && ['hh', hours] || + days === 1 && ['d'] || + days < thresholds.d && ['dd', days] || + months === 1 && ['M'] || + months < thresholds.M && ['MM', months] || + years === 1 && ['y'] || ['yy', years]; + + a[2] = withoutSuffix; + a[3] = +posNegDuration > 0; + a[4] = locale; + return substituteTimeAgo.apply(null, a); + } + + // This function allows you to set a threshold for relative time strings + function duration_humanize__getSetRelativeTimeThreshold (threshold, limit) { + if (thresholds[threshold] === undefined) { + return false; + } + if (limit === undefined) { + return thresholds[threshold]; + } + thresholds[threshold] = limit; + return true; + } + + function humanize (withSuffix) { + var locale = this.localeData(); + var output = duration_humanize__relativeTime(this, !withSuffix, locale); + + if (withSuffix) { + output = locale.pastFuture(+this, output); + } + + return locale.postformat(output); + } + + var iso_string__abs = Math.abs; + + function iso_string__toISOString() { + // for ISO strings we do not use the normal bubbling rules: + // * milliseconds bubble up until they become hours + // * days do not bubble at all + // * months bubble up until they become years + // This is because there is no context-free conversion between hours and days + // (think of clock changes) + // and also not between days and months (28-31 days per month) + var seconds = iso_string__abs(this._milliseconds) / 1000; + var days = iso_string__abs(this._days); + var months = iso_string__abs(this._months); + var minutes, hours, years; + + // 3600 seconds -> 60 minutes -> 1 hour + minutes = absFloor(seconds / 60); + hours = absFloor(minutes / 60); + seconds %= 60; + minutes %= 60; + + // 12 months -> 1 year + years = absFloor(months / 12); + months %= 12; + + + // inspired by https://github.com/dordille/moment-isoduration/blob/master/moment.isoduration.js + var Y = years; + var M = months; + var D = days; + var h = hours; + var m = minutes; + var s = seconds; + var total = this.asSeconds(); + + if (!total) { + // this is the same as C#'s (Noda) and python (isodate)... + // but not other JS (goog.date) + return 'P0D'; + } + + return (total < 0 ? '-' : '') + + 'P' + + (Y ? Y + 'Y' : '') + + (M ? M + 'M' : '') + + (D ? D + 'D' : '') + + ((h || m || s) ? 'T' : '') + + (h ? h + 'H' : '') + + (m ? m + 'M' : '') + + (s ? s + 'S' : ''); + } + + var duration_prototype__proto = Duration.prototype; + + duration_prototype__proto.abs = duration_abs__abs; + duration_prototype__proto.add = duration_add_subtract__add; + duration_prototype__proto.subtract = duration_add_subtract__subtract; + duration_prototype__proto.as = as; + duration_prototype__proto.asMilliseconds = asMilliseconds; + duration_prototype__proto.asSeconds = asSeconds; + duration_prototype__proto.asMinutes = asMinutes; + duration_prototype__proto.asHours = asHours; + duration_prototype__proto.asDays = asDays; + duration_prototype__proto.asWeeks = asWeeks; + duration_prototype__proto.asMonths = asMonths; + duration_prototype__proto.asYears = asYears; + duration_prototype__proto.valueOf = duration_as__valueOf; + duration_prototype__proto._bubble = bubble; + duration_prototype__proto.get = duration_get__get; + duration_prototype__proto.milliseconds = milliseconds; + duration_prototype__proto.seconds = seconds; + duration_prototype__proto.minutes = minutes; + duration_prototype__proto.hours = hours; + duration_prototype__proto.days = days; + duration_prototype__proto.weeks = weeks; + duration_prototype__proto.months = months; + duration_prototype__proto.years = years; + duration_prototype__proto.humanize = humanize; + duration_prototype__proto.toISOString = iso_string__toISOString; + duration_prototype__proto.toString = iso_string__toISOString; + duration_prototype__proto.toJSON = iso_string__toISOString; + duration_prototype__proto.locale = locale; + duration_prototype__proto.localeData = localeData; + + // Deprecations + duration_prototype__proto.toIsoString = deprecate('toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)', iso_string__toISOString); + duration_prototype__proto.lang = lang; + + // Side effect imports + + addFormatToken('X', 0, 0, 'unix'); + addFormatToken('x', 0, 0, 'valueOf'); + + // PARSING + + addRegexToken('x', matchSigned); + addRegexToken('X', matchTimestamp); + addParseToken('X', function (input, array, config) { + config._d = new Date(parseFloat(input, 10) * 1000); + }); + addParseToken('x', function (input, array, config) { + config._d = new Date(toInt(input)); + }); + + // Side effect imports + + + utils_hooks__hooks.version = '2.10.6'; + + setHookCallback(local__createLocal); + + utils_hooks__hooks.fn = momentPrototype; + utils_hooks__hooks.min = min; + utils_hooks__hooks.max = max; + utils_hooks__hooks.utc = create_utc__createUTC; + utils_hooks__hooks.unix = moment__createUnix; + utils_hooks__hooks.months = lists__listMonths; + utils_hooks__hooks.isDate = isDate; + utils_hooks__hooks.locale = locale_locales__getSetGlobalLocale; + utils_hooks__hooks.invalid = valid__createInvalid; + utils_hooks__hooks.duration = create__createDuration; + utils_hooks__hooks.isMoment = isMoment; + utils_hooks__hooks.weekdays = lists__listWeekdays; + utils_hooks__hooks.parseZone = moment__createInZone; + utils_hooks__hooks.localeData = locale_locales__getLocale; + utils_hooks__hooks.isDuration = isDuration; + utils_hooks__hooks.monthsShort = lists__listMonthsShort; + utils_hooks__hooks.weekdaysMin = lists__listWeekdaysMin; + utils_hooks__hooks.defineLocale = defineLocale; + utils_hooks__hooks.weekdaysShort = lists__listWeekdaysShort; + utils_hooks__hooks.normalizeUnits = normalizeUnits; + utils_hooks__hooks.relativeTimeThreshold = duration_humanize__getSetRelativeTimeThreshold; + + var _moment = utils_hooks__hooks; + + return _moment; + +})); +},{}],"numeral":[function(require,module,exports){ +"use strict"; +(function() { + var numeral, + VERSION = '1.5.3', + languages = {}, + currentLanguage = 'en', + zeroFormat = null, + defaultFormat = '0,0', + hasModule = (typeof module !== 'undefined' && module.exports); + function Numeral(number) { + this._value = number; + } + function toFixed(value, precision, roundingFunction, optionals) { + var power = Math.pow(10, precision), + optionalsRegExp, + output; + output = (roundingFunction(value * power) / power).toFixed(precision); + if (optionals) { + optionalsRegExp = new RegExp('0{1,' + optionals + '}$'); + output = output.replace(optionalsRegExp, ''); + } + return output; + } + function formatNumeral(n, format, roundingFunction) { + var output; + if (format.indexOf('$') > -1) { + output = formatCurrency(n, format, roundingFunction); + } else if (format.indexOf('%') > -1) { + output = formatPercentage(n, format, roundingFunction); + } else if (format.indexOf(':') > -1) { + output = formatTime(n, format); + } else { + output = formatNumber(n._value, format, roundingFunction); + } + return output; + } + function unformatNumeral(n, string) { + var stringOriginal = string, + thousandRegExp, + millionRegExp, + billionRegExp, + trillionRegExp, + suffixes = ['KB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB'], + bytesMultiplier = false, + power; + if (string.indexOf(':') > -1) { + n._value = unformatTime(string); + } else { + if (string === zeroFormat) { + n._value = 0; + } else { + if (languages[currentLanguage].delimiters.decimal !== '.') { + string = string.replace(/\./g, '').replace(languages[currentLanguage].delimiters.decimal, '.'); + } + thousandRegExp = new RegExp('[^a-zA-Z]' + languages[currentLanguage].abbreviations.thousand + '(?:\\)|(\\' + languages[currentLanguage].currency.symbol + ')?(?:\\))?)?$'); + millionRegExp = new RegExp('[^a-zA-Z]' + languages[currentLanguage].abbreviations.million + '(?:\\)|(\\' + languages[currentLanguage].currency.symbol + ')?(?:\\))?)?$'); + billionRegExp = new RegExp('[^a-zA-Z]' + languages[currentLanguage].abbreviations.billion + '(?:\\)|(\\' + languages[currentLanguage].currency.symbol + ')?(?:\\))?)?$'); + trillionRegExp = new RegExp('[^a-zA-Z]' + languages[currentLanguage].abbreviations.trillion + '(?:\\)|(\\' + languages[currentLanguage].currency.symbol + ')?(?:\\))?)?$'); + for (power = 0; power <= suffixes.length; power++) { + bytesMultiplier = (string.indexOf(suffixes[power]) > -1) ? Math.pow(1024, power + 1) : false; + if (bytesMultiplier) { + break; + } + } + n._value = ((bytesMultiplier) ? bytesMultiplier : 1) * ((stringOriginal.match(thousandRegExp)) ? Math.pow(10, 3) : 1) * ((stringOriginal.match(millionRegExp)) ? Math.pow(10, 6) : 1) * ((stringOriginal.match(billionRegExp)) ? Math.pow(10, 9) : 1) * ((stringOriginal.match(trillionRegExp)) ? Math.pow(10, 12) : 1) * ((string.indexOf('%') > -1) ? 0.01 : 1) * (((string.split('-').length + Math.min(string.split('(').length - 1, string.split(')').length - 1)) % 2) ? 1 : -1) * Number(string.replace(/[^0-9\.]+/g, '')); + n._value = (bytesMultiplier) ? Math.ceil(n._value) : n._value; + } + } + return n._value; + } + function formatCurrency(n, format, roundingFunction) { + var symbolIndex = format.indexOf('$'), + openParenIndex = format.indexOf('('), + minusSignIndex = format.indexOf('-'), + space = '', + spliceIndex, + output; + if (format.indexOf(' $') > -1) { + space = ' '; + format = format.replace(' $', ''); + } else if (format.indexOf('$ ') > -1) { + space = ' '; + format = format.replace('$ ', ''); + } else { + format = format.replace('$', ''); + } + output = formatNumber(n._value, format, roundingFunction); + if (symbolIndex <= 1) { + if (output.indexOf('(') > -1 || output.indexOf('-') > -1) { + output = output.split(''); + spliceIndex = 1; + if (symbolIndex < openParenIndex || symbolIndex < minusSignIndex) { + spliceIndex = 0; + } + output.splice(spliceIndex, 0, languages[currentLanguage].currency.symbol + space); + output = output.join(''); + } else { + output = languages[currentLanguage].currency.symbol + space + output; + } + } else { + if (output.indexOf(')') > -1) { + output = output.split(''); + output.splice(-1, 0, space + languages[currentLanguage].currency.symbol); + output = output.join(''); + } else { + output = output + space + languages[currentLanguage].currency.symbol; + } + } + return output; + } + function formatPercentage(n, format, roundingFunction) { + var space = '', + output, + value = n._value * 100; + if (format.indexOf(' %') > -1) { + space = ' '; + format = format.replace(' %', ''); + } else { + format = format.replace('%', ''); + } + output = formatNumber(value, format, roundingFunction); + if (output.indexOf(')') > -1) { + output = output.split(''); + output.splice(-1, 0, space + '%'); + output = output.join(''); + } else { + output = output + space + '%'; + } + return output; + } + function formatTime(n) { + var hours = Math.floor(n._value / 60 / 60), + minutes = Math.floor((n._value - (hours * 60 * 60)) / 60), + seconds = Math.round(n._value - (hours * 60 * 60) - (minutes * 60)); + return hours + ':' + ((minutes < 10) ? '0' + minutes : minutes) + ':' + ((seconds < 10) ? '0' + seconds : seconds); + } + function unformatTime(string) { + var timeArray = string.split(':'), + seconds = 0; + if (timeArray.length === 3) { + seconds = seconds + (Number(timeArray[0]) * 60 * 60); + seconds = seconds + (Number(timeArray[1]) * 60); + seconds = seconds + Number(timeArray[2]); + } else if (timeArray.length === 2) { + seconds = seconds + (Number(timeArray[0]) * 60); + seconds = seconds + Number(timeArray[1]); + } + return Number(seconds); + } + function formatNumber(value, format, roundingFunction) { + var negP = false, + signed = false, + optDec = false, + abbr = '', + abbrK = false, + abbrM = false, + abbrB = false, + abbrT = false, + abbrForce = false, + bytes = '', + ord = '', + abs = Math.abs(value), + suffixes = ['B', 'KB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB'], + min, + max, + power, + w, + precision, + thousands, + d = '', + neg = false; + if (value === 0 && zeroFormat !== null) { + return zeroFormat; + } else { + if (format.indexOf('(') > -1) { + negP = true; + format = format.slice(1, -1); + } else if (format.indexOf('+') > -1) { + signed = true; + format = format.replace(/\+/g, ''); + } + if (format.indexOf('a') > -1) { + abbrK = format.indexOf('aK') >= 0; + abbrM = format.indexOf('aM') >= 0; + abbrB = format.indexOf('aB') >= 0; + abbrT = format.indexOf('aT') >= 0; + abbrForce = abbrK || abbrM || abbrB || abbrT; + if (format.indexOf(' a') > -1) { + abbr = ' '; + format = format.replace(' a', ''); + } else { + format = format.replace('a', ''); + } + if (abs >= Math.pow(10, 12) && !abbrForce || abbrT) { + abbr = abbr + languages[currentLanguage].abbreviations.trillion; + value = value / Math.pow(10, 12); + } else if (abs < Math.pow(10, 12) && abs >= Math.pow(10, 9) && !abbrForce || abbrB) { + abbr = abbr + languages[currentLanguage].abbreviations.billion; + value = value / Math.pow(10, 9); + } else if (abs < Math.pow(10, 9) && abs >= Math.pow(10, 6) && !abbrForce || abbrM) { + abbr = abbr + languages[currentLanguage].abbreviations.million; + value = value / Math.pow(10, 6); + } else if (abs < Math.pow(10, 6) && abs >= Math.pow(10, 3) && !abbrForce || abbrK) { + abbr = abbr + languages[currentLanguage].abbreviations.thousand; + value = value / Math.pow(10, 3); + } + } + if (format.indexOf('b') > -1) { + if (format.indexOf(' b') > -1) { + bytes = ' '; + format = format.replace(' b', ''); + } else { + format = format.replace('b', ''); + } + for (power = 0; power <= suffixes.length; power++) { + min = Math.pow(1024, power); + max = Math.pow(1024, power + 1); + if (value >= min && value < max) { + bytes = bytes + suffixes[power]; + if (min > 0) { + value = value / min; + } + break; + } + } + } + if (format.indexOf('o') > -1) { + if (format.indexOf(' o') > -1) { + ord = ' '; + format = format.replace(' o', ''); + } else { + format = format.replace('o', ''); + } + ord = ord + languages[currentLanguage].ordinal(value); + } + if (format.indexOf('[.]') > -1) { + optDec = true; + format = format.replace('[.]', '.'); + } + w = value.toString().split('.')[0]; + precision = format.split('.')[1]; + thousands = format.indexOf(','); + if (precision) { + if (precision.indexOf('[') > -1) { + precision = precision.replace(']', ''); + precision = precision.split('['); + d = toFixed(value, (precision[0].length + precision[1].length), roundingFunction, precision[1].length); + } else { + d = toFixed(value, precision.length, roundingFunction); + } + w = d.split('.')[0]; + if (d.split('.')[1].length) { + d = languages[currentLanguage].delimiters.decimal + d.split('.')[1]; + } else { + d = ''; + } + if (optDec && Number(d.slice(1)) === 0) { + d = ''; + } + } else { + w = toFixed(value, null, roundingFunction); + } + if (w.indexOf('-') > -1) { + w = w.slice(1); + neg = true; + } + if (thousands > -1) { + w = w.toString().replace(/(\d)(?=(\d{3})+(?!\d))/g, '$1' + languages[currentLanguage].delimiters.thousands); + } + if (format.indexOf('.') === 0) { + w = ''; + } + return ((negP && neg) ? '(' : '') + ((!negP && neg) ? '-' : '') + ((!neg && signed) ? '+' : '') + w + d + ((ord) ? ord : '') + ((abbr) ? abbr : '') + ((bytes) ? bytes : '') + ((negP && neg) ? ')' : ''); + } + } + numeral = function(input) { + if (numeral.isNumeral(input)) { + input = input.value(); + } else if (input === 0 || typeof input === 'undefined') { + input = 0; + } else if (!Number(input)) { + input = numeral.fn.unformat(input); + } + return new Numeral(Number(input)); + }; + numeral.version = VERSION; + numeral.isNumeral = function(obj) { + return obj instanceof Numeral; + }; + numeral.language = function(key, values) { + if (!key) { + return currentLanguage; + } + if (key && !values) { + if (!languages[key]) { + throw new Error('Unknown language : ' + key); + } + currentLanguage = key; + } + if (values || !languages[key]) { + loadLanguage(key, values); + } + return numeral; + }; + numeral.languageData = function(key) { + if (!key) { + return languages[currentLanguage]; + } + if (!languages[key]) { + throw new Error('Unknown language : ' + key); + } + return languages[key]; + }; + numeral.language('en', { + delimiters: { + thousands: ',', + decimal: '.' + }, + abbreviations: { + thousand: 'k', + million: 'm', + billion: 'b', + trillion: 't' + }, + ordinal: function(number) { + var b = number % 10; + return (~~(number % 100 / 10) === 1) ? 'th' : (b === 1) ? 'st' : (b === 2) ? 'nd' : (b === 3) ? 'rd' : 'th'; + }, + currency: {symbol: '$'} + }); + numeral.zeroFormat = function(format) { + zeroFormat = typeof(format) === 'string' ? format : null; + }; + numeral.defaultFormat = function(format) { + defaultFormat = typeof(format) === 'string' ? format : '0.0'; + }; + numeral.validate = function(val, culture) { + var _decimalSep, + _thousandSep, + _currSymbol, + _valArray, + _abbrObj, + _thousandRegEx, + languageData, + temp; + if (typeof val !== 'string') { + val += ''; + if (console.warn) { + console.warn('Numeral.js: Value is not string. It has been co-erced to: ', val); + } + } + val = val.trim(); + if (val === '') { + return false; + } + val = val.replace(/^[+-]?/, ''); + try { + languageData = numeral.languageData(culture); + } catch (e) { + languageData = numeral.languageData(numeral.language()); + } + _currSymbol = languageData.currency.symbol; + _abbrObj = languageData.abbreviations; + _decimalSep = languageData.delimiters.decimal; + if (languageData.delimiters.thousands === '.') { + _thousandSep = '\\.'; + } else { + _thousandSep = languageData.delimiters.thousands; + } + temp = val.match(/^[^\d\.\,]+/); + if (temp !== null) { + val = val.substr(1); + if (temp[0] !== _currSymbol) { + return false; + } + } + temp = val.match(/[^\d]+$/); + if (temp !== null) { + val = val.slice(0, -1); + if (temp[0] !== _abbrObj.thousand && temp[0] !== _abbrObj.million && temp[0] !== _abbrObj.billion && temp[0] !== _abbrObj.trillion) { + return false; + } + } + if (!!val.match(/^\d+$/)) { + return true; + } + _thousandRegEx = new RegExp(_thousandSep + '{2}'); + if (!val.match(/[^\d.,]/g)) { + _valArray = val.split(_decimalSep); + if (_valArray.length > 2) { + return false; + } else { + if (_valArray.length < 2) { + return (!!_valArray[0].match(/^\d+.*\d$/) && !_valArray[0].match(_thousandRegEx)); + } else { + if (_valArray[0] === '') { + return (!_valArray[0].match(_thousandRegEx) && !!_valArray[1].match(/^\d+$/)); + } else if (_valArray[0].length === 1) { + return (!!_valArray[0].match(/^\d+$/) && !_valArray[0].match(_thousandRegEx) && !!_valArray[1].match(/^\d+$/)); + } else { + return (!!_valArray[0].match(/^\d+.*\d$/) && !_valArray[0].match(_thousandRegEx) && !!_valArray[1].match(/^\d+$/)); + } + } + } + } + return false; + }; + function loadLanguage(key, values) { + languages[key] = values; + } + if ('function' !== typeof Array.prototype.reduce) { + Array.prototype.reduce = function(callback, opt_initialValue) { + 'use strict'; + if (null === this || 'undefined' === typeof this) { + throw new TypeError('Array.prototype.reduce called on null or undefined'); + } + if ('function' !== typeof callback) { + throw new TypeError(callback + ' is not a function'); + } + var index, + value, + length = this.length >>> 0, + isValueSet = false; + if (1 < arguments.length) { + value = opt_initialValue; + isValueSet = true; + } + for (index = 0; length > index; ++index) { + if (this.hasOwnProperty(index)) { + if (isValueSet) { + value = callback(value, this[index], index, this); + } else { + value = this[index]; + isValueSet = true; + } + } + } + if (!isValueSet) { + throw new TypeError('Reduce of empty array with no initial value'); + } + return value; + }; + } + function multiplier(x) { + var parts = x.toString().split('.'); + if (parts.length < 2) { + return 1; + } + return Math.pow(10, parts[1].length); + } + function correctionFactor() { + var args = Array.prototype.slice.call(arguments); + return args.reduce(function(prev, next) { + var mp = multiplier(prev), + mn = multiplier(next); + return mp > mn ? mp : mn; + }, -Infinity); + } + numeral.fn = Numeral.prototype = { + clone: function() { + return numeral(this); + }, + format: function(inputString, roundingFunction) { + return formatNumeral(this, inputString ? inputString : defaultFormat, (roundingFunction !== undefined) ? roundingFunction : Math.round); + }, + unformat: function(inputString) { + if (Object.prototype.toString.call(inputString) === '[object Number]') { + return inputString; + } + return unformatNumeral(this, inputString ? inputString : defaultFormat); + }, + value: function() { + return this._value; + }, + valueOf: function() { + return this._value; + }, + set: function(value) { + this._value = Number(value); + return this; + }, + add: function(value) { + var corrFactor = correctionFactor.call(null, this._value, value); + function cback(accum, curr, currI, O) { + return accum + corrFactor * curr; + } + this._value = [this._value, value].reduce(cback, 0) / corrFactor; + return this; + }, + subtract: function(value) { + var corrFactor = correctionFactor.call(null, this._value, value); + function cback(accum, curr, currI, O) { + return accum - corrFactor * curr; + } + this._value = [value].reduce(cback, this._value * corrFactor) / corrFactor; + return this; + }, + multiply: function(value) { + function cback(accum, curr, currI, O) { + var corrFactor = correctionFactor(accum, curr); + return (accum * corrFactor) * (curr * corrFactor) / (corrFactor * corrFactor); + } + this._value = [this._value, value].reduce(cback, 1); + return this; + }, + divide: function(value) { + function cback(accum, curr, currI, O) { + var corrFactor = correctionFactor(accum, curr); + return (accum * corrFactor) / (curr * corrFactor); + } + this._value = [this._value, value].reduce(cback); + return this; + }, + difference: function(value) { + return Math.abs(numeral(this._value).subtract(value).value()); + } + }; + if (hasModule) { + module.exports = numeral; + } + if (typeof ender === 'undefined') { + this['numeral'] = numeral; + } + if (typeof define === 'function' && define.amd) { + define([], function() { + return numeral; + }); + } +}).call(window); + +//# +},{}],"pikaday":[function(require,module,exports){ +/*! + * Pikaday + * + * Copyright © 2014 David Bushell | BSD & MIT license | https://github.com/dbushell/Pikaday + */ + +(function (root, factory) +{ + 'use strict'; + + var moment; + if (typeof exports === 'object') { + // CommonJS module + // Load moment.js as an optional dependency + try { moment = require('moment'); } catch (e) {} + module.exports = factory(moment); + } else if (typeof define === 'function' && define.amd) { + // AMD. Register as an anonymous module. + define(function (req) + { + // Load moment.js as an optional dependency + var id = 'moment'; + try { moment = req(id); } catch (e) {} + return factory(moment); + }); + } else { + root.Pikaday = factory(root.moment); + } +}(this, function (moment) +{ + 'use strict'; + + /** + * feature detection and helper functions + */ + var hasMoment = typeof moment === 'function', + + hasEventListeners = !!window.addEventListener, + + document = window.document, + + sto = window.setTimeout, + + addEvent = function(el, e, callback, capture) + { + if (hasEventListeners) { + el.addEventListener(e, callback, !!capture); + } else { + el.attachEvent('on' + e, callback); + } + }, + + removeEvent = function(el, e, callback, capture) + { + if (hasEventListeners) { + el.removeEventListener(e, callback, !!capture); + } else { + el.detachEvent('on' + e, callback); + } + }, + + fireEvent = function(el, eventName, data) + { + var ev; + + if (document.createEvent) { + ev = document.createEvent('HTMLEvents'); + ev.initEvent(eventName, true, false); + ev = extend(ev, data); + el.dispatchEvent(ev); + } else if (document.createEventObject) { + ev = document.createEventObject(); + ev = extend(ev, data); + el.fireEvent('on' + eventName, ev); + } + }, + + trim = function(str) + { + return str.trim ? str.trim() : str.replace(/^\s+|\s+$/g,''); + }, + + hasClass = function(el, cn) + { + return (' ' + el.className + ' ').indexOf(' ' + cn + ' ') !== -1; + }, + + addClass = function(el, cn) + { + if (!hasClass(el, cn)) { + el.className = (el.className === '') ? cn : el.className + ' ' + cn; + } + }, + + removeClass = function(el, cn) + { + el.className = trim((' ' + el.className + ' ').replace(' ' + cn + ' ', ' ')); + }, + + isArray = function(obj) + { + return (/Array/).test(Object.prototype.toString.call(obj)); + }, + + isDate = function(obj) + { + return (/Date/).test(Object.prototype.toString.call(obj)) && !isNaN(obj.getTime()); + }, + + isWeekend = function(date) + { + var day = date.getDay(); + return day === 0 || day === 6; + }, + + isLeapYear = function(year) + { + // solution by Matti Virkkunen: http://stackoverflow.com/a/4881951 + return year % 4 === 0 && year % 100 !== 0 || year % 400 === 0; + }, + + getDaysInMonth = function(year, month) + { + return [31, isLeapYear(year) ? 29 : 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31][month]; + }, + + setToStartOfDay = function(date) + { + if (isDate(date)) date.setHours(0,0,0,0); + }, + + compareDates = function(a,b) + { + // weak date comparison (use setToStartOfDay(date) to ensure correct result) + return a.getTime() === b.getTime(); + }, + + extend = function(to, from, overwrite) + { + var prop, hasProp; + for (prop in from) { + hasProp = to[prop] !== undefined; + if (hasProp && typeof from[prop] === 'object' && from[prop] !== null && from[prop].nodeName === undefined) { + if (isDate(from[prop])) { + if (overwrite) { + to[prop] = new Date(from[prop].getTime()); + } + } + else if (isArray(from[prop])) { + if (overwrite) { + to[prop] = from[prop].slice(0); + } + } else { + to[prop] = extend({}, from[prop], overwrite); + } + } else if (overwrite || !hasProp) { + to[prop] = from[prop]; + } + } + return to; + }, + + adjustCalendar = function(calendar) { + if (calendar.month < 0) { + calendar.year -= Math.ceil(Math.abs(calendar.month)/12); + calendar.month += 12; + } + if (calendar.month > 11) { + calendar.year += Math.floor(Math.abs(calendar.month)/12); + calendar.month -= 12; + } + return calendar; + }, + + /** + * defaults and localisation + */ + defaults = { + + // bind the picker to a form field + field: null, + + // automatically show/hide the picker on `field` focus (default `true` if `field` is set) + bound: undefined, + + // position of the datepicker, relative to the field (default to bottom & left) + // ('bottom' & 'left' keywords are not used, 'top' & 'right' are modifier on the bottom/left position) + position: 'bottom left', + + // automatically fit in the viewport even if it means repositioning from the position option + reposition: true, + + // the default output format for `.toString()` and `field` value + format: 'YYYY-MM-DD', + + // the initial date to view when first opened + defaultDate: null, + + // make the `defaultDate` the initial selected value + setDefaultDate: false, + + // first day of week (0: Sunday, 1: Monday etc) + firstDay: 0, + + // the minimum/earliest date that can be selected + minDate: null, + // the maximum/latest date that can be selected + maxDate: null, + + // number of years either side, or array of upper/lower range + yearRange: 10, + + // show week numbers at head of row + showWeekNumber: false, + + // used internally (don't config outside) + minYear: 0, + maxYear: 9999, + minMonth: undefined, + maxMonth: undefined, + + startRange: null, + endRange: null, + + isRTL: false, + + // Additional text to append to the year in the calendar title + yearSuffix: '', + + // Render the month after year in the calendar title + showMonthAfterYear: false, + + // how many months are visible + numberOfMonths: 1, + + // when numberOfMonths is used, this will help you to choose where the main calendar will be (default `left`, can be set to `right`) + // only used for the first display or when a selected date is not visible + mainCalendar: 'left', + + // Specify a DOM element to render the calendar in + container: undefined, + + // internationalization + i18n: { + previousMonth : 'Previous Month', + nextMonth : 'Next Month', + months : ['January','February','March','April','May','June','July','August','September','October','November','December'], + weekdays : ['Sunday','Monday','Tuesday','Wednesday','Thursday','Friday','Saturday'], + weekdaysShort : ['Sun','Mon','Tue','Wed','Thu','Fri','Sat'] + }, + + // Theme Classname + theme: null, + + // callback function + onSelect: null, + onOpen: null, + onClose: null, + onDraw: null + }, + + + /** + * templating functions to abstract HTML rendering + */ + renderDayName = function(opts, day, abbr) + { + day += opts.firstDay; + while (day >= 7) { + day -= 7; + } + return abbr ? opts.i18n.weekdaysShort[day] : opts.i18n.weekdays[day]; + }, + + renderDay = function(opts) + { + if (opts.isEmpty) { + return ''; + } + var arr = []; + if (opts.isDisabled) { + arr.push('is-disabled'); + } + if (opts.isToday) { + arr.push('is-today'); + } + if (opts.isSelected) { + arr.push('is-selected'); + } + if (opts.isInRange) { + arr.push('is-inrange'); + } + if (opts.isStartRange) { + arr.push('is-startrange'); + } + if (opts.isEndRange) { + arr.push('is-endrange'); + } + return '' + + '' + + ''; + }, + + renderWeek = function (d, m, y) { + // Lifted from http://javascript.about.com/library/blweekyear.htm, lightly modified. + var onejan = new Date(y, 0, 1), + weekNum = Math.ceil((((new Date(y, m, d) - onejan) / 86400000) + onejan.getDay()+1)/7); + return '' + weekNum + ''; + }, + + renderRow = function(days, isRTL) + { + return '' + (isRTL ? days.reverse() : days).join('') + ''; + }, + + renderBody = function(rows) + { + return '' + rows.join('') + ''; + }, + + renderHead = function(opts) + { + var i, arr = []; + if (opts.showWeekNumber) { + arr.push(''); + } + for (i = 0; i < 7; i++) { + arr.push('' + renderDayName(opts, i, true) + ''); + } + return '' + (opts.isRTL ? arr.reverse() : arr).join('') + ''; + }, + + renderTitle = function(instance, c, year, month, refYear) + { + var i, j, arr, + opts = instance._o, + isMinYear = year === opts.minYear, + isMaxYear = year === opts.maxYear, + html = '
', + monthHtml, + yearHtml, + prev = true, + next = true; + + for (arr = [], i = 0; i < 12; i++) { + arr.push(''); + } + monthHtml = '
' + opts.i18n.months[month] + '
'; + + if (isArray(opts.yearRange)) { + i = opts.yearRange[0]; + j = opts.yearRange[1] + 1; + } else { + i = year - opts.yearRange; + j = 1 + year + opts.yearRange; + } + + for (arr = []; i < j && i <= opts.maxYear; i++) { + if (i >= opts.minYear) { + arr.push(''); + } + } + yearHtml = '
' + year + opts.yearSuffix + '
'; + + if (opts.showMonthAfterYear) { + html += yearHtml + monthHtml; + } else { + html += monthHtml + yearHtml; + } + + if (isMinYear && (month === 0 || opts.minMonth >= month)) { + prev = false; + } + + if (isMaxYear && (month === 11 || opts.maxMonth <= month)) { + next = false; + } + + if (c === 0) { + html += ''; + } + if (c === (instance._o.numberOfMonths - 1) ) { + html += ''; + } + + return html += '
'; + }, + + renderTable = function(opts, data) + { + return '' + renderHead(opts) + renderBody(data) + '
'; + }, + + + /** + * Pikaday constructor + */ + Pikaday = function(options) + { + var self = this, + opts = self.config(options); + + self._onMouseDown = function(e) + { + if (!self._v) { + return; + } + e = e || window.event; + var target = e.target || e.srcElement; + if (!target) { + return; + } + + if (!hasClass(target, 'is-disabled')) { + if (hasClass(target, 'pika-button') && !hasClass(target, 'is-empty')) { + self.setDate(new Date(target.getAttribute('data-pika-year'), target.getAttribute('data-pika-month'), target.getAttribute('data-pika-day'))); + if (opts.bound) { + sto(function() { + self.hide(); + if (opts.field) { + opts.field.blur(); + } + }, 100); + } + } + else if (hasClass(target, 'pika-prev')) { + self.prevMonth(); + } + else if (hasClass(target, 'pika-next')) { + self.nextMonth(); + } + } + if (!hasClass(target, 'pika-select')) { + // if this is touch event prevent mouse events emulation + if (e.preventDefault) { + e.preventDefault(); + } else { + e.returnValue = false; + return false; + } + } else { + self._c = true; + } + }; + + self._onChange = function(e) + { + e = e || window.event; + var target = e.target || e.srcElement; + if (!target) { + return; + } + if (hasClass(target, 'pika-select-month')) { + self.gotoMonth(target.value); + } + else if (hasClass(target, 'pika-select-year')) { + self.gotoYear(target.value); + } + }; + + self._onInputChange = function(e) + { + var date; + + if (e.firedBy === self) { + return; + } + if (hasMoment) { + date = moment(opts.field.value, opts.format); + date = (date && date.isValid()) ? date.toDate() : null; + } + else { + date = new Date(Date.parse(opts.field.value)); + } + if (isDate(date)) { + self.setDate(date); + } + if (!self._v) { + self.show(); + } + }; + + self._onInputFocus = function() + { + self.show(); + }; + + self._onInputClick = function() + { + self.show(); + }; + + self._onInputBlur = function() + { + // IE allows pika div to gain focus; catch blur the input field + var pEl = document.activeElement; + do { + if (hasClass(pEl, 'pika-single')) { + return; + } + } + while ((pEl = pEl.parentNode)); + + if (!self._c) { + self._b = sto(function() { + self.hide(); + }, 50); + } + self._c = false; + }; + + self._onClick = function(e) + { + e = e || window.event; + var target = e.target || e.srcElement, + pEl = target; + if (!target) { + return; + } + if (!hasEventListeners && hasClass(target, 'pika-select')) { + if (!target.onchange) { + target.setAttribute('onchange', 'return;'); + addEvent(target, 'change', self._onChange); + } + } + do { + if (hasClass(pEl, 'pika-single') || pEl === opts.trigger) { + return; + } + } + while ((pEl = pEl.parentNode)); + if (self._v && target !== opts.trigger && pEl !== opts.trigger) { + self.hide(); + } + }; + + self.el = document.createElement('div'); + self.el.className = 'pika-single' + (opts.isRTL ? ' is-rtl' : '') + (opts.theme ? ' ' + opts.theme : ''); + + addEvent(self.el, 'mousedown', self._onMouseDown, true); + addEvent(self.el, 'touchend', self._onMouseDown, true); + addEvent(self.el, 'change', self._onChange); + + if (opts.field) { + if (opts.container) { + opts.container.appendChild(self.el); + } else if (opts.bound) { + document.body.appendChild(self.el); + } else { + opts.field.parentNode.insertBefore(self.el, opts.field.nextSibling); + } + addEvent(opts.field, 'change', self._onInputChange); + + if (!opts.defaultDate) { + if (hasMoment && opts.field.value) { + opts.defaultDate = moment(opts.field.value, opts.format).toDate(); + } else { + opts.defaultDate = new Date(Date.parse(opts.field.value)); + } + opts.setDefaultDate = true; + } + } + + var defDate = opts.defaultDate; + + if (isDate(defDate)) { + if (opts.setDefaultDate) { + self.setDate(defDate, true); + } else { + self.gotoDate(defDate); + } + } else { + self.gotoDate(new Date()); + } + + if (opts.bound) { + this.hide(); + self.el.className += ' is-bound'; + addEvent(opts.trigger, 'click', self._onInputClick); + addEvent(opts.trigger, 'focus', self._onInputFocus); + addEvent(opts.trigger, 'blur', self._onInputBlur); + } else { + this.show(); + } + }; + + + /** + * public Pikaday API + */ + Pikaday.prototype = { + + + /** + * configure functionality + */ + config: function(options) + { + if (!this._o) { + this._o = extend({}, defaults, true); + } + + var opts = extend(this._o, options, true); + + opts.isRTL = !!opts.isRTL; + + opts.field = (opts.field && opts.field.nodeName) ? opts.field : null; + + opts.theme = (typeof opts.theme) === 'string' && opts.theme ? opts.theme : null; + + opts.bound = !!(opts.bound !== undefined ? opts.field && opts.bound : opts.field); + + opts.trigger = (opts.trigger && opts.trigger.nodeName) ? opts.trigger : opts.field; + + opts.disableWeekends = !!opts.disableWeekends; + + opts.disableDayFn = (typeof opts.disableDayFn) === 'function' ? opts.disableDayFn : null; + + var nom = parseInt(opts.numberOfMonths, 10) || 1; + opts.numberOfMonths = nom > 4 ? 4 : nom; + + if (!isDate(opts.minDate)) { + opts.minDate = false; + } + if (!isDate(opts.maxDate)) { + opts.maxDate = false; + } + if ((opts.minDate && opts.maxDate) && opts.maxDate < opts.minDate) { + opts.maxDate = opts.minDate = false; + } + if (opts.minDate) { + this.setMinDate(opts.minDate); + } + if (opts.maxDate) { + this.setMaxDate(opts.maxDate); + } + + if (isArray(opts.yearRange)) { + var fallback = new Date().getFullYear() - 10; + opts.yearRange[0] = parseInt(opts.yearRange[0], 10) || fallback; + opts.yearRange[1] = parseInt(opts.yearRange[1], 10) || fallback; + } else { + opts.yearRange = Math.abs(parseInt(opts.yearRange, 10)) || defaults.yearRange; + if (opts.yearRange > 100) { + opts.yearRange = 100; + } + } + + return opts; + }, + + /** + * return a formatted string of the current selection (using Moment.js if available) + */ + toString: function(format) + { + return !isDate(this._d) ? '' : hasMoment ? moment(this._d).format(format || this._o.format) : this._d.toDateString(); + }, + + /** + * return a Moment.js object of the current selection (if available) + */ + getMoment: function() + { + return hasMoment ? moment(this._d) : null; + }, + + /** + * set the current selection from a Moment.js object (if available) + */ + setMoment: function(date, preventOnSelect) + { + if (hasMoment && moment.isMoment(date)) { + this.setDate(date.toDate(), preventOnSelect); + } + }, + + /** + * return a Date object of the current selection + */ + getDate: function() + { + return isDate(this._d) ? new Date(this._d.getTime()) : null; + }, + + /** + * set the current selection + */ + setDate: function(date, preventOnSelect) + { + if (!date) { + this._d = null; + + if (this._o.field) { + this._o.field.value = ''; + fireEvent(this._o.field, 'change', { firedBy: this }); + } + + return this.draw(); + } + if (typeof date === 'string') { + date = new Date(Date.parse(date)); + } + if (!isDate(date)) { + return; + } + + var min = this._o.minDate, + max = this._o.maxDate; + + if (isDate(min) && date < min) { + date = min; + } else if (isDate(max) && date > max) { + date = max; + } + + this._d = new Date(date.getTime()); + setToStartOfDay(this._d); + this.gotoDate(this._d); + + if (this._o.field) { + this._o.field.value = this.toString(); + fireEvent(this._o.field, 'change', { firedBy: this }); + } + if (!preventOnSelect && typeof this._o.onSelect === 'function') { + this._o.onSelect.call(this, this.getDate()); + } + }, + + /** + * change view to a specific date + */ + gotoDate: function(date) + { + var newCalendar = true; + + if (!isDate(date)) { + return; + } + + if (this.calendars) { + var firstVisibleDate = new Date(this.calendars[0].year, this.calendars[0].month, 1), + lastVisibleDate = new Date(this.calendars[this.calendars.length-1].year, this.calendars[this.calendars.length-1].month, 1), + visibleDate = date.getTime(); + // get the end of the month + lastVisibleDate.setMonth(lastVisibleDate.getMonth()+1); + lastVisibleDate.setDate(lastVisibleDate.getDate()-1); + newCalendar = (visibleDate < firstVisibleDate.getTime() || lastVisibleDate.getTime() < visibleDate); + } + + if (newCalendar) { + this.calendars = [{ + month: date.getMonth(), + year: date.getFullYear() + }]; + if (this._o.mainCalendar === 'right') { + this.calendars[0].month += 1 - this._o.numberOfMonths; + } + } + + this.adjustCalendars(); + }, + + adjustCalendars: function() { + this.calendars[0] = adjustCalendar(this.calendars[0]); + for (var c = 1; c < this._o.numberOfMonths; c++) { + this.calendars[c] = adjustCalendar({ + month: this.calendars[0].month + c, + year: this.calendars[0].year + }); + } + this.draw(); + }, + + gotoToday: function() + { + this.gotoDate(new Date()); + }, + + /** + * change view to a specific month (zero-index, e.g. 0: January) + */ + gotoMonth: function(month) + { + if (!isNaN(month)) { + this.calendars[0].month = parseInt(month, 10); + this.adjustCalendars(); + } + }, + + nextMonth: function() + { + this.calendars[0].month++; + this.adjustCalendars(); + }, + + prevMonth: function() + { + this.calendars[0].month--; + this.adjustCalendars(); + }, + + /** + * change view to a specific full year (e.g. "2012") + */ + gotoYear: function(year) + { + if (!isNaN(year)) { + this.calendars[0].year = parseInt(year, 10); + this.adjustCalendars(); + } + }, + + /** + * change the minDate + */ + setMinDate: function(value) + { + setToStartOfDay(value); + this._o.minDate = value; + this._o.minYear = value.getFullYear(); + this._o.minMonth = value.getMonth(); + this.draw(); + }, + + /** + * change the maxDate + */ + setMaxDate: function(value) + { + setToStartOfDay(value); + this._o.maxDate = value; + this._o.maxYear = value.getFullYear(); + this._o.maxMonth = value.getMonth(); + this.draw(); + }, + + setStartRange: function(value) + { + this._o.startRange = value; + }, + + setEndRange: function(value) + { + this._o.endRange = value; + }, + + /** + * refresh the HTML + */ + draw: function(force) + { + if (!this._v && !force) { + return; + } + var opts = this._o, + minYear = opts.minYear, + maxYear = opts.maxYear, + minMonth = opts.minMonth, + maxMonth = opts.maxMonth, + html = ''; + + if (this._y <= minYear) { + this._y = minYear; + if (!isNaN(minMonth) && this._m < minMonth) { + this._m = minMonth; + } + } + if (this._y >= maxYear) { + this._y = maxYear; + if (!isNaN(maxMonth) && this._m > maxMonth) { + this._m = maxMonth; + } + } + + for (var c = 0; c < opts.numberOfMonths; c++) { + html += '
' + renderTitle(this, c, this.calendars[c].year, this.calendars[c].month, this.calendars[0].year) + this.render(this.calendars[c].year, this.calendars[c].month) + '
'; + } + + this.el.innerHTML = html; + + if (opts.bound) { + if(opts.field.type !== 'hidden') { + sto(function() { + opts.trigger.focus(); + }, 1); + } + } + + if (typeof this._o.onDraw === 'function') { + var self = this; + sto(function() { + self._o.onDraw.call(self); + }, 0); + } + }, + + adjustPosition: function() + { + var field, pEl, width, height, viewportWidth, viewportHeight, scrollTop, left, top, clientRect; + + if (this._o.container) return; + + this.el.style.position = 'absolute'; + + field = this._o.trigger; + pEl = field; + width = this.el.offsetWidth; + height = this.el.offsetHeight; + viewportWidth = window.innerWidth || document.documentElement.clientWidth; + viewportHeight = window.innerHeight || document.documentElement.clientHeight; + scrollTop = window.pageYOffset || document.body.scrollTop || document.documentElement.scrollTop; + + if (typeof field.getBoundingClientRect === 'function') { + clientRect = field.getBoundingClientRect(); + left = clientRect.left + window.pageXOffset; + top = clientRect.bottom + window.pageYOffset; + } else { + left = pEl.offsetLeft; + top = pEl.offsetTop + pEl.offsetHeight; + while((pEl = pEl.offsetParent)) { + left += pEl.offsetLeft; + top += pEl.offsetTop; + } + } + + // default position is bottom & left + if ((this._o.reposition && left + width > viewportWidth) || + ( + this._o.position.indexOf('right') > -1 && + left - width + field.offsetWidth > 0 + ) + ) { + left = left - width + field.offsetWidth; + } + if ((this._o.reposition && top + height > viewportHeight + scrollTop) || + ( + this._o.position.indexOf('top') > -1 && + top - height - field.offsetHeight > 0 + ) + ) { + top = top - height - field.offsetHeight; + } + + this.el.style.left = left + 'px'; + this.el.style.top = top + 'px'; + }, + + /** + * render HTML for a particular month + */ + render: function(year, month) + { + var opts = this._o, + now = new Date(), + days = getDaysInMonth(year, month), + before = new Date(year, month, 1).getDay(), + data = [], + row = []; + setToStartOfDay(now); + if (opts.firstDay > 0) { + before -= opts.firstDay; + if (before < 0) { + before += 7; + } + } + var cells = days + before, + after = cells; + while(after > 7) { + after -= 7; + } + cells += 7 - after; + for (var i = 0, r = 0; i < cells; i++) + { + var day = new Date(year, month, 1 + (i - before)), + isSelected = isDate(this._d) ? compareDates(day, this._d) : false, + isToday = compareDates(day, now), + isEmpty = i < before || i >= (days + before), + isStartRange = opts.startRange && compareDates(opts.startRange, day), + isEndRange = opts.endRange && compareDates(opts.endRange, day), + isInRange = opts.startRange && opts.endRange && opts.startRange < day && day < opts.endRange, + isDisabled = (opts.minDate && day < opts.minDate) || + (opts.maxDate && day > opts.maxDate) || + (opts.disableWeekends && isWeekend(day)) || + (opts.disableDayFn && opts.disableDayFn(day)), + dayConfig = { + day: 1 + (i - before), + month: month, + year: year, + isSelected: isSelected, + isToday: isToday, + isDisabled: isDisabled, + isEmpty: isEmpty, + isStartRange: isStartRange, + isEndRange: isEndRange, + isInRange: isInRange + }; + + row.push(renderDay(dayConfig)); + + if (++r === 7) { + if (opts.showWeekNumber) { + row.unshift(renderWeek(i - before, month, year)); + } + data.push(renderRow(row, opts.isRTL)); + row = []; + r = 0; + } + } + return renderTable(opts, data); + }, + + isVisible: function() + { + return this._v; + }, + + show: function() + { + if (!this._v) { + removeClass(this.el, 'is-hidden'); + this._v = true; + this.draw(); + if (this._o.bound) { + addEvent(document, 'click', this._onClick); + this.adjustPosition(); + } + if (typeof this._o.onOpen === 'function') { + this._o.onOpen.call(this); + } + } + }, + + hide: function() + { + var v = this._v; + if (v !== false) { + if (this._o.bound) { + removeEvent(document, 'click', this._onClick); + } + this.el.style.position = 'static'; // reset + this.el.style.left = 'auto'; + this.el.style.top = 'auto'; + addClass(this.el, 'is-hidden'); + this._v = false; + if (v !== undefined && typeof this._o.onClose === 'function') { + this._o.onClose.call(this); + } + } + }, + + /** + * GAME OVER + */ + destroy: function() + { + this.hide(); + removeEvent(this.el, 'mousedown', this._onMouseDown, true); + removeEvent(this.el, 'touchend', this._onMouseDown, true); + removeEvent(this.el, 'change', this._onChange); + if (this._o.field) { + removeEvent(this._o.field, 'change', this._onInputChange); + if (this._o.bound) { + removeEvent(this._o.trigger, 'click', this._onInputClick); + removeEvent(this._o.trigger, 'focus', this._onInputFocus); + removeEvent(this._o.trigger, 'blur', this._onInputBlur); + } + } + if (this.el.parentNode) { + this.el.parentNode.removeChild(this.el); + } + } + + }; + + return Pikaday; + +})); + +},{"moment":"moment"}],"zeroclipboard":[function(require,module,exports){ +/*! + * ZeroClipboard + * The ZeroClipboard library provides an easy way to copy text to the clipboard using an invisible Adobe Flash movie and a JavaScript interface. + * Copyright (c) 2009-2014 Jon Rohan, James M. Greene + * Licensed MIT + * http://zeroclipboard.org/ + * v2.2.0 + */ +(function(window, undefined) { + "use strict"; + /** + * Store references to critically important global functions that may be + * overridden on certain web pages. + */ + var _window = window, _document = _window.document, _navigator = _window.navigator, _setTimeout = _window.setTimeout, _clearTimeout = _window.clearTimeout, _setInterval = _window.setInterval, _clearInterval = _window.clearInterval, _getComputedStyle = _window.getComputedStyle, _encodeURIComponent = _window.encodeURIComponent, _ActiveXObject = _window.ActiveXObject, _Error = _window.Error, _parseInt = _window.Number.parseInt || _window.parseInt, _parseFloat = _window.Number.parseFloat || _window.parseFloat, _isNaN = _window.Number.isNaN || _window.isNaN, _now = _window.Date.now, _keys = _window.Object.keys, _defineProperty = _window.Object.defineProperty, _hasOwn = _window.Object.prototype.hasOwnProperty, _slice = _window.Array.prototype.slice, _unwrap = function() { + var unwrapper = function(el) { + return el; + }; + if (typeof _window.wrap === "function" && typeof _window.unwrap === "function") { + try { + var div = _document.createElement("div"); + var unwrappedDiv = _window.unwrap(div); + if (div.nodeType === 1 && unwrappedDiv && unwrappedDiv.nodeType === 1) { + unwrapper = _window.unwrap; + } + } catch (e) {} + } + return unwrapper; + }(); + /** + * Convert an `arguments` object into an Array. + * + * @returns The arguments as an Array + * @private + */ + var _args = function(argumentsObj) { + return _slice.call(argumentsObj, 0); + }; + /** + * Shallow-copy the owned, enumerable properties of one object over to another, similar to jQuery's `$.extend`. + * + * @returns The target object, augmented + * @private + */ + var _extend = function() { + var i, len, arg, prop, src, copy, args = _args(arguments), target = args[0] || {}; + for (i = 1, len = args.length; i < len; i++) { + if ((arg = args[i]) != null) { + for (prop in arg) { + if (_hasOwn.call(arg, prop)) { + src = target[prop]; + copy = arg[prop]; + if (target !== copy && copy !== undefined) { + target[prop] = copy; + } + } + } + } + } + return target; + }; + /** + * Return a deep copy of the source object or array. + * + * @returns Object or Array + * @private + */ + var _deepCopy = function(source) { + var copy, i, len, prop; + if (typeof source !== "object" || source == null || typeof source.nodeType === "number") { + copy = source; + } else if (typeof source.length === "number") { + copy = []; + for (i = 0, len = source.length; i < len; i++) { + if (_hasOwn.call(source, i)) { + copy[i] = _deepCopy(source[i]); + } + } + } else { + copy = {}; + for (prop in source) { + if (_hasOwn.call(source, prop)) { + copy[prop] = _deepCopy(source[prop]); + } + } + } + return copy; + }; + /** + * Makes a shallow copy of `obj` (like `_extend`) but filters its properties based on a list of `keys` to keep. + * The inverse of `_omit`, mostly. The big difference is that these properties do NOT need to be enumerable to + * be kept. + * + * @returns A new filtered object. + * @private + */ + var _pick = function(obj, keys) { + var newObj = {}; + for (var i = 0, len = keys.length; i < len; i++) { + if (keys[i] in obj) { + newObj[keys[i]] = obj[keys[i]]; + } + } + return newObj; + }; + /** + * Makes a shallow copy of `obj` (like `_extend`) but filters its properties based on a list of `keys` to omit. + * The inverse of `_pick`. + * + * @returns A new filtered object. + * @private + */ + var _omit = function(obj, keys) { + var newObj = {}; + for (var prop in obj) { + if (keys.indexOf(prop) === -1) { + newObj[prop] = obj[prop]; + } + } + return newObj; + }; + /** + * Remove all owned, enumerable properties from an object. + * + * @returns The original object without its owned, enumerable properties. + * @private + */ + var _deleteOwnProperties = function(obj) { + if (obj) { + for (var prop in obj) { + if (_hasOwn.call(obj, prop)) { + delete obj[prop]; + } + } + } + return obj; + }; + /** + * Determine if an element is contained within another element. + * + * @returns Boolean + * @private + */ + var _containedBy = function(el, ancestorEl) { + if (el && el.nodeType === 1 && el.ownerDocument && ancestorEl && (ancestorEl.nodeType === 1 && ancestorEl.ownerDocument && ancestorEl.ownerDocument === el.ownerDocument || ancestorEl.nodeType === 9 && !ancestorEl.ownerDocument && ancestorEl === el.ownerDocument)) { + do { + if (el === ancestorEl) { + return true; + } + el = el.parentNode; + } while (el); + } + return false; + }; + /** + * Get the URL path's parent directory. + * + * @returns String or `undefined` + * @private + */ + var _getDirPathOfUrl = function(url) { + var dir; + if (typeof url === "string" && url) { + dir = url.split("#")[0].split("?")[0]; + dir = url.slice(0, url.lastIndexOf("/") + 1); + } + return dir; + }; + /** + * Get the current script's URL by throwing an `Error` and analyzing it. + * + * @returns String or `undefined` + * @private + */ + var _getCurrentScriptUrlFromErrorStack = function(stack) { + var url, matches; + if (typeof stack === "string" && stack) { + matches = stack.match(/^(?:|[^:@]*@|.+\)@(?=http[s]?|file)|.+?\s+(?: at |@)(?:[^:\(]+ )*[\(]?)((?:http[s]?|file):\/\/[\/]?.+?\/[^:\)]*?)(?::\d+)(?::\d+)?/); + if (matches && matches[1]) { + url = matches[1]; + } else { + matches = stack.match(/\)@((?:http[s]?|file):\/\/[\/]?.+?\/[^:\)]*?)(?::\d+)(?::\d+)?/); + if (matches && matches[1]) { + url = matches[1]; + } + } + } + return url; + }; + /** + * Get the current script's URL by throwing an `Error` and analyzing it. + * + * @returns String or `undefined` + * @private + */ + var _getCurrentScriptUrlFromError = function() { + var url, err; + try { + throw new _Error(); + } catch (e) { + err = e; + } + if (err) { + url = err.sourceURL || err.fileName || _getCurrentScriptUrlFromErrorStack(err.stack); + } + return url; + }; + /** + * Get the current script's URL. + * + * @returns String or `undefined` + * @private + */ + var _getCurrentScriptUrl = function() { + var jsPath, scripts, i; + if (_document.currentScript && (jsPath = _document.currentScript.src)) { + return jsPath; + } + scripts = _document.getElementsByTagName("script"); + if (scripts.length === 1) { + return scripts[0].src || undefined; + } + if ("readyState" in scripts[0]) { + for (i = scripts.length; i--; ) { + if (scripts[i].readyState === "interactive" && (jsPath = scripts[i].src)) { + return jsPath; + } + } + } + if (_document.readyState === "loading" && (jsPath = scripts[scripts.length - 1].src)) { + return jsPath; + } + if (jsPath = _getCurrentScriptUrlFromError()) { + return jsPath; + } + return undefined; + }; + /** + * Get the unanimous parent directory of ALL script tags. + * If any script tags are either (a) inline or (b) from differing parent + * directories, this method must return `undefined`. + * + * @returns String or `undefined` + * @private + */ + var _getUnanimousScriptParentDir = function() { + var i, jsDir, jsPath, scripts = _document.getElementsByTagName("script"); + for (i = scripts.length; i--; ) { + if (!(jsPath = scripts[i].src)) { + jsDir = null; + break; + } + jsPath = _getDirPathOfUrl(jsPath); + if (jsDir == null) { + jsDir = jsPath; + } else if (jsDir !== jsPath) { + jsDir = null; + break; + } + } + return jsDir || undefined; + }; + /** + * Get the presumed location of the "ZeroClipboard.swf" file, based on the location + * of the executing JavaScript file (e.g. "ZeroClipboard.js", etc.). + * + * @returns String + * @private + */ + var _getDefaultSwfPath = function() { + var jsDir = _getDirPathOfUrl(_getCurrentScriptUrl()) || _getUnanimousScriptParentDir() || ""; + return jsDir + "ZeroClipboard.swf"; + }; + /** + * Keep track of if the page is framed (in an `iframe`). This can never change. + * @private + */ + var _pageIsFramed = function() { + return window.opener == null && (!!window.top && window != window.top || !!window.parent && window != window.parent); + }(); + /** + * Keep track of the state of the Flash object. + * @private + */ + var _flashState = { + bridge: null, + version: "0.0.0", + pluginType: "unknown", + disabled: null, + outdated: null, + sandboxed: null, + unavailable: null, + degraded: null, + deactivated: null, + overdue: null, + ready: null + }; + /** + * The minimum Flash Player version required to use ZeroClipboard completely. + * @readonly + * @private + */ + var _minimumFlashVersion = "11.0.0"; + /** + * The ZeroClipboard library version number, as reported by Flash, at the time the SWF was compiled. + */ + var _zcSwfVersion; + /** + * Keep track of all event listener registrations. + * @private + */ + var _handlers = {}; + /** + * Keep track of the currently activated element. + * @private + */ + var _currentElement; + /** + * Keep track of the element that was activated when a `copy` process started. + * @private + */ + var _copyTarget; + /** + * Keep track of data for the pending clipboard transaction. + * @private + */ + var _clipData = {}; + /** + * Keep track of data formats for the pending clipboard transaction. + * @private + */ + var _clipDataFormatMap = null; + /** + * Keep track of the Flash availability check timeout. + * @private + */ + var _flashCheckTimeout = 0; + /** + * Keep track of SWF network errors interval polling. + * @private + */ + var _swfFallbackCheckInterval = 0; + /** + * The `message` store for events + * @private + */ + var _eventMessages = { + ready: "Flash communication is established", + error: { + "flash-disabled": "Flash is disabled or not installed. May also be attempting to run Flash in a sandboxed iframe, which is impossible.", + "flash-outdated": "Flash is too outdated to support ZeroClipboard", + "flash-sandboxed": "Attempting to run Flash in a sandboxed iframe, which is impossible", + "flash-unavailable": "Flash is unable to communicate bidirectionally with JavaScript", + "flash-degraded": "Flash is unable to preserve data fidelity when communicating with JavaScript", + "flash-deactivated": "Flash is too outdated for your browser and/or is configured as click-to-activate.\nThis may also mean that the ZeroClipboard SWF object could not be loaded, so please check your `swfPath` configuration and/or network connectivity.\nMay also be attempting to run Flash in a sandboxed iframe, which is impossible.", + "flash-overdue": "Flash communication was established but NOT within the acceptable time limit", + "version-mismatch": "ZeroClipboard JS version number does not match ZeroClipboard SWF version number", + "clipboard-error": "At least one error was thrown while ZeroClipboard was attempting to inject your data into the clipboard", + "config-mismatch": "ZeroClipboard configuration does not match Flash's reality", + "swf-not-found": "The ZeroClipboard SWF object could not be loaded, so please check your `swfPath` configuration and/or network connectivity" + } + }; + /** + * The `name`s of `error` events that can only occur is Flash has at least + * been able to load the SWF successfully. + * @private + */ + var _errorsThatOnlyOccurAfterFlashLoads = [ "flash-unavailable", "flash-degraded", "flash-overdue", "version-mismatch", "config-mismatch", "clipboard-error" ]; + /** + * The `name`s of `error` events that should likely result in the `_flashState` + * variable's property values being updated. + * @private + */ + var _flashStateErrorNames = [ "flash-disabled", "flash-outdated", "flash-sandboxed", "flash-unavailable", "flash-degraded", "flash-deactivated", "flash-overdue" ]; + /** + * A RegExp to match the `name` property of `error` events related to Flash. + * @private + */ + var _flashStateErrorNameMatchingRegex = new RegExp("^flash-(" + _flashStateErrorNames.map(function(errorName) { + return errorName.replace(/^flash-/, ""); + }).join("|") + ")$"); + /** + * A RegExp to match the `name` property of `error` events related to Flash, + * which is enabled. + * @private + */ + var _flashStateEnabledErrorNameMatchingRegex = new RegExp("^flash-(" + _flashStateErrorNames.slice(1).map(function(errorName) { + return errorName.replace(/^flash-/, ""); + }).join("|") + ")$"); + /** + * ZeroClipboard configuration defaults for the Core module. + * @private + */ + var _globalConfig = { + swfPath: _getDefaultSwfPath(), + trustedDomains: window.location.host ? [ window.location.host ] : [], + cacheBust: true, + forceEnhancedClipboard: false, + flashLoadTimeout: 3e4, + autoActivate: true, + bubbleEvents: true, + containerId: "global-zeroclipboard-html-bridge", + containerClass: "global-zeroclipboard-container", + swfObjectId: "global-zeroclipboard-flash-bridge", + hoverClass: "zeroclipboard-is-hover", + activeClass: "zeroclipboard-is-active", + forceHandCursor: false, + title: null, + zIndex: 999999999 + }; + /** + * The underlying implementation of `ZeroClipboard.config`. + * @private + */ + var _config = function(options) { + if (typeof options === "object" && options !== null) { + for (var prop in options) { + if (_hasOwn.call(options, prop)) { + if (/^(?:forceHandCursor|title|zIndex|bubbleEvents)$/.test(prop)) { + _globalConfig[prop] = options[prop]; + } else if (_flashState.bridge == null) { + if (prop === "containerId" || prop === "swfObjectId") { + if (_isValidHtml4Id(options[prop])) { + _globalConfig[prop] = options[prop]; + } else { + throw new Error("The specified `" + prop + "` value is not valid as an HTML4 Element ID"); + } + } else { + _globalConfig[prop] = options[prop]; + } + } + } + } + } + if (typeof options === "string" && options) { + if (_hasOwn.call(_globalConfig, options)) { + return _globalConfig[options]; + } + return; + } + return _deepCopy(_globalConfig); + }; + /** + * The underlying implementation of `ZeroClipboard.state`. + * @private + */ + var _state = function() { + _detectSandbox(); + return { + browser: _pick(_navigator, [ "userAgent", "platform", "appName" ]), + flash: _omit(_flashState, [ "bridge" ]), + zeroclipboard: { + version: ZeroClipboard.version, + config: ZeroClipboard.config() + } + }; + }; + /** + * The underlying implementation of `ZeroClipboard.isFlashUnusable`. + * @private + */ + var _isFlashUnusable = function() { + return !!(_flashState.disabled || _flashState.outdated || _flashState.sandboxed || _flashState.unavailable || _flashState.degraded || _flashState.deactivated); + }; + /** + * The underlying implementation of `ZeroClipboard.on`. + * @private + */ + var _on = function(eventType, listener) { + var i, len, events, added = {}; + if (typeof eventType === "string" && eventType) { + events = eventType.toLowerCase().split(/\s+/); + } else if (typeof eventType === "object" && eventType && typeof listener === "undefined") { + for (i in eventType) { + if (_hasOwn.call(eventType, i) && typeof i === "string" && i && typeof eventType[i] === "function") { + ZeroClipboard.on(i, eventType[i]); + } + } + } + if (events && events.length) { + for (i = 0, len = events.length; i < len; i++) { + eventType = events[i].replace(/^on/, ""); + added[eventType] = true; + if (!_handlers[eventType]) { + _handlers[eventType] = []; + } + _handlers[eventType].push(listener); + } + if (added.ready && _flashState.ready) { + ZeroClipboard.emit({ + type: "ready" + }); + } + if (added.error) { + for (i = 0, len = _flashStateErrorNames.length; i < len; i++) { + if (_flashState[_flashStateErrorNames[i].replace(/^flash-/, "")] === true) { + ZeroClipboard.emit({ + type: "error", + name: _flashStateErrorNames[i] + }); + break; + } + } + if (_zcSwfVersion !== undefined && ZeroClipboard.version !== _zcSwfVersion) { + ZeroClipboard.emit({ + type: "error", + name: "version-mismatch", + jsVersion: ZeroClipboard.version, + swfVersion: _zcSwfVersion + }); + } + } + } + return ZeroClipboard; + }; + /** + * The underlying implementation of `ZeroClipboard.off`. + * @private + */ + var _off = function(eventType, listener) { + var i, len, foundIndex, events, perEventHandlers; + if (arguments.length === 0) { + events = _keys(_handlers); + } else if (typeof eventType === "string" && eventType) { + events = eventType.split(/\s+/); + } else if (typeof eventType === "object" && eventType && typeof listener === "undefined") { + for (i in eventType) { + if (_hasOwn.call(eventType, i) && typeof i === "string" && i && typeof eventType[i] === "function") { + ZeroClipboard.off(i, eventType[i]); + } + } + } + if (events && events.length) { + for (i = 0, len = events.length; i < len; i++) { + eventType = events[i].toLowerCase().replace(/^on/, ""); + perEventHandlers = _handlers[eventType]; + if (perEventHandlers && perEventHandlers.length) { + if (listener) { + foundIndex = perEventHandlers.indexOf(listener); + while (foundIndex !== -1) { + perEventHandlers.splice(foundIndex, 1); + foundIndex = perEventHandlers.indexOf(listener, foundIndex); + } + } else { + perEventHandlers.length = 0; + } + } + } + } + return ZeroClipboard; + }; + /** + * The underlying implementation of `ZeroClipboard.handlers`. + * @private + */ + var _listeners = function(eventType) { + var copy; + if (typeof eventType === "string" && eventType) { + copy = _deepCopy(_handlers[eventType]) || null; + } else { + copy = _deepCopy(_handlers); + } + return copy; + }; + /** + * The underlying implementation of `ZeroClipboard.emit`. + * @private + */ + var _emit = function(event) { + var eventCopy, returnVal, tmp; + event = _createEvent(event); + if (!event) { + return; + } + if (_preprocessEvent(event)) { + return; + } + if (event.type === "ready" && _flashState.overdue === true) { + return ZeroClipboard.emit({ + type: "error", + name: "flash-overdue" + }); + } + eventCopy = _extend({}, event); + _dispatchCallbacks.call(this, eventCopy); + if (event.type === "copy") { + tmp = _mapClipDataToFlash(_clipData); + returnVal = tmp.data; + _clipDataFormatMap = tmp.formatMap; + } + return returnVal; + }; + /** + * The underlying implementation of `ZeroClipboard.create`. + * @private + */ + var _create = function() { + var previousState = _flashState.sandboxed; + _detectSandbox(); + if (typeof _flashState.ready !== "boolean") { + _flashState.ready = false; + } + if (_flashState.sandboxed !== previousState && _flashState.sandboxed === true) { + _flashState.ready = false; + ZeroClipboard.emit({ + type: "error", + name: "flash-sandboxed" + }); + } else if (!ZeroClipboard.isFlashUnusable() && _flashState.bridge === null) { + var maxWait = _globalConfig.flashLoadTimeout; + if (typeof maxWait === "number" && maxWait >= 0) { + _flashCheckTimeout = _setTimeout(function() { + if (typeof _flashState.deactivated !== "boolean") { + _flashState.deactivated = true; + } + if (_flashState.deactivated === true) { + ZeroClipboard.emit({ + type: "error", + name: "flash-deactivated" + }); + } + }, maxWait); + } + _flashState.overdue = false; + _embedSwf(); + } + }; + /** + * The underlying implementation of `ZeroClipboard.destroy`. + * @private + */ + var _destroy = function() { + ZeroClipboard.clearData(); + ZeroClipboard.blur(); + ZeroClipboard.emit("destroy"); + _unembedSwf(); + ZeroClipboard.off(); + }; + /** + * The underlying implementation of `ZeroClipboard.setData`. + * @private + */ + var _setData = function(format, data) { + var dataObj; + if (typeof format === "object" && format && typeof data === "undefined") { + dataObj = format; + ZeroClipboard.clearData(); + } else if (typeof format === "string" && format) { + dataObj = {}; + dataObj[format] = data; + } else { + return; + } + for (var dataFormat in dataObj) { + if (typeof dataFormat === "string" && dataFormat && _hasOwn.call(dataObj, dataFormat) && typeof dataObj[dataFormat] === "string" && dataObj[dataFormat]) { + _clipData[dataFormat] = dataObj[dataFormat]; + } + } + }; + /** + * The underlying implementation of `ZeroClipboard.clearData`. + * @private + */ + var _clearData = function(format) { + if (typeof format === "undefined") { + _deleteOwnProperties(_clipData); + _clipDataFormatMap = null; + } else if (typeof format === "string" && _hasOwn.call(_clipData, format)) { + delete _clipData[format]; + } + }; + /** + * The underlying implementation of `ZeroClipboard.getData`. + * @private + */ + var _getData = function(format) { + if (typeof format === "undefined") { + return _deepCopy(_clipData); + } else if (typeof format === "string" && _hasOwn.call(_clipData, format)) { + return _clipData[format]; + } + }; + /** + * The underlying implementation of `ZeroClipboard.focus`/`ZeroClipboard.activate`. + * @private + */ + var _focus = function(element) { + if (!(element && element.nodeType === 1)) { + return; + } + if (_currentElement) { + _removeClass(_currentElement, _globalConfig.activeClass); + if (_currentElement !== element) { + _removeClass(_currentElement, _globalConfig.hoverClass); + } + } + _currentElement = element; + _addClass(element, _globalConfig.hoverClass); + var newTitle = element.getAttribute("title") || _globalConfig.title; + if (typeof newTitle === "string" && newTitle) { + var htmlBridge = _getHtmlBridge(_flashState.bridge); + if (htmlBridge) { + htmlBridge.setAttribute("title", newTitle); + } + } + var useHandCursor = _globalConfig.forceHandCursor === true || _getStyle(element, "cursor") === "pointer"; + _setHandCursor(useHandCursor); + _reposition(); + }; + /** + * The underlying implementation of `ZeroClipboard.blur`/`ZeroClipboard.deactivate`. + * @private + */ + var _blur = function() { + var htmlBridge = _getHtmlBridge(_flashState.bridge); + if (htmlBridge) { + htmlBridge.removeAttribute("title"); + htmlBridge.style.left = "0px"; + htmlBridge.style.top = "-9999px"; + htmlBridge.style.width = "1px"; + htmlBridge.style.height = "1px"; + } + if (_currentElement) { + _removeClass(_currentElement, _globalConfig.hoverClass); + _removeClass(_currentElement, _globalConfig.activeClass); + _currentElement = null; + } + }; + /** + * The underlying implementation of `ZeroClipboard.activeElement`. + * @private + */ + var _activeElement = function() { + return _currentElement || null; + }; + /** + * Check if a value is a valid HTML4 `ID` or `Name` token. + * @private + */ + var _isValidHtml4Id = function(id) { + return typeof id === "string" && id && /^[A-Za-z][A-Za-z0-9_:\-\.]*$/.test(id); + }; + /** + * Create or update an `event` object, based on the `eventType`. + * @private + */ + var _createEvent = function(event) { + var eventType; + if (typeof event === "string" && event) { + eventType = event; + event = {}; + } else if (typeof event === "object" && event && typeof event.type === "string" && event.type) { + eventType = event.type; + } + if (!eventType) { + return; + } + eventType = eventType.toLowerCase(); + if (!event.target && (/^(copy|aftercopy|_click)$/.test(eventType) || eventType === "error" && event.name === "clipboard-error")) { + event.target = _copyTarget; + } + _extend(event, { + type: eventType, + target: event.target || _currentElement || null, + relatedTarget: event.relatedTarget || null, + currentTarget: _flashState && _flashState.bridge || null, + timeStamp: event.timeStamp || _now() || null + }); + var msg = _eventMessages[event.type]; + if (event.type === "error" && event.name && msg) { + msg = msg[event.name]; + } + if (msg) { + event.message = msg; + } + if (event.type === "ready") { + _extend(event, { + target: null, + version: _flashState.version + }); + } + if (event.type === "error") { + if (_flashStateErrorNameMatchingRegex.test(event.name)) { + _extend(event, { + target: null, + minimumVersion: _minimumFlashVersion + }); + } + if (_flashStateEnabledErrorNameMatchingRegex.test(event.name)) { + _extend(event, { + version: _flashState.version + }); + } + } + if (event.type === "copy") { + event.clipboardData = { + setData: ZeroClipboard.setData, + clearData: ZeroClipboard.clearData + }; + } + if (event.type === "aftercopy") { + event = _mapClipResultsFromFlash(event, _clipDataFormatMap); + } + if (event.target && !event.relatedTarget) { + event.relatedTarget = _getRelatedTarget(event.target); + } + return _addMouseData(event); + }; + /** + * Get a relatedTarget from the target's `data-clipboard-target` attribute + * @private + */ + var _getRelatedTarget = function(targetEl) { + var relatedTargetId = targetEl && targetEl.getAttribute && targetEl.getAttribute("data-clipboard-target"); + return relatedTargetId ? _document.getElementById(relatedTargetId) : null; + }; + /** + * Add element and position data to `MouseEvent` instances + * @private + */ + var _addMouseData = function(event) { + if (event && /^_(?:click|mouse(?:over|out|down|up|move))$/.test(event.type)) { + var srcElement = event.target; + var fromElement = event.type === "_mouseover" && event.relatedTarget ? event.relatedTarget : undefined; + var toElement = event.type === "_mouseout" && event.relatedTarget ? event.relatedTarget : undefined; + var pos = _getElementPosition(srcElement); + var screenLeft = _window.screenLeft || _window.screenX || 0; + var screenTop = _window.screenTop || _window.screenY || 0; + var scrollLeft = _document.body.scrollLeft + _document.documentElement.scrollLeft; + var scrollTop = _document.body.scrollTop + _document.documentElement.scrollTop; + var pageX = pos.left + (typeof event._stageX === "number" ? event._stageX : 0); + var pageY = pos.top + (typeof event._stageY === "number" ? event._stageY : 0); + var clientX = pageX - scrollLeft; + var clientY = pageY - scrollTop; + var screenX = screenLeft + clientX; + var screenY = screenTop + clientY; + var moveX = typeof event.movementX === "number" ? event.movementX : 0; + var moveY = typeof event.movementY === "number" ? event.movementY : 0; + delete event._stageX; + delete event._stageY; + _extend(event, { + srcElement: srcElement, + fromElement: fromElement, + toElement: toElement, + screenX: screenX, + screenY: screenY, + pageX: pageX, + pageY: pageY, + clientX: clientX, + clientY: clientY, + x: clientX, + y: clientY, + movementX: moveX, + movementY: moveY, + offsetX: 0, + offsetY: 0, + layerX: 0, + layerY: 0 + }); + } + return event; + }; + /** + * Determine if an event's registered handlers should be execute synchronously or asynchronously. + * + * @returns {boolean} + * @private + */ + var _shouldPerformAsync = function(event) { + var eventType = event && typeof event.type === "string" && event.type || ""; + return !/^(?:(?:before)?copy|destroy)$/.test(eventType); + }; + /** + * Control if a callback should be executed asynchronously or not. + * + * @returns `undefined` + * @private + */ + var _dispatchCallback = function(func, context, args, async) { + if (async) { + _setTimeout(function() { + func.apply(context, args); + }, 0); + } else { + func.apply(context, args); + } + }; + /** + * Handle the actual dispatching of events to client instances. + * + * @returns `undefined` + * @private + */ + var _dispatchCallbacks = function(event) { + if (!(typeof event === "object" && event && event.type)) { + return; + } + var async = _shouldPerformAsync(event); + var wildcardTypeHandlers = _handlers["*"] || []; + var specificTypeHandlers = _handlers[event.type] || []; + var handlers = wildcardTypeHandlers.concat(specificTypeHandlers); + if (handlers && handlers.length) { + var i, len, func, context, eventCopy, originalContext = this; + for (i = 0, len = handlers.length; i < len; i++) { + func = handlers[i]; + context = originalContext; + if (typeof func === "string" && typeof _window[func] === "function") { + func = _window[func]; + } + if (typeof func === "object" && func && typeof func.handleEvent === "function") { + context = func; + func = func.handleEvent; + } + if (typeof func === "function") { + eventCopy = _extend({}, event); + _dispatchCallback(func, context, [ eventCopy ], async); + } + } + } + return this; + }; + /** + * Check an `error` event's `name` property to see if Flash has + * already loaded, which rules out possible `iframe` sandboxing. + * @private + */ + var _getSandboxStatusFromErrorEvent = function(event) { + var isSandboxed = null; + if (_pageIsFramed === false || event && event.type === "error" && event.name && _errorsThatOnlyOccurAfterFlashLoads.indexOf(event.name) !== -1) { + isSandboxed = false; + } + return isSandboxed; + }; + /** + * Preprocess any special behaviors, reactions, or state changes after receiving this event. + * Executes only once per event emitted, NOT once per client. + * @private + */ + var _preprocessEvent = function(event) { + var element = event.target || _currentElement || null; + var sourceIsSwf = event._source === "swf"; + delete event._source; + switch (event.type) { + case "error": + var isSandboxed = event.name === "flash-sandboxed" || _getSandboxStatusFromErrorEvent(event); + if (typeof isSandboxed === "boolean") { + _flashState.sandboxed = isSandboxed; + } + if (_flashStateErrorNames.indexOf(event.name) !== -1) { + _extend(_flashState, { + disabled: event.name === "flash-disabled", + outdated: event.name === "flash-outdated", + unavailable: event.name === "flash-unavailable", + degraded: event.name === "flash-degraded", + deactivated: event.name === "flash-deactivated", + overdue: event.name === "flash-overdue", + ready: false + }); + } else if (event.name === "version-mismatch") { + _zcSwfVersion = event.swfVersion; + _extend(_flashState, { + disabled: false, + outdated: false, + unavailable: false, + degraded: false, + deactivated: false, + overdue: false, + ready: false + }); + } + _clearTimeoutsAndPolling(); + break; + + case "ready": + _zcSwfVersion = event.swfVersion; + var wasDeactivated = _flashState.deactivated === true; + _extend(_flashState, { + disabled: false, + outdated: false, + sandboxed: false, + unavailable: false, + degraded: false, + deactivated: false, + overdue: wasDeactivated, + ready: !wasDeactivated + }); + _clearTimeoutsAndPolling(); + break; + + case "beforecopy": + _copyTarget = element; + break; + + case "copy": + var textContent, htmlContent, targetEl = event.relatedTarget; + if (!(_clipData["text/html"] || _clipData["text/plain"]) && targetEl && (htmlContent = targetEl.value || targetEl.outerHTML || targetEl.innerHTML) && (textContent = targetEl.value || targetEl.textContent || targetEl.innerText)) { + event.clipboardData.clearData(); + event.clipboardData.setData("text/plain", textContent); + if (htmlContent !== textContent) { + event.clipboardData.setData("text/html", htmlContent); + } + } else if (!_clipData["text/plain"] && event.target && (textContent = event.target.getAttribute("data-clipboard-text"))) { + event.clipboardData.clearData(); + event.clipboardData.setData("text/plain", textContent); + } + break; + + case "aftercopy": + _queueEmitClipboardErrors(event); + ZeroClipboard.clearData(); + if (element && element !== _safeActiveElement() && element.focus) { + element.focus(); + } + break; + + case "_mouseover": + ZeroClipboard.focus(element); + if (_globalConfig.bubbleEvents === true && sourceIsSwf) { + if (element && element !== event.relatedTarget && !_containedBy(event.relatedTarget, element)) { + _fireMouseEvent(_extend({}, event, { + type: "mouseenter", + bubbles: false, + cancelable: false + })); + } + _fireMouseEvent(_extend({}, event, { + type: "mouseover" + })); + } + break; + + case "_mouseout": + ZeroClipboard.blur(); + if (_globalConfig.bubbleEvents === true && sourceIsSwf) { + if (element && element !== event.relatedTarget && !_containedBy(event.relatedTarget, element)) { + _fireMouseEvent(_extend({}, event, { + type: "mouseleave", + bubbles: false, + cancelable: false + })); + } + _fireMouseEvent(_extend({}, event, { + type: "mouseout" + })); + } + break; + + case "_mousedown": + _addClass(element, _globalConfig.activeClass); + if (_globalConfig.bubbleEvents === true && sourceIsSwf) { + _fireMouseEvent(_extend({}, event, { + type: event.type.slice(1) + })); + } + break; + + case "_mouseup": + _removeClass(element, _globalConfig.activeClass); + if (_globalConfig.bubbleEvents === true && sourceIsSwf) { + _fireMouseEvent(_extend({}, event, { + type: event.type.slice(1) + })); + } + break; + + case "_click": + _copyTarget = null; + if (_globalConfig.bubbleEvents === true && sourceIsSwf) { + _fireMouseEvent(_extend({}, event, { + type: event.type.slice(1) + })); + } + break; + + case "_mousemove": + if (_globalConfig.bubbleEvents === true && sourceIsSwf) { + _fireMouseEvent(_extend({}, event, { + type: event.type.slice(1) + })); + } + break; + } + if (/^_(?:click|mouse(?:over|out|down|up|move))$/.test(event.type)) { + return true; + } + }; + /** + * Check an "aftercopy" event for clipboard errors and emit a corresponding "error" event. + * @private + */ + var _queueEmitClipboardErrors = function(aftercopyEvent) { + if (aftercopyEvent.errors && aftercopyEvent.errors.length > 0) { + var errorEvent = _deepCopy(aftercopyEvent); + _extend(errorEvent, { + type: "error", + name: "clipboard-error" + }); + delete errorEvent.success; + _setTimeout(function() { + ZeroClipboard.emit(errorEvent); + }, 0); + } + }; + /** + * Dispatch a synthetic MouseEvent. + * + * @returns `undefined` + * @private + */ + var _fireMouseEvent = function(event) { + if (!(event && typeof event.type === "string" && event)) { + return; + } + var e, target = event.target || null, doc = target && target.ownerDocument || _document, defaults = { + view: doc.defaultView || _window, + canBubble: true, + cancelable: true, + detail: event.type === "click" ? 1 : 0, + button: typeof event.which === "number" ? event.which - 1 : typeof event.button === "number" ? event.button : doc.createEvent ? 0 : 1 + }, args = _extend(defaults, event); + if (!target) { + return; + } + if (doc.createEvent && target.dispatchEvent) { + args = [ args.type, args.canBubble, args.cancelable, args.view, args.detail, args.screenX, args.screenY, args.clientX, args.clientY, args.ctrlKey, args.altKey, args.shiftKey, args.metaKey, args.button, args.relatedTarget ]; + e = doc.createEvent("MouseEvents"); + if (e.initMouseEvent) { + e.initMouseEvent.apply(e, args); + e._source = "js"; + target.dispatchEvent(e); + } + } + }; + /** + * Continuously poll the DOM until either: + * (a) the fallback content becomes visible, or + * (b) we receive an event from SWF (handled elsewhere) + * + * IMPORTANT: + * This is NOT a necessary check but it can result in significantly faster + * detection of bad `swfPath` configuration and/or network/server issues [in + * supported browsers] than waiting for the entire `flashLoadTimeout` duration + * to elapse before detecting that the SWF cannot be loaded. The detection + * duration can be anywhere from 10-30 times faster [in supported browsers] by + * using this approach. + * + * @returns `undefined` + * @private + */ + var _watchForSwfFallbackContent = function() { + var maxWait = _globalConfig.flashLoadTimeout; + if (typeof maxWait === "number" && maxWait >= 0) { + var pollWait = Math.min(1e3, maxWait / 10); + var fallbackContentId = _globalConfig.swfObjectId + "_fallbackContent"; + _swfFallbackCheckInterval = _setInterval(function() { + var el = _document.getElementById(fallbackContentId); + if (_isElementVisible(el)) { + _clearTimeoutsAndPolling(); + _flashState.deactivated = null; + ZeroClipboard.emit({ + type: "error", + name: "swf-not-found" + }); + } + }, pollWait); + } + }; + /** + * Create the HTML bridge element to embed the Flash object into. + * @private + */ + var _createHtmlBridge = function() { + var container = _document.createElement("div"); + container.id = _globalConfig.containerId; + container.className = _globalConfig.containerClass; + container.style.position = "absolute"; + container.style.left = "0px"; + container.style.top = "-9999px"; + container.style.width = "1px"; + container.style.height = "1px"; + container.style.zIndex = "" + _getSafeZIndex(_globalConfig.zIndex); + return container; + }; + /** + * Get the HTML element container that wraps the Flash bridge object/element. + * @private + */ + var _getHtmlBridge = function(flashBridge) { + var htmlBridge = flashBridge && flashBridge.parentNode; + while (htmlBridge && htmlBridge.nodeName === "OBJECT" && htmlBridge.parentNode) { + htmlBridge = htmlBridge.parentNode; + } + return htmlBridge || null; + }; + /** + * Create the SWF object. + * + * @returns The SWF object reference. + * @private + */ + var _embedSwf = function() { + var len, flashBridge = _flashState.bridge, container = _getHtmlBridge(flashBridge); + if (!flashBridge) { + var allowScriptAccess = _determineScriptAccess(_window.location.host, _globalConfig); + var allowNetworking = allowScriptAccess === "never" ? "none" : "all"; + var flashvars = _vars(_extend({ + jsVersion: ZeroClipboard.version + }, _globalConfig)); + var swfUrl = _globalConfig.swfPath + _cacheBust(_globalConfig.swfPath, _globalConfig); + container = _createHtmlBridge(); + var divToBeReplaced = _document.createElement("div"); + container.appendChild(divToBeReplaced); + _document.body.appendChild(container); + var tmpDiv = _document.createElement("div"); + var usingActiveX = _flashState.pluginType === "activex"; + tmpDiv.innerHTML = '" + (usingActiveX ? '' : "") + '' + '' + '' + '' + '' + '
 
' + "
"; + flashBridge = tmpDiv.firstChild; + tmpDiv = null; + _unwrap(flashBridge).ZeroClipboard = ZeroClipboard; + container.replaceChild(flashBridge, divToBeReplaced); + _watchForSwfFallbackContent(); + } + if (!flashBridge) { + flashBridge = _document[_globalConfig.swfObjectId]; + if (flashBridge && (len = flashBridge.length)) { + flashBridge = flashBridge[len - 1]; + } + if (!flashBridge && container) { + flashBridge = container.firstChild; + } + } + _flashState.bridge = flashBridge || null; + return flashBridge; + }; + /** + * Destroy the SWF object. + * @private + */ + var _unembedSwf = function() { + var flashBridge = _flashState.bridge; + if (flashBridge) { + var htmlBridge = _getHtmlBridge(flashBridge); + if (htmlBridge) { + if (_flashState.pluginType === "activex" && "readyState" in flashBridge) { + flashBridge.style.display = "none"; + (function removeSwfFromIE() { + if (flashBridge.readyState === 4) { + for (var prop in flashBridge) { + if (typeof flashBridge[prop] === "function") { + flashBridge[prop] = null; + } + } + if (flashBridge.parentNode) { + flashBridge.parentNode.removeChild(flashBridge); + } + if (htmlBridge.parentNode) { + htmlBridge.parentNode.removeChild(htmlBridge); + } + } else { + _setTimeout(removeSwfFromIE, 10); + } + })(); + } else { + if (flashBridge.parentNode) { + flashBridge.parentNode.removeChild(flashBridge); + } + if (htmlBridge.parentNode) { + htmlBridge.parentNode.removeChild(htmlBridge); + } + } + } + _clearTimeoutsAndPolling(); + _flashState.ready = null; + _flashState.bridge = null; + _flashState.deactivated = null; + _zcSwfVersion = undefined; + } + }; + /** + * Map the data format names of the "clipData" to Flash-friendly names. + * + * @returns A new transformed object. + * @private + */ + var _mapClipDataToFlash = function(clipData) { + var newClipData = {}, formatMap = {}; + if (!(typeof clipData === "object" && clipData)) { + return; + } + for (var dataFormat in clipData) { + if (dataFormat && _hasOwn.call(clipData, dataFormat) && typeof clipData[dataFormat] === "string" && clipData[dataFormat]) { + switch (dataFormat.toLowerCase()) { + case "text/plain": + case "text": + case "air:text": + case "flash:text": + newClipData.text = clipData[dataFormat]; + formatMap.text = dataFormat; + break; + + case "text/html": + case "html": + case "air:html": + case "flash:html": + newClipData.html = clipData[dataFormat]; + formatMap.html = dataFormat; + break; + + case "application/rtf": + case "text/rtf": + case "rtf": + case "richtext": + case "air:rtf": + case "flash:rtf": + newClipData.rtf = clipData[dataFormat]; + formatMap.rtf = dataFormat; + break; + + default: + break; + } + } + } + return { + data: newClipData, + formatMap: formatMap + }; + }; + /** + * Map the data format names from Flash-friendly names back to their original "clipData" names (via a format mapping). + * + * @returns A new transformed object. + * @private + */ + var _mapClipResultsFromFlash = function(clipResults, formatMap) { + if (!(typeof clipResults === "object" && clipResults && typeof formatMap === "object" && formatMap)) { + return clipResults; + } + var newResults = {}; + for (var prop in clipResults) { + if (_hasOwn.call(clipResults, prop)) { + if (prop === "errors") { + newResults[prop] = clipResults[prop] ? clipResults[prop].slice() : []; + for (var i = 0, len = newResults[prop].length; i < len; i++) { + newResults[prop][i].format = formatMap[newResults[prop][i].format]; + } + } else if (prop !== "success" && prop !== "data") { + newResults[prop] = clipResults[prop]; + } else { + newResults[prop] = {}; + var tmpHash = clipResults[prop]; + for (var dataFormat in tmpHash) { + if (dataFormat && _hasOwn.call(tmpHash, dataFormat) && _hasOwn.call(formatMap, dataFormat)) { + newResults[prop][formatMap[dataFormat]] = tmpHash[dataFormat]; + } + } + } + } + } + return newResults; + }; + /** + * Will look at a path, and will create a "?noCache={time}" or "&noCache={time}" + * query param string to return. Does NOT append that string to the original path. + * This is useful because ExternalInterface often breaks when a Flash SWF is cached. + * + * @returns The `noCache` query param with necessary "?"/"&" prefix. + * @private + */ + var _cacheBust = function(path, options) { + var cacheBust = options == null || options && options.cacheBust === true; + if (cacheBust) { + return (path.indexOf("?") === -1 ? "?" : "&") + "noCache=" + _now(); + } else { + return ""; + } + }; + /** + * Creates a query string for the FlashVars param. + * Does NOT include the cache-busting query param. + * + * @returns FlashVars query string + * @private + */ + var _vars = function(options) { + var i, len, domain, domains, str = "", trustedOriginsExpanded = []; + if (options.trustedDomains) { + if (typeof options.trustedDomains === "string") { + domains = [ options.trustedDomains ]; + } else if (typeof options.trustedDomains === "object" && "length" in options.trustedDomains) { + domains = options.trustedDomains; + } + } + if (domains && domains.length) { + for (i = 0, len = domains.length; i < len; i++) { + if (_hasOwn.call(domains, i) && domains[i] && typeof domains[i] === "string") { + domain = _extractDomain(domains[i]); + if (!domain) { + continue; + } + if (domain === "*") { + trustedOriginsExpanded.length = 0; + trustedOriginsExpanded.push(domain); + break; + } + trustedOriginsExpanded.push.apply(trustedOriginsExpanded, [ domain, "//" + domain, _window.location.protocol + "//" + domain ]); + } + } + } + if (trustedOriginsExpanded.length) { + str += "trustedOrigins=" + _encodeURIComponent(trustedOriginsExpanded.join(",")); + } + if (options.forceEnhancedClipboard === true) { + str += (str ? "&" : "") + "forceEnhancedClipboard=true"; + } + if (typeof options.swfObjectId === "string" && options.swfObjectId) { + str += (str ? "&" : "") + "swfObjectId=" + _encodeURIComponent(options.swfObjectId); + } + if (typeof options.jsVersion === "string" && options.jsVersion) { + str += (str ? "&" : "") + "jsVersion=" + _encodeURIComponent(options.jsVersion); + } + return str; + }; + /** + * Extract the domain (e.g. "github.com") from an origin (e.g. "https://github.com") or + * URL (e.g. "https://github.com/zeroclipboard/zeroclipboard/"). + * + * @returns the domain + * @private + */ + var _extractDomain = function(originOrUrl) { + if (originOrUrl == null || originOrUrl === "") { + return null; + } + originOrUrl = originOrUrl.replace(/^\s+|\s+$/g, ""); + if (originOrUrl === "") { + return null; + } + var protocolIndex = originOrUrl.indexOf("//"); + originOrUrl = protocolIndex === -1 ? originOrUrl : originOrUrl.slice(protocolIndex + 2); + var pathIndex = originOrUrl.indexOf("/"); + originOrUrl = pathIndex === -1 ? originOrUrl : protocolIndex === -1 || pathIndex === 0 ? null : originOrUrl.slice(0, pathIndex); + if (originOrUrl && originOrUrl.slice(-4).toLowerCase() === ".swf") { + return null; + } + return originOrUrl || null; + }; + /** + * Set `allowScriptAccess` based on `trustedDomains` and `window.location.host` vs. `swfPath`. + * + * @returns The appropriate script access level. + * @private + */ + var _determineScriptAccess = function() { + var _extractAllDomains = function(origins) { + var i, len, tmp, resultsArray = []; + if (typeof origins === "string") { + origins = [ origins ]; + } + if (!(typeof origins === "object" && origins && typeof origins.length === "number")) { + return resultsArray; + } + for (i = 0, len = origins.length; i < len; i++) { + if (_hasOwn.call(origins, i) && (tmp = _extractDomain(origins[i]))) { + if (tmp === "*") { + resultsArray.length = 0; + resultsArray.push("*"); + break; + } + if (resultsArray.indexOf(tmp) === -1) { + resultsArray.push(tmp); + } + } + } + return resultsArray; + }; + return function(currentDomain, configOptions) { + var swfDomain = _extractDomain(configOptions.swfPath); + if (swfDomain === null) { + swfDomain = currentDomain; + } + var trustedDomains = _extractAllDomains(configOptions.trustedDomains); + var len = trustedDomains.length; + if (len > 0) { + if (len === 1 && trustedDomains[0] === "*") { + return "always"; + } + if (trustedDomains.indexOf(currentDomain) !== -1) { + if (len === 1 && currentDomain === swfDomain) { + return "sameDomain"; + } + return "always"; + } + } + return "never"; + }; + }(); + /** + * Get the currently active/focused DOM element. + * + * @returns the currently active/focused element, or `null` + * @private + */ + var _safeActiveElement = function() { + try { + return _document.activeElement; + } catch (err) { + return null; + } + }; + /** + * Add a class to an element, if it doesn't already have it. + * + * @returns The element, with its new class added. + * @private + */ + var _addClass = function(element, value) { + var c, cl, className, classNames = []; + if (typeof value === "string" && value) { + classNames = value.split(/\s+/); + } + if (element && element.nodeType === 1 && classNames.length > 0) { + if (element.classList) { + for (c = 0, cl = classNames.length; c < cl; c++) { + element.classList.add(classNames[c]); + } + } else if (element.hasOwnProperty("className")) { + className = " " + element.className + " "; + for (c = 0, cl = classNames.length; c < cl; c++) { + if (className.indexOf(" " + classNames[c] + " ") === -1) { + className += classNames[c] + " "; + } + } + element.className = className.replace(/^\s+|\s+$/g, ""); + } + } + return element; + }; + /** + * Remove a class from an element, if it has it. + * + * @returns The element, with its class removed. + * @private + */ + var _removeClass = function(element, value) { + var c, cl, className, classNames = []; + if (typeof value === "string" && value) { + classNames = value.split(/\s+/); + } + if (element && element.nodeType === 1 && classNames.length > 0) { + if (element.classList && element.classList.length > 0) { + for (c = 0, cl = classNames.length; c < cl; c++) { + element.classList.remove(classNames[c]); + } + } else if (element.className) { + className = (" " + element.className + " ").replace(/[\r\n\t]/g, " "); + for (c = 0, cl = classNames.length; c < cl; c++) { + className = className.replace(" " + classNames[c] + " ", " "); + } + element.className = className.replace(/^\s+|\s+$/g, ""); + } + } + return element; + }; + /** + * Attempt to interpret the element's CSS styling. If `prop` is `"cursor"`, + * then we assume that it should be a hand ("pointer") cursor if the element + * is an anchor element ("a" tag). + * + * @returns The computed style property. + * @private + */ + var _getStyle = function(el, prop) { + var value = _getComputedStyle(el, null).getPropertyValue(prop); + if (prop === "cursor") { + if (!value || value === "auto") { + if (el.nodeName === "A") { + return "pointer"; + } + } + } + return value; + }; + /** + * Get the absolutely positioned coordinates of a DOM element. + * + * @returns Object containing the element's position, width, and height. + * @private + */ + var _getElementPosition = function(el) { + var pos = { + left: 0, + top: 0, + width: 0, + height: 0 + }; + if (el.getBoundingClientRect) { + var elRect = el.getBoundingClientRect(); + var pageXOffset = _window.pageXOffset; + var pageYOffset = _window.pageYOffset; + var leftBorderWidth = _document.documentElement.clientLeft || 0; + var topBorderWidth = _document.documentElement.clientTop || 0; + var leftBodyOffset = 0; + var topBodyOffset = 0; + if (_getStyle(_document.body, "position") === "relative") { + var bodyRect = _document.body.getBoundingClientRect(); + var htmlRect = _document.documentElement.getBoundingClientRect(); + leftBodyOffset = bodyRect.left - htmlRect.left || 0; + topBodyOffset = bodyRect.top - htmlRect.top || 0; + } + pos.left = elRect.left + pageXOffset - leftBorderWidth - leftBodyOffset; + pos.top = elRect.top + pageYOffset - topBorderWidth - topBodyOffset; + pos.width = "width" in elRect ? elRect.width : elRect.right - elRect.left; + pos.height = "height" in elRect ? elRect.height : elRect.bottom - elRect.top; + } + return pos; + }; + /** + * Determine is an element is visible somewhere within the document (page). + * + * @returns Boolean + * @private + */ + var _isElementVisible = function(el) { + if (!el) { + return false; + } + var styles = _getComputedStyle(el, null); + var hasCssHeight = _parseFloat(styles.height) > 0; + var hasCssWidth = _parseFloat(styles.width) > 0; + var hasCssTop = _parseFloat(styles.top) >= 0; + var hasCssLeft = _parseFloat(styles.left) >= 0; + var cssKnows = hasCssHeight && hasCssWidth && hasCssTop && hasCssLeft; + var rect = cssKnows ? null : _getElementPosition(el); + var isVisible = styles.display !== "none" && styles.visibility !== "collapse" && (cssKnows || !!rect && (hasCssHeight || rect.height > 0) && (hasCssWidth || rect.width > 0) && (hasCssTop || rect.top >= 0) && (hasCssLeft || rect.left >= 0)); + return isVisible; + }; + /** + * Clear all existing timeouts and interval polling delegates. + * + * @returns `undefined` + * @private + */ + var _clearTimeoutsAndPolling = function() { + _clearTimeout(_flashCheckTimeout); + _flashCheckTimeout = 0; + _clearInterval(_swfFallbackCheckInterval); + _swfFallbackCheckInterval = 0; + }; + /** + * Reposition the Flash object to cover the currently activated element. + * + * @returns `undefined` + * @private + */ + var _reposition = function() { + var htmlBridge; + if (_currentElement && (htmlBridge = _getHtmlBridge(_flashState.bridge))) { + var pos = _getElementPosition(_currentElement); + _extend(htmlBridge.style, { + width: pos.width + "px", + height: pos.height + "px", + top: pos.top + "px", + left: pos.left + "px", + zIndex: "" + _getSafeZIndex(_globalConfig.zIndex) + }); + } + }; + /** + * Sends a signal to the Flash object to display the hand cursor if `true`. + * + * @returns `undefined` + * @private + */ + var _setHandCursor = function(enabled) { + if (_flashState.ready === true) { + if (_flashState.bridge && typeof _flashState.bridge.setHandCursor === "function") { + _flashState.bridge.setHandCursor(enabled); + } else { + _flashState.ready = false; + } + } + }; + /** + * Get a safe value for `zIndex` + * + * @returns an integer, or "auto" + * @private + */ + var _getSafeZIndex = function(val) { + if (/^(?:auto|inherit)$/.test(val)) { + return val; + } + var zIndex; + if (typeof val === "number" && !_isNaN(val)) { + zIndex = val; + } else if (typeof val === "string") { + zIndex = _getSafeZIndex(_parseInt(val, 10)); + } + return typeof zIndex === "number" ? zIndex : "auto"; + }; + /** + * Attempt to detect if ZeroClipboard is executing inside of a sandboxed iframe. + * If it is, Flash Player cannot be used, so ZeroClipboard is dead in the water. + * + * @see {@link http://lists.w3.org/Archives/Public/public-whatwg-archive/2014Dec/0002.html} + * @see {@link https://github.com/zeroclipboard/zeroclipboard/issues/511} + * @see {@link http://zeroclipboard.org/test-iframes.html} + * + * @returns `true` (is sandboxed), `false` (is not sandboxed), or `null` (uncertain) + * @private + */ + var _detectSandbox = function(doNotReassessFlashSupport) { + var effectiveScriptOrigin, frame, frameError, previousState = _flashState.sandboxed, isSandboxed = null; + doNotReassessFlashSupport = doNotReassessFlashSupport === true; + if (_pageIsFramed === false) { + isSandboxed = false; + } else { + try { + frame = window.frameElement || null; + } catch (e) { + frameError = { + name: e.name, + message: e.message + }; + } + if (frame && frame.nodeType === 1 && frame.nodeName === "IFRAME") { + try { + isSandboxed = frame.hasAttribute("sandbox"); + } catch (e) { + isSandboxed = null; + } + } else { + try { + effectiveScriptOrigin = document.domain || null; + } catch (e) { + effectiveScriptOrigin = null; + } + if (effectiveScriptOrigin === null || frameError && frameError.name === "SecurityError" && /(^|[\s\(\[@])sandbox(es|ed|ing|[\s\.,!\)\]@]|$)/.test(frameError.message.toLowerCase())) { + isSandboxed = true; + } + } + } + _flashState.sandboxed = isSandboxed; + if (previousState !== isSandboxed && !doNotReassessFlashSupport) { + _detectFlashSupport(_ActiveXObject); + } + return isSandboxed; + }; + /** + * Detect the Flash Player status, version, and plugin type. + * + * @see {@link https://code.google.com/p/doctype-mirror/wiki/ArticleDetectFlash#The_code} + * @see {@link http://stackoverflow.com/questions/12866060/detecting-pepper-ppapi-flash-with-javascript} + * + * @returns `undefined` + * @private + */ + var _detectFlashSupport = function(ActiveXObject) { + var plugin, ax, mimeType, hasFlash = false, isActiveX = false, isPPAPI = false, flashVersion = ""; + /** + * Derived from Apple's suggested sniffer. + * @param {String} desc e.g. "Shockwave Flash 7.0 r61" + * @returns {String} "7.0.61" + * @private + */ + function parseFlashVersion(desc) { + var matches = desc.match(/[\d]+/g); + matches.length = 3; + return matches.join("."); + } + function isPepperFlash(flashPlayerFileName) { + return !!flashPlayerFileName && (flashPlayerFileName = flashPlayerFileName.toLowerCase()) && (/^(pepflashplayer\.dll|libpepflashplayer\.so|pepperflashplayer\.plugin)$/.test(flashPlayerFileName) || flashPlayerFileName.slice(-13) === "chrome.plugin"); + } + function inspectPlugin(plugin) { + if (plugin) { + hasFlash = true; + if (plugin.version) { + flashVersion = parseFlashVersion(plugin.version); + } + if (!flashVersion && plugin.description) { + flashVersion = parseFlashVersion(plugin.description); + } + if (plugin.filename) { + isPPAPI = isPepperFlash(plugin.filename); + } + } + } + if (_navigator.plugins && _navigator.plugins.length) { + plugin = _navigator.plugins["Shockwave Flash"]; + inspectPlugin(plugin); + if (_navigator.plugins["Shockwave Flash 2.0"]) { + hasFlash = true; + flashVersion = "2.0.0.11"; + } + } else if (_navigator.mimeTypes && _navigator.mimeTypes.length) { + mimeType = _navigator.mimeTypes["application/x-shockwave-flash"]; + plugin = mimeType && mimeType.enabledPlugin; + inspectPlugin(plugin); + } else if (typeof ActiveXObject !== "undefined") { + isActiveX = true; + try { + ax = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7"); + hasFlash = true; + flashVersion = parseFlashVersion(ax.GetVariable("$version")); + } catch (e1) { + try { + ax = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6"); + hasFlash = true; + flashVersion = "6.0.21"; + } catch (e2) { + try { + ax = new ActiveXObject("ShockwaveFlash.ShockwaveFlash"); + hasFlash = true; + flashVersion = parseFlashVersion(ax.GetVariable("$version")); + } catch (e3) { + isActiveX = false; + } + } + } + } + _flashState.disabled = hasFlash !== true; + _flashState.outdated = flashVersion && _parseFloat(flashVersion) < _parseFloat(_minimumFlashVersion); + _flashState.version = flashVersion || "0.0.0"; + _flashState.pluginType = isPPAPI ? "pepper" : isActiveX ? "activex" : hasFlash ? "netscape" : "unknown"; + }; + /** + * Invoke the Flash detection algorithms immediately upon inclusion so we're not waiting later. + */ + _detectFlashSupport(_ActiveXObject); + /** + * Always assess the `sandboxed` state of the page at important Flash-related moments. + */ + _detectSandbox(true); + /** + * A shell constructor for `ZeroClipboard` client instances. + * + * @constructor + */ + var ZeroClipboard = function() { + if (!(this instanceof ZeroClipboard)) { + return new ZeroClipboard(); + } + if (typeof ZeroClipboard._createClient === "function") { + ZeroClipboard._createClient.apply(this, _args(arguments)); + } + }; + /** + * The ZeroClipboard library's version number. + * + * @static + * @readonly + * @property {string} + */ + _defineProperty(ZeroClipboard, "version", { + value: "2.2.0", + writable: false, + configurable: true, + enumerable: true + }); + /** + * Update or get a copy of the ZeroClipboard global configuration. + * Returns a copy of the current/updated configuration. + * + * @returns Object + * @static + */ + ZeroClipboard.config = function() { + return _config.apply(this, _args(arguments)); + }; + /** + * Diagnostic method that describes the state of the browser, Flash Player, and ZeroClipboard. + * + * @returns Object + * @static + */ + ZeroClipboard.state = function() { + return _state.apply(this, _args(arguments)); + }; + /** + * Check if Flash is unusable for any reason: disabled, outdated, deactivated, etc. + * + * @returns Boolean + * @static + */ + ZeroClipboard.isFlashUnusable = function() { + return _isFlashUnusable.apply(this, _args(arguments)); + }; + /** + * Register an event listener. + * + * @returns `ZeroClipboard` + * @static + */ + ZeroClipboard.on = function() { + return _on.apply(this, _args(arguments)); + }; + /** + * Unregister an event listener. + * If no `listener` function/object is provided, it will unregister all listeners for the provided `eventType`. + * If no `eventType` is provided, it will unregister all listeners for every event type. + * + * @returns `ZeroClipboard` + * @static + */ + ZeroClipboard.off = function() { + return _off.apply(this, _args(arguments)); + }; + /** + * Retrieve event listeners for an `eventType`. + * If no `eventType` is provided, it will retrieve all listeners for every event type. + * + * @returns array of listeners for the `eventType`; if no `eventType`, then a map/hash object of listeners for all event types; or `null` + */ + ZeroClipboard.handlers = function() { + return _listeners.apply(this, _args(arguments)); + }; + /** + * Event emission receiver from the Flash object, forwarding to any registered JavaScript event listeners. + * + * @returns For the "copy" event, returns the Flash-friendly "clipData" object; otherwise `undefined`. + * @static + */ + ZeroClipboard.emit = function() { + return _emit.apply(this, _args(arguments)); + }; + /** + * Create and embed the Flash object. + * + * @returns The Flash object + * @static + */ + ZeroClipboard.create = function() { + return _create.apply(this, _args(arguments)); + }; + /** + * Self-destruct and clean up everything, including the embedded Flash object. + * + * @returns `undefined` + * @static + */ + ZeroClipboard.destroy = function() { + return _destroy.apply(this, _args(arguments)); + }; + /** + * Set the pending data for clipboard injection. + * + * @returns `undefined` + * @static + */ + ZeroClipboard.setData = function() { + return _setData.apply(this, _args(arguments)); + }; + /** + * Clear the pending data for clipboard injection. + * If no `format` is provided, all pending data formats will be cleared. + * + * @returns `undefined` + * @static + */ + ZeroClipboard.clearData = function() { + return _clearData.apply(this, _args(arguments)); + }; + /** + * Get a copy of the pending data for clipboard injection. + * If no `format` is provided, a copy of ALL pending data formats will be returned. + * + * @returns `String` or `Object` + * @static + */ + ZeroClipboard.getData = function() { + return _getData.apply(this, _args(arguments)); + }; + /** + * Sets the current HTML object that the Flash object should overlay. This will put the global + * Flash object on top of the current element; depending on the setup, this may also set the + * pending clipboard text data as well as the Flash object's wrapping element's title attribute + * based on the underlying HTML element and ZeroClipboard configuration. + * + * @returns `undefined` + * @static + */ + ZeroClipboard.focus = ZeroClipboard.activate = function() { + return _focus.apply(this, _args(arguments)); + }; + /** + * Un-overlays the Flash object. This will put the global Flash object off-screen; depending on + * the setup, this may also unset the Flash object's wrapping element's title attribute based on + * the underlying HTML element and ZeroClipboard configuration. + * + * @returns `undefined` + * @static + */ + ZeroClipboard.blur = ZeroClipboard.deactivate = function() { + return _blur.apply(this, _args(arguments)); + }; + /** + * Returns the currently focused/"activated" HTML element that the Flash object is wrapping. + * + * @returns `HTMLElement` or `null` + * @static + */ + ZeroClipboard.activeElement = function() { + return _activeElement.apply(this, _args(arguments)); + }; + /** + * Keep track of the ZeroClipboard client instance counter. + */ + var _clientIdCounter = 0; + /** + * Keep track of the state of the client instances. + * + * Entry structure: + * _clientMeta[client.id] = { + * instance: client, + * elements: [], + * handlers: {} + * }; + */ + var _clientMeta = {}; + /** + * Keep track of the ZeroClipboard clipped elements counter. + */ + var _elementIdCounter = 0; + /** + * Keep track of the state of the clipped element relationships to clients. + * + * Entry structure: + * _elementMeta[element.zcClippingId] = [client1.id, client2.id]; + */ + var _elementMeta = {}; + /** + * Keep track of the state of the mouse event handlers for clipped elements. + * + * Entry structure: + * _mouseHandlers[element.zcClippingId] = { + * mouseover: function(event) {}, + * mouseout: function(event) {}, + * mouseenter: function(event) {}, + * mouseleave: function(event) {}, + * mousemove: function(event) {} + * }; + */ + var _mouseHandlers = {}; + /** + * Extending the ZeroClipboard configuration defaults for the Client module. + */ + _extend(_globalConfig, { + autoActivate: true + }); + /** + * The real constructor for `ZeroClipboard` client instances. + * @private + */ + var _clientConstructor = function(elements) { + var client = this; + client.id = "" + _clientIdCounter++; + _clientMeta[client.id] = { + instance: client, + elements: [], + handlers: {} + }; + if (elements) { + client.clip(elements); + } + ZeroClipboard.on("*", function(event) { + return client.emit(event); + }); + ZeroClipboard.on("destroy", function() { + client.destroy(); + }); + ZeroClipboard.create(); + }; + /** + * The underlying implementation of `ZeroClipboard.Client.prototype.on`. + * @private + */ + var _clientOn = function(eventType, listener) { + var i, len, events, added = {}, meta = _clientMeta[this.id], handlers = meta && meta.handlers; + if (!meta) { + throw new Error("Attempted to add new listener(s) to a destroyed ZeroClipboard client instance"); + } + if (typeof eventType === "string" && eventType) { + events = eventType.toLowerCase().split(/\s+/); + } else if (typeof eventType === "object" && eventType && typeof listener === "undefined") { + for (i in eventType) { + if (_hasOwn.call(eventType, i) && typeof i === "string" && i && typeof eventType[i] === "function") { + this.on(i, eventType[i]); + } + } + } + if (events && events.length) { + for (i = 0, len = events.length; i < len; i++) { + eventType = events[i].replace(/^on/, ""); + added[eventType] = true; + if (!handlers[eventType]) { + handlers[eventType] = []; + } + handlers[eventType].push(listener); + } + if (added.ready && _flashState.ready) { + this.emit({ + type: "ready", + client: this + }); + } + if (added.error) { + for (i = 0, len = _flashStateErrorNames.length; i < len; i++) { + if (_flashState[_flashStateErrorNames[i].replace(/^flash-/, "")]) { + this.emit({ + type: "error", + name: _flashStateErrorNames[i], + client: this + }); + break; + } + } + if (_zcSwfVersion !== undefined && ZeroClipboard.version !== _zcSwfVersion) { + this.emit({ + type: "error", + name: "version-mismatch", + jsVersion: ZeroClipboard.version, + swfVersion: _zcSwfVersion + }); + } + } + } + return this; + }; + /** + * The underlying implementation of `ZeroClipboard.Client.prototype.off`. + * @private + */ + var _clientOff = function(eventType, listener) { + var i, len, foundIndex, events, perEventHandlers, meta = _clientMeta[this.id], handlers = meta && meta.handlers; + if (!handlers) { + return this; + } + if (arguments.length === 0) { + events = _keys(handlers); + } else if (typeof eventType === "string" && eventType) { + events = eventType.split(/\s+/); + } else if (typeof eventType === "object" && eventType && typeof listener === "undefined") { + for (i in eventType) { + if (_hasOwn.call(eventType, i) && typeof i === "string" && i && typeof eventType[i] === "function") { + this.off(i, eventType[i]); + } + } + } + if (events && events.length) { + for (i = 0, len = events.length; i < len; i++) { + eventType = events[i].toLowerCase().replace(/^on/, ""); + perEventHandlers = handlers[eventType]; + if (perEventHandlers && perEventHandlers.length) { + if (listener) { + foundIndex = perEventHandlers.indexOf(listener); + while (foundIndex !== -1) { + perEventHandlers.splice(foundIndex, 1); + foundIndex = perEventHandlers.indexOf(listener, foundIndex); + } + } else { + perEventHandlers.length = 0; + } + } + } + } + return this; + }; + /** + * The underlying implementation of `ZeroClipboard.Client.prototype.handlers`. + * @private + */ + var _clientListeners = function(eventType) { + var copy = null, handlers = _clientMeta[this.id] && _clientMeta[this.id].handlers; + if (handlers) { + if (typeof eventType === "string" && eventType) { + copy = handlers[eventType] ? handlers[eventType].slice(0) : []; + } else { + copy = _deepCopy(handlers); + } + } + return copy; + }; + /** + * The underlying implementation of `ZeroClipboard.Client.prototype.emit`. + * @private + */ + var _clientEmit = function(event) { + if (_clientShouldEmit.call(this, event)) { + if (typeof event === "object" && event && typeof event.type === "string" && event.type) { + event = _extend({}, event); + } + var eventCopy = _extend({}, _createEvent(event), { + client: this + }); + _clientDispatchCallbacks.call(this, eventCopy); + } + return this; + }; + /** + * The underlying implementation of `ZeroClipboard.Client.prototype.clip`. + * @private + */ + var _clientClip = function(elements) { + if (!_clientMeta[this.id]) { + throw new Error("Attempted to clip element(s) to a destroyed ZeroClipboard client instance"); + } + elements = _prepClip(elements); + for (var i = 0; i < elements.length; i++) { + if (_hasOwn.call(elements, i) && elements[i] && elements[i].nodeType === 1) { + if (!elements[i].zcClippingId) { + elements[i].zcClippingId = "zcClippingId_" + _elementIdCounter++; + _elementMeta[elements[i].zcClippingId] = [ this.id ]; + if (_globalConfig.autoActivate === true) { + _addMouseHandlers(elements[i]); + } + } else if (_elementMeta[elements[i].zcClippingId].indexOf(this.id) === -1) { + _elementMeta[elements[i].zcClippingId].push(this.id); + } + var clippedElements = _clientMeta[this.id] && _clientMeta[this.id].elements; + if (clippedElements.indexOf(elements[i]) === -1) { + clippedElements.push(elements[i]); + } + } + } + return this; + }; + /** + * The underlying implementation of `ZeroClipboard.Client.prototype.unclip`. + * @private + */ + var _clientUnclip = function(elements) { + var meta = _clientMeta[this.id]; + if (!meta) { + return this; + } + var clippedElements = meta.elements; + var arrayIndex; + if (typeof elements === "undefined") { + elements = clippedElements.slice(0); + } else { + elements = _prepClip(elements); + } + for (var i = elements.length; i--; ) { + if (_hasOwn.call(elements, i) && elements[i] && elements[i].nodeType === 1) { + arrayIndex = 0; + while ((arrayIndex = clippedElements.indexOf(elements[i], arrayIndex)) !== -1) { + clippedElements.splice(arrayIndex, 1); + } + var clientIds = _elementMeta[elements[i].zcClippingId]; + if (clientIds) { + arrayIndex = 0; + while ((arrayIndex = clientIds.indexOf(this.id, arrayIndex)) !== -1) { + clientIds.splice(arrayIndex, 1); + } + if (clientIds.length === 0) { + if (_globalConfig.autoActivate === true) { + _removeMouseHandlers(elements[i]); + } + delete elements[i].zcClippingId; + } + } + } + } + return this; + }; + /** + * The underlying implementation of `ZeroClipboard.Client.prototype.elements`. + * @private + */ + var _clientElements = function() { + var meta = _clientMeta[this.id]; + return meta && meta.elements ? meta.elements.slice(0) : []; + }; + /** + * The underlying implementation of `ZeroClipboard.Client.prototype.destroy`. + * @private + */ + var _clientDestroy = function() { + if (!_clientMeta[this.id]) { + return; + } + this.unclip(); + this.off(); + delete _clientMeta[this.id]; + }; + /** + * Inspect an Event to see if the Client (`this`) should honor it for emission. + * @private + */ + var _clientShouldEmit = function(event) { + if (!(event && event.type)) { + return false; + } + if (event.client && event.client !== this) { + return false; + } + var meta = _clientMeta[this.id]; + var clippedEls = meta && meta.elements; + var hasClippedEls = !!clippedEls && clippedEls.length > 0; + var goodTarget = !event.target || hasClippedEls && clippedEls.indexOf(event.target) !== -1; + var goodRelTarget = event.relatedTarget && hasClippedEls && clippedEls.indexOf(event.relatedTarget) !== -1; + var goodClient = event.client && event.client === this; + if (!meta || !(goodTarget || goodRelTarget || goodClient)) { + return false; + } + return true; + }; + /** + * Handle the actual dispatching of events to a client instance. + * + * @returns `undefined` + * @private + */ + var _clientDispatchCallbacks = function(event) { + var meta = _clientMeta[this.id]; + if (!(typeof event === "object" && event && event.type && meta)) { + return; + } + var async = _shouldPerformAsync(event); + var wildcardTypeHandlers = meta && meta.handlers["*"] || []; + var specificTypeHandlers = meta && meta.handlers[event.type] || []; + var handlers = wildcardTypeHandlers.concat(specificTypeHandlers); + if (handlers && handlers.length) { + var i, len, func, context, eventCopy, originalContext = this; + for (i = 0, len = handlers.length; i < len; i++) { + func = handlers[i]; + context = originalContext; + if (typeof func === "string" && typeof _window[func] === "function") { + func = _window[func]; + } + if (typeof func === "object" && func && typeof func.handleEvent === "function") { + context = func; + func = func.handleEvent; + } + if (typeof func === "function") { + eventCopy = _extend({}, event); + _dispatchCallback(func, context, [ eventCopy ], async); + } + } + } + }; + /** + * Prepares the elements for clipping/unclipping. + * + * @returns An Array of elements. + * @private + */ + var _prepClip = function(elements) { + if (typeof elements === "string") { + elements = []; + } + return typeof elements.length !== "number" ? [ elements ] : elements; + }; + /** + * Add a `mouseover` handler function for a clipped element. + * + * @returns `undefined` + * @private + */ + var _addMouseHandlers = function(element) { + if (!(element && element.nodeType === 1)) { + return; + } + var _suppressMouseEvents = function(event) { + if (!(event || (event = _window.event))) { + return; + } + if (event._source !== "js") { + event.stopImmediatePropagation(); + event.preventDefault(); + } + delete event._source; + }; + var _elementMouseOver = function(event) { + if (!(event || (event = _window.event))) { + return; + } + _suppressMouseEvents(event); + ZeroClipboard.focus(element); + }; + element.addEventListener("mouseover", _elementMouseOver, false); + element.addEventListener("mouseout", _suppressMouseEvents, false); + element.addEventListener("mouseenter", _suppressMouseEvents, false); + element.addEventListener("mouseleave", _suppressMouseEvents, false); + element.addEventListener("mousemove", _suppressMouseEvents, false); + _mouseHandlers[element.zcClippingId] = { + mouseover: _elementMouseOver, + mouseout: _suppressMouseEvents, + mouseenter: _suppressMouseEvents, + mouseleave: _suppressMouseEvents, + mousemove: _suppressMouseEvents + }; + }; + /** + * Remove a `mouseover` handler function for a clipped element. + * + * @returns `undefined` + * @private + */ + var _removeMouseHandlers = function(element) { + if (!(element && element.nodeType === 1)) { + return; + } + var mouseHandlers = _mouseHandlers[element.zcClippingId]; + if (!(typeof mouseHandlers === "object" && mouseHandlers)) { + return; + } + var key, val, mouseEvents = [ "move", "leave", "enter", "out", "over" ]; + for (var i = 0, len = mouseEvents.length; i < len; i++) { + key = "mouse" + mouseEvents[i]; + val = mouseHandlers[key]; + if (typeof val === "function") { + element.removeEventListener(key, val, false); + } + } + delete _mouseHandlers[element.zcClippingId]; + }; + /** + * Creates a new ZeroClipboard client instance. + * Optionally, auto-`clip` an element or collection of elements. + * + * @constructor + */ + ZeroClipboard._createClient = function() { + _clientConstructor.apply(this, _args(arguments)); + }; + /** + * Register an event listener to the client. + * + * @returns `this` + */ + ZeroClipboard.prototype.on = function() { + return _clientOn.apply(this, _args(arguments)); + }; + /** + * Unregister an event handler from the client. + * If no `listener` function/object is provided, it will unregister all handlers for the provided `eventType`. + * If no `eventType` is provided, it will unregister all handlers for every event type. + * + * @returns `this` + */ + ZeroClipboard.prototype.off = function() { + return _clientOff.apply(this, _args(arguments)); + }; + /** + * Retrieve event listeners for an `eventType` from the client. + * If no `eventType` is provided, it will retrieve all listeners for every event type. + * + * @returns array of listeners for the `eventType`; if no `eventType`, then a map/hash object of listeners for all event types; or `null` + */ + ZeroClipboard.prototype.handlers = function() { + return _clientListeners.apply(this, _args(arguments)); + }; + /** + * Event emission receiver from the Flash object for this client's registered JavaScript event listeners. + * + * @returns For the "copy" event, returns the Flash-friendly "clipData" object; otherwise `undefined`. + */ + ZeroClipboard.prototype.emit = function() { + return _clientEmit.apply(this, _args(arguments)); + }; + /** + * Register clipboard actions for new element(s) to the client. + * + * @returns `this` + */ + ZeroClipboard.prototype.clip = function() { + return _clientClip.apply(this, _args(arguments)); + }; + /** + * Unregister the clipboard actions of previously registered element(s) on the page. + * If no elements are provided, ALL registered elements will be unregistered. + * + * @returns `this` + */ + ZeroClipboard.prototype.unclip = function() { + return _clientUnclip.apply(this, _args(arguments)); + }; + /** + * Get all of the elements to which this client is clipped. + * + * @returns array of clipped elements + */ + ZeroClipboard.prototype.elements = function() { + return _clientElements.apply(this, _args(arguments)); + }; + /** + * Self-destruct and clean up everything for a single client. + * This will NOT destroy the embedded Flash object. + * + * @returns `undefined` + */ + ZeroClipboard.prototype.destroy = function() { + return _clientDestroy.apply(this, _args(arguments)); + }; + /** + * Stores the pending plain text to inject into the clipboard. + * + * @returns `this` + */ + ZeroClipboard.prototype.setText = function(text) { + if (!_clientMeta[this.id]) { + throw new Error("Attempted to set pending clipboard data from a destroyed ZeroClipboard client instance"); + } + ZeroClipboard.setData("text/plain", text); + return this; + }; + /** + * Stores the pending HTML text to inject into the clipboard. + * + * @returns `this` + */ + ZeroClipboard.prototype.setHtml = function(html) { + if (!_clientMeta[this.id]) { + throw new Error("Attempted to set pending clipboard data from a destroyed ZeroClipboard client instance"); + } + ZeroClipboard.setData("text/html", html); + return this; + }; + /** + * Stores the pending rich text (RTF) to inject into the clipboard. + * + * @returns `this` + */ + ZeroClipboard.prototype.setRichText = function(richText) { + if (!_clientMeta[this.id]) { + throw new Error("Attempted to set pending clipboard data from a destroyed ZeroClipboard client instance"); + } + ZeroClipboard.setData("application/rtf", richText); + return this; + }; + /** + * Stores the pending data to inject into the clipboard. + * + * @returns `this` + */ + ZeroClipboard.prototype.setData = function() { + if (!_clientMeta[this.id]) { + throw new Error("Attempted to set pending clipboard data from a destroyed ZeroClipboard client instance"); + } + ZeroClipboard.setData.apply(this, _args(arguments)); + return this; + }; + /** + * Clears the pending data to inject into the clipboard. + * If no `format` is provided, all pending data formats will be cleared. + * + * @returns `this` + */ + ZeroClipboard.prototype.clearData = function() { + if (!_clientMeta[this.id]) { + throw new Error("Attempted to clear pending clipboard data from a destroyed ZeroClipboard client instance"); + } + ZeroClipboard.clearData.apply(this, _args(arguments)); + return this; + }; + /** + * Gets a copy of the pending data to inject into the clipboard. + * If no `format` is provided, a copy of ALL pending data formats will be returned. + * + * @returns `String` or `Object` + */ + ZeroClipboard.prototype.getData = function() { + if (!_clientMeta[this.id]) { + throw new Error("Attempted to get pending clipboard data from a destroyed ZeroClipboard client instance"); + } + return ZeroClipboard.getData.apply(this, _args(arguments)); + }; + if (typeof define === "function" && define.amd) { + define(function() { + return ZeroClipboard; + }); + } else if (typeof module === "object" && module && typeof module.exports === "object" && module.exports) { + module.exports = ZeroClipboard; + } else { + window.ZeroClipboard = ZeroClipboard; + } +})(function() { + return this || window; +}()); +},{}]},{},[23,59,61,60,62,83,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,84,85,86,87,100,101,102,90,91,92,93,94,95,31,35,32,33,40,34,36,37,38,39])("zeroclipboard") +}); diff --git a/package.js b/package.js index 088517e..fdcade8 100644 --- a/package.js +++ b/package.js @@ -1,6 +1,6 @@ Package.describe({ name: 'awsp:handsontable', - version: '0.12.1', + version: '0.12.2', summary: 'Handsontable is a data grid component with an Excel-like appearance. Built in JavaScript.', git: 'https://github.com/awsp/handsontable-meteor', documentation: 'README.md' @@ -13,11 +13,11 @@ Package.onUse(function(api) { api.addFiles([ 'bower_components/pikaday/css/pikaday.css', - 'lib/handsontable.meteor.0.20.1.css', + 'lib/handsontable.meteor.0.20.2.css', 'lib/handsontable-ruleJS/src/handsontable.formula.css', 'lib/rulejs/ruleJS.all.full.js', - 'lib/handsontable.meteor.0.20.1.js', + 'lib/handsontable.meteor.0.20.2.js', 'lib/rulejs/handsontable.formula.js', 'lib/handsontable-ruleJS/lib/highlight/styles/github.css', 'lib/rulejs/highlight.pack.js',